Source: linuxtv-dvb-apps
Version: 1.1.1+rev1500-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: locale
X-Debbugs-Cc: [email protected]

Hi!

While working on the "reproducible builds"€ effort [1], we have noticed
that linuxtv-dvb-apps could not be built reproducibly.
During build a header file is generated whose elements are sorted
differently depending on the configured locale.

The attached patch fixes this by setting LC_ALL to C before sorting.

Regards,
 Reiner

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


diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
new file mode 100644
index 0000000..d87a1f4
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,28 @@
+Author: Reiner Herrmann <[email protected]>
+Description: Sort items in header file locale-independent
+ The order of items in the generated header file can differ
+ depending on the currently configured locale.
+ Sort them with LC_ALL set to C to get a reproducible result.
+
+Index: linuxtv-dvb-apps-1.1.1+rev1500/util/av7110_loadkeys/generate-keynames.sh
+===================================================================
+--- linuxtv-dvb-apps-1.1.1+rev1500.orig/util/av7110_loadkeys/generate-keynames.sh
++++ linuxtv-dvb-apps-1.1.1+rev1500/util/av7110_loadkeys/generate-keynames.sh
+@@ -20,7 +20,7 @@ echo >> $1
+ echo "static struct input_key_name key_name [] = {" >> $1
+ for x in $(cat /usr/include/linux/input.h input_fake.h | \
+            egrep "#define[ \t]+KEY_" | grep -v KEY_MAX | \
+-           cut -f 1 | cut -f 2 -d " " | sort -u) ; do
++           cut -f 1 | cut -f 2 -d " " | LC_ALL=C sort -u) ; do
+     echo "        { \"$(echo $x | cut -b 5-)\", $x }," >> $1
+ done
+ echo "};" >> $1
+@@ -28,7 +28,7 @@ echo >> $1
+ echo "static struct input_key_name btn_name [] = {" >> $1
+ for x in $(cat /usr/include/linux/input.h input_fake.h | \
+            egrep "#define[ \t]+BTN_" | \
+-           cut -f 1 | cut -f 2 -d " " | sort -u) ; do
++           cut -f 1 | cut -f 2 -d " " | LC_ALL=C sort -u) ; do
+      echo "        { \"$(echo $x | cut -b 5-)\", $x }," >> $1
+ done
+ echo "};" >> $1
diff --git a/debian/patches/series b/debian/patches/series
index 37b732b..4c5c718 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ apps_manpages.patch
 alevt.patch
 dbug606728.diff
 use-ldflags.patch
+reproducible_build.patch

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to