When building this recipe, internal archives are compressed with gzip. The compressed archives contain a header with the field MTIME (Modification Time) which is initialized from the built date. As a consequence, two builds of this recipe always generate packages whose checksum differs. Adding the -n option to gzip while compressing the archive does not save the original time stamp by default hence making reproducible package.
Signed-off-by: Jean-Marc BOUCHE <[email protected]> --- I forgot to integrate a header and a Signed-off-by field into the patch file use-no-name-option-for-gzip.patch hence this v2 to fix it --- .../use-no-name-option-for-gzip.patch | 64 +++++++++++++++++++ .../terminus-font/terminus-font_4.49.1.bb | 4 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-graphics/terminus-font/terminus-font/use-no-name-option-for-gzip.patch diff --git a/meta-oe/recipes-graphics/terminus-font/terminus-font/use-no-name-option-for-gzip.patch b/meta-oe/recipes-graphics/terminus-font/terminus-font/use-no-name-option-for-gzip.patch new file mode 100644 index 000000000..cc76e67a4 --- /dev/null +++ b/meta-oe/recipes-graphics/terminus-font/terminus-font/use-no-name-option-for-gzip.patch @@ -0,0 +1,64 @@ +Build compressed archives with -n + +The compressed archives contain a header with the field MTIME +(Modification Time) which is initialized from the built date. +As a consequence, two separate builds generate compressed archives +whose checksum differs. Such behavior prevents reproducible builds. + +Adding the -n option to gzip while compressing the archive does +not save the original time stamp by default hence making +reproducible build. + +Signed-off-by: Jean-Marc BOUCHE <[email protected]> +Index: terminus-font-4.49.1/Makefile +=================================================================== +--- terminus-font-4.49.1.orig/Makefile ++++ terminus-font-4.49.1/Makefile +@@ -92,9 +92,9 @@ otbdir = $(prefix)/share/fonts/terminus + + install: $(PSF) $(PCF) + mkdir -p $(DESTDIR)$(psfdir) +- for i in $(PSF) ; do gzip -c $$i > $(DESTDIR)$(psfdir)/$$i.gz ; done ++ for i in $(PSF) ; do gzip -c -n $$i > $(DESTDIR)$(psfdir)/$$i.gz ; done + mkdir -p $(DESTDIR)$(x11dir) +- for i in $(PCF) ; do gzip -c $$i > $(DESTDIR)$(x11dir)/$$i.gz ; done ++ for i in $(PCF) ; do gzip -c -n $$i > $(DESTDIR)$(x11dir)/$$i.gz ; done + + uninstall: + for i in $(PSF) ; do rm -f $(DESTDIR)$(psfdir)/$$i.gz ; done +@@ -193,7 +193,7 @@ psf: $(PSF) + + install-psf: $(PSF) + mkdir -p $(DESTDIR)$(psfdir) +- for i in $(PSF) ; do gzip -c $$i > $(DESTDIR)$(psfdir)/$$i.gz ; done ++ for i in $(PSF) ; do gzip -c -n $$i > $(DESTDIR)$(psfdir)/$$i.gz ; done + + uninstall-psf: + for i in $(PSF) ; do rm -f $(DESTDIR)$(psfdir)/$$i.gz ; done +@@ -202,7 +202,7 @@ psf-vgaw: $(PSF_VGAW) + + install-psf-vgaw: $(PSF_VGAW) + mkdir -p $(DESTDIR)$(psfdir) +- for i in $(PSF_VGAW) ; do gzip -c $$i > $(DESTDIR)$(psfdir)/$$i.gz ; done ++ for i in $(PSF_VGAW) ; do gzip -c -n $$i > $(DESTDIR)$(psfdir)/$$i.gz ; done + + uninstall-psf-vgaw: + for i in $(PSF_VGAW) ; do rm -f $(DESTDIR)$(psfdir)/$$i.gz ; done +@@ -279,7 +279,7 @@ pcf: $(PCF) + + install-pcf: $(PCF) + mkdir -p $(DESTDIR)$(x11dir) +- for i in $(PCF) ; do gzip -c $$i > $(DESTDIR)$(x11dir)/$$i.gz ; done ++ for i in $(PCF) ; do gzip -c -n $$i > $(DESTDIR)$(x11dir)/$$i.gz ; done + + uninstall-pcf: + for i in $(PCF) ; do rm -f $(DESTDIR)$(x11dir)/$$i.gz ; done +@@ -288,7 +288,7 @@ pcf-8bit: $(PCF_8BIT) + + install-pcf-8bit: $(PCF_8BIT) + mkdir -p $(DESTDIR)$(x11dir) +- for i in $(PCF_8BIT) ; do gzip -c $$i > $(DESTDIR)$(x11dir)/$$i.gz ; done ++ for i in $(PCF_8BIT) ; do gzip -c -n $$i > $(DESTDIR)$(x11dir)/$$i.gz ; done + + uninstall-pcf-8bit: + for i in $(PCF_8BIT) ; do rm -f $(DESTDIR)$(x11dir)/$$i.gz ; done diff --git a/meta-oe/recipes-graphics/terminus-font/terminus-font_4.49.1.bb b/meta-oe/recipes-graphics/terminus-font/terminus-font_4.49.1.bb index 65cafab9e..1fabe2e29 100644 --- a/meta-oe/recipes-graphics/terminus-font/terminus-font_4.49.1.bb +++ b/meta-oe/recipes-graphics/terminus-font/terminus-font_4.49.1.bb @@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = "file://OFL.TXT;md5=f57e6cca943dbc6ef83dc14f1855bdcc" DEPENDS = "hostperl-runtime-native gzip-native bdftopcf-native" -SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz" +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ + file://use-no-name-option-for-gzip.patch \ + " SRC_URI[md5sum] = "1b6acbd221957e33c8a792ebfaf3a659" SRC_URI[sha256sum] = "d961c1b781627bf417f9b340693d64fc219e0113ad3a3af1a3424c7aa373ef79" -- 2.25.1
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#107307): https://lists.openembedded.org/g/openembedded-devel/message/107307 Mute This Topic: https://lists.openembedded.org/mt/103053754/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
