Source: pyephem
Version: 3.7.6.0-6
Severity: wishlist
Tags: patch upstream
User: reproducible-bui...@lists.alioth.debian.org
Usertags: fileordering
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that pyephem could not be built reproducibly.
During build it links object files in non-deterministic order.

The attached patch fixes this by sorting the list of source files.

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..72e4a60
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,16 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Sort source files for deterministic linking order
+
+--- a/setup.py
++++ b/setup.py
+@@ -13,8 +13,8 @@
+ # directory plus ...
+ 
+ libastro_version = '3.7.6'
+-libastro_files = glob('libastro-%s/*.c' % libastro_version)
+-libastro_data = glob('extensions/data/*.c')
++libastro_files = sorted(glob('libastro-%s/*.c' % libastro_version))
++libastro_data = sorted(glob('extensions/data/*.c'))
+ 
+ def read(*filenames):
+     return open(os.path.join(os.path.dirname(__file__), *filenames)).read()
diff --git a/debian/patches/series b/debian/patches/series
index 94d33e5..df14648 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ fix_tests_unicode.patch
 spellfix.patch
 disable_failing_tests.patch
 fix_string_to_double.patch
+reproducible_build.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to