Source: bespin
Version: 0.r1552+nmu1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps

Hi!

While working on Debian's “reproducible builds” effort [1], we have
noticed that bespin doesn't build reproducibly.
PNG images generated during the build have timestamps embedded.

The attached patch prevents this. Once applied, bespin can be
built reproducibly in our current experimental framework.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds

diff --git a/debian/patches/no_timestamps_in_images.patch b/debian/patches/no_timestamps_in_images.patch
new file mode 100644
index 0000000..7b4028a
--- /dev/null
+++ b/debian/patches/no_timestamps_in_images.patch
@@ -0,0 +1,86 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: prevent embedding of timestamps into png files
+
+Index: bespin-0.r1552+nmu1/ksplash/bespin/generate.sh
+===================================================================
+--- bespin-0.r1552+nmu1.orig/ksplash/bespin/generate.sh
++++ bespin-0.r1552+nmu1/ksplash/bespin/generate.sh
+@@ -27,14 +27,16 @@ DIR="${1}x${2}"
+ 
+ mkdir "$DIR" 2>/dev/null
+ 
++PNGOPTS="+set date:create +set date:modify -define png:exclude-chunk=time"
++
+ if [ ! -e "$DIR/background.png" ]; then
+-    convert -scale $DIR! -filter lanczos ../../kdm/bespin/background.jpg "$DIR/background.png"
++    convert -scale $DIR! -filter lanczos ../../kdm/bespin/background.jpg $PNGOPTS "$DIR/background.png"
+ fi
+ 
+ if [ ! -e Preview.png ]; then
+     convert -scale 740x420! -filter lanczos ../../kdm/bespin/background.jpg ".tmp.png"
+     convert -crop 740x420+6660+0 pulse.png ".tmp2.png"
+-    convert ".tmp.png" ".tmp2.png" -gravity Center -composite Preview.png
++    convert ".tmp.png" ".tmp2.png" -gravity Center -composite $PNGOPTS Preview.png
+     mogrify -scale 400x300 -filter lanczos Preview.png
+     rm -f ".tmp.png" ".tmp2.png"
+ fi
+Index: bespin-0.r1552+nmu1/ksplash/tibanna/generate.sh
+===================================================================
+--- bespin-0.r1552+nmu1.orig/ksplash/tibanna/generate.sh
++++ bespin-0.r1552+nmu1/ksplash/tibanna/generate.sh
+@@ -33,31 +33,33 @@ fi
+ 
+ mkdir "$DIR" 2>/dev/null
+ 
++PNGOPTS="+set date:create +set date:modify -define png:exclude-chunk=time"
++
+ ratio=$(( $1 * 1000 / $2 ))
+ 
+ if (( $ratio == 1600 )); then #scale
+     echo tata
+-    convert -scale $DIR! -filter lanczos ../../kdm/tibanna/background.jpg "$DIR/background.png"
+-    convert -scale $DIR! -filter lanczos flash.png "$DIR/flash.png"
++    convert -scale $DIR! -filter lanczos ../../kdm/tibanna/background.jpg $PNGOPTS "$DIR/background.png"
++    convert -scale $DIR! -filter lanczos flash.png $PNGOPTS "$DIR/flash.png"
+ elif (( $ratio < 1600 )); then #crop width
+     W=$(( $1 * 1200 / $2 ))
+     X=$(( (1920-$W)/2 ))
+-    convert -crop ${W}x1200+${X}+0 -scale $DIR! -filter lanczos ../../kdm/tibanna/background.jpg "$DIR/background.png"
++    convert -crop ${W}x1200+${X}+0 -scale $DIR! -filter lanczos ../../kdm/tibanna/background.jpg $PNGOPTS "$DIR/background.png"
+ else # crop height
+     H=$(( 1920 * $2 / $1 ))
+     Y=$(( (1200-$H)/2 ))
+-    convert -crop 1920x${H}+0+${Y} -scale $DIR! -filter lanczos ../../kdm/tibanna/background.jpg "$DIR/background.png"
++    convert -crop 1920x${H}+0+${Y} -scale $DIR! -filter lanczos ../../kdm/tibanna/background.jpg $PNGOPTS "$DIR/background.png"
+ fi
+ 
+ H=$(( 282*$2 / 1200 ))
+-convert -scale $((7*$1))x${H}! -filter lanczos flash.png "$DIR/flash.png"
++convert -scale $((7*$1))x${H}! -filter lanczos flash.png $PNGOPTS "$DIR/flash.png"
+ 
+ Y=$(( ($2*464)/1200 ))
+ 
+ 
+ 
+ if [ ! -e Preview.png ]; then
+-    convert -crop 1600x1200+160+0 -scale 400x300! -filter lanczos ../../kdm/tibanna/background.jpg Preview.png
++    convert -crop 1600x1200+160+0 -scale 400x300! -filter lanczos ../../kdm/tibanna/background.jpg $PNGOPTS Preview.png
+ fi
+ 
+ echo "SCALE OFF
+Index: bespin-0.r1552+nmu1/ksplash/aperture/generate.sh
+===================================================================
+--- bespin-0.r1552+nmu1.orig/ksplash/aperture/generate.sh
++++ bespin-0.r1552+nmu1/ksplash/aperture/generate.sh
+@@ -29,8 +29,10 @@ DIR="${1}x${2}"
+ 
+ mkdir "$DIR" 2>/dev/null
+ 
++PNGOPTS="+set date:create +set date:modify -define png:exclude-chunk=time"
++
+ if [ ! -e "$DIR/background.png" ]; then
+-    convert -resize ${DIR}^ -gravity Center -crop ${DIR}+0+0 +repage -filter lanczos ../../kdm/aperture/background.jpg "$DIR/background.png"
++    convert -resize ${DIR}^ -gravity Center -crop ${DIR}+0+0 +repage -filter lanczos ../../kdm/aperture/background.jpg $PNGOPTS "$DIR/background.png"
+ fi
+ 
+ echo "SCALE OFF
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9314454
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+no_timestamps_in_images.patch

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to