mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
change build scripts to make reproducible builds possible
- makes SOURCE_DATE_EPOCH affect BUILDDATE and version string - makes wpsbuild.pl output deterministic - omits unnecessary extended metadata from zip files - runs strip-nondeterminism on zip files if REPRODUCIBLE_ZIP is set Change-Id: I1617e3f5233b2bc356fcfa6457be1a7785c303f9
This commit is contained in:
parent
21e95258f2
commit
85c1ff8667
6 changed files with 18 additions and 4 deletions
|
|
@ -62,7 +62,10 @@ $(BUILDDIR)/apps/lang/lang-enum.txt: $(BUILDDIR)/lang_enum.h
|
|||
|
||||
$(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ) $(wildcard $(BUILDDIR)/apps/lang/*.talk) $(BUILDDIR)/apps/lang/voice-corrections.txt $(BUILDDIR)/apps/lang/lang-enum.txt
|
||||
$(call PRINTS,ZIP $(subst $(BUILDDIR)/,,$@))
|
||||
$(SILENT)zip -9 -q $@ $(subst $(BUILDDIR)/,,$^)
|
||||
$(SILENT)zip -X -9 -q $@ $(subst $(BUILDDIR)/,,$^)
|
||||
ifneq ($(REPRODUCIBLE_ZIP),)
|
||||
$(SILENT)strip-nondeterminism $@
|
||||
endif
|
||||
|
||||
#copy any included talk files to the /lang directory
|
||||
$(BUILDDIR)/apps/lang/%.talk: $(ROOTDIR)/apps/lang/%.talk
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ GetOptions ( 'r|root=s' => \$ROOT,
|
|||
# Thus we use the ":" for those for which we use a default value in case of ""
|
||||
# and assign the default value afterwards
|
||||
if ($ziptool eq '') {
|
||||
$ziptool = "zip -r9";
|
||||
$ziptool = "zip -r9 -X";
|
||||
}
|
||||
if ($output eq '') {
|
||||
$output = "rockbox.zip"
|
||||
|
|
|
|||
4
tools/configure
vendored
4
tools/configure
vendored
|
|
@ -4915,7 +4915,11 @@ export BUILDDIR=${pwd}
|
|||
export RBCODEC_BLD=${pwd}/lib/rbcodec
|
||||
export VOICELANGUAGE=${voicelanguage}
|
||||
export MEMORYSIZE=${memory}
|
||||
ifeq (\$(SOURCE_DATE_EPOCH),)
|
||||
export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
|
||||
else
|
||||
export BUILDDATE:=\$(shell date -d "@\$(SOURCE_DATE_EPOCH)" -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
|
||||
endif
|
||||
export MKFIRMWARE=${tool}
|
||||
export BMP2RB_MONO=${bmp2rb_mono}
|
||||
export BMP2RB_NATIVE=${bmp2rb_native}
|
||||
|
|
|
|||
|
|
@ -351,6 +351,9 @@ $(BUILDDIR)/rockbox.zip: build
|
|||
endif
|
||||
$(call PRINTS,ZIP rockbox$(ZIPFILESUFFIX).zip)
|
||||
$(SILENT)$(TOOLSDIR)/buildzip.pl $(VERBOSEOPT) --app=$(APPLICATION) -m \"$(MODELNAME)\" -i \"$(TARGET_ID)\" -o $(BUILDDIR)/rockbox$(ZIPFILESUFFIX).zip -r "$(ROOTDIR)" --rbdir="$(RBDIR)" $(BUILDZIPOPTS) $(TARGET) $(BINARY)
|
||||
ifneq ($(REPRODUCIBLE_ZIP),)
|
||||
$(SILENT)strip-nondeterminism $(BUILDDIR)/rockbox$(ZIPFILESUFFIX).zip
|
||||
endif
|
||||
|
||||
mapzip:
|
||||
$(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
|
||||
|
|
|
|||
|
|
@ -50,7 +50,11 @@ if [ -z $VERSION ]; then
|
|||
# Ok, we need to derive it from the Version Control system
|
||||
VER=`gitversion $TOP`
|
||||
fi
|
||||
VERSION=$VER-`date -u +%y%m%d`
|
||||
if [ -z $SOURCE_DATE_EPOCH ]; then
|
||||
VERSION=$VER-`date -u +%y%m%d`
|
||||
else
|
||||
VERSION=$VER-`date -d @$SOURCE_DATE_EPOCH -u +%y%m%d`
|
||||
fi
|
||||
fi
|
||||
echo $VERSION
|
||||
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ MOO
|
|||
"rwps" => $rwps,
|
||||
"rsbs" => $rsbs,
|
||||
"rfms" => $rfms);
|
||||
for my $skin (keys %skinfiles) {
|
||||
for my $skin (sort keys %skinfiles) {
|
||||
my $val = $skinfiles{$skin};
|
||||
if (!defined($val)) {
|
||||
# dont put value if not defined (e.g. rwps when there's no remote)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue