Source: libmouse-perl
Version: 2.4.5-1
Severity: wishlist
Tags: patch
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 libmouse-perl could not be built reproducibly.
During build a file is generated with references to other files.
The file list is embedded in readdir order, which is not deterministic.

The attached patch sorts the list before the filenames are embedded.

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..450b6fb
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,11 @@
+--- a/tool/generate-mouse-tiny.pl
++++ b/tool/generate-mouse-tiny.pl
+@@ -78,7 +78,7 @@
+ # tell Perl we already have all of the Mouse files loaded:
+ EOF
+ 
+-for my $file (@files) {
++for my $file (sort @files) {
+     (my $inc = $file) =~ s{^lib/}{};
+     printf { $handle } "%-45s = __FILE__;\n", "\$INC{'$inc'}";
+ }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b2026fe
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible_build.patch

Reply via email to