summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorAntero Mejr <antero@mailbox.org>2022-07-19 20:36:53 -0400
committerJonathan Brielmaier <jonathan.brielmaier@web.de>2022-07-27 16:55:22 +0200
commitecb91c993dcce7e6c3faa0d156013dac42380cc6 (patch)
treeac4bdd20c976030cc9d421971f2db95238621ece /gnu/packages/patches
parentd10effc13f6b973acae147f1c0aa3d7307246130 (diff)
downloadguix-ecb91c993dcce7e6c3faa0d156013dac42380cc6.tar.gz
gnu: libphonenumber: Build reproducibly.
* gnu/packages/messaging.scm (libphonenumber): Add patch.
* gnu/packages/patches/libphonenumber-reproducible-build.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register patch.

Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/libphonenumber-reproducible-build.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/gnu/packages/patches/libphonenumber-reproducible-build.patch b/gnu/packages/patches/libphonenumber-reproducible-build.patch
new file mode 100644
index 0000000000..6d8cf5a628
--- /dev/null
+++ b/gnu/packages/patches/libphonenumber-reproducible-build.patch
@@ -0,0 +1,25 @@
+Author: Antero Mejr <antero@mailbox.org>
+Upstream status: I didn't report upstream because they don't have an issue tracker and
+PRs require signing the Google CLA. If someone willing to sign the CLA
+wants to submit the patch, please go ahead.
+
+diff --git a/tools/cpp/src/cpp-build/generate_geocoding_data.cc b/tools/cpp/src/cpp-build/generate_geocoding_data.cc
+index 021cf5c8..5948e140 100644
+--- a/tools/cpp/src/cpp-build/generate_geocoding_data.cc
++++ b/tools/cpp/src/cpp-build/generate_geocoding_data.cc
+@@ -88,6 +88,7 @@ class DirEntry {
+
+   const std::string& name() const { return name_; }
+   DirEntryKinds kind() const { return kind_; }
++  bool operator<(const DirEntry& d) { return name_ < d.name(); }
+ 
+  private:
+   std::string name_;
+@@ -115,6 +116,7 @@ bool ListDirectory(const string& path, vector<DirEntry>* entries) {
+     errno = 0;
+     entry = readdir(dir);
+     if (entry == NULL) {
++      std::sort(entries->begin(), entries->end());
+       return errno == 0;
+     }
+     if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) {