Source: libsynthesis Version: 3.4.0.47.4-2 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: locale X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org
Hi! While working on the "reproducible builds" effort [1], we have noticed that libsynthesis could not be built reproducibly. Some file lists are sorted differently depending on the 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/series b/debian/patches/series new file mode 100644 index 0000000..428d147 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +sort_file_lists.patch diff --git a/debian/patches/sort_file_lists.patch b/debian/patches/sort_file_lists.patch new file mode 100644 index 0000000..9d55779 --- /dev/null +++ b/debian/patches/sort_file_lists.patch @@ -0,0 +1,52 @@ +Author: Reiner Herrmann <rei...@reiner-h.de> +Description: Make sorting independent of locale + Sort behaves differently depending on the configured locale. + To get reproducible results, sort the file lists + with the C locale. + +Index: libsynthesis-3.4.0.47.4/src/gen-makefile-am.sh +=================================================================== +--- libsynthesis-3.4.0.47.4.orig/src/gen-makefile-am.sh ++++ libsynthesis-3.4.0.47.4/src/gen-makefile-am.sh +@@ -74,7 +74,7 @@ LIBSYNTHESIS_SOURCES=`find ${ENGINE_SOUR + sysync_SDK/DB_Interfaces/text_db \ + \( -name '*.cpp' -o -name '*.[ch]' \) | + grep -v -E -f EXCLUDE_FILES | +- sort` ++ LC_ALL=C sort` + LIBSYNTHESIS_SOURCES=`echo $LIBSYNTHESIS_SOURCES` + + # files to be included in both libsynthesis and libsynthesissdk; +@@ -84,7 +84,7 @@ cat SERVER_FILES CLIENT_FILES EXTRA_FILE + LIBSYNTHESISSDK_SOURCES_BOTH=`find sysync_SDK/Sources \ + \( -name '*.cpp' -o -name '*.c' \) | + grep -v -E -f EXCLUDE_FILES | +- sort` ++ LC_ALL=C sort` + LIBSYNTHESISSDK_SOURCES_BOTH=`echo $LIBSYNTHESISSDK_SOURCES_BOTH` + + # files only needed in libsynthesissdk +@@ -93,7 +93,7 @@ LIBSYNTHESISSDK_SOURCES_ONLY=`find sysyn + \( -name '*.cpp' -o -name '*.c' \) | + grep -E -f SDK_FILES | + grep -v -E -f EXCLUDE_FILES | +- sort` ++ LC_ALL=C sort` + LIBSYNTHESISSDK_SOURCES_ONLY=`echo $LIBSYNTHESISSDK_SOURCES_ONLY` + + # files needed in libsmltk +@@ -101,12 +101,12 @@ LIBSMLTK_SOURCES=`find syncml_tk \ + \( -name '*.cpp' -o -name '*.[ch]' \) \ + \! \( -path syncml_tk/src/sml/\*/palm/\* -o \ + -path syncml_tk/src/sml/\*/win/\* \) | +- sort` ++ LC_ALL=C sort` + LIBSMLTK_SOURCES=`echo $LIBSMLTK_SOURCES` + + # header files required for using libsynthesissdk, + # with "synthesis/" prefix +-LIBSYNTHESISSDK_HEADERS=`find sysync_SDK/Sources -name '*.h' | sed -e 's;.*/;synthesis/;' | sort` ++LIBSYNTHESISSDK_HEADERS=`find sysync_SDK/Sources -name '*.h' | sed -e 's;.*/;synthesis/;' | LC_ALL=C sort` + LIBSYNTHESISSDK_HEADERS=`echo $LIBSYNTHESISSDK_HEADERS` + + sed -e "s;@LIBSYNTHESIS_SOURCES@;$LIBSYNTHESIS_SOURCES;" \
signature.asc
Description: OpenPGP digital signature