diff mbox series

[bug#56642,v2] gnu: libphonenumber: Build reproducibly.

Message ID 20220720003653.211106-1-antero@mailbox.org
State Accepted
Headers show
Series [bug#56642,v2] gnu: libphonenumber: Build reproducibly. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Antero Mejr July 20, 2022, 12:36 a.m. UTC
* gnu/packages/messaging.scm (libphonenumber): Add patch.
* gnu/packages/patches/libphonenumber-reproducible-build.patch: New
file.
---
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. However, updating libphonenumber
to 8.12.X breaks evolution-data-server.

 gnu/packages/messaging.scm                    |  3 ++-
 .../libphonenumber-reproducible-build.patch   | 20 +++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/libphonenumber-reproducible-build.patch

Comments

Jonathan Brielmaier July 27, 2022, 2:57 p.m. UTC | #1
On 20.07.22 02:36, Antero Mejr wrote:
> * gnu/packages/messaging.scm (libphonenumber): Add patch.
> * gnu/packages/patches/libphonenumber-reproducible-build.patch: New
> file.
> ---
> 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. However, updating libphonenumber
> to 8.12.X breaks evolution-data-server.

Hi Antero,

I pushed the change now as ecb91c993dcce7e6c3faa0d156013dac42380cc6. I
registered the patch at gnu/local.mk and added your comment ontop of the
patch. As that's what our linter makes happy :)

~Jonathan
diff mbox series

Patch

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index b68a798715..c75b504ec5 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -2782,6 +2782,8 @@  (define-public libphonenumber
                     (url "https://github.com/google/libphonenumber")
                     (commit (string-append "v" version))))
               (file-name (git-file-name name version))
+              (patches (search-patches
+                        "libphonenumber-reproducible-build.patch"))
               (sha256
                (base32
                 "06y3mh1d1mks6d0ynxp3980g712nkf8l5nyljpybsk326b246hg9"))))
@@ -2803,7 +2805,6 @@  (define-public libphonenumber
    (home-page "https://github.com/google/libphonenumber")
    (license license:asl2.0)))
 
-
 (define-public chatty
  (package
    (name "chatty")
diff --git a/gnu/packages/patches/libphonenumber-reproducible-build.patch b/gnu/packages/patches/libphonenumber-reproducible-build.patch
new file mode 100644
index 0000000000..6f68fe41a0
--- /dev/null
+++ b/gnu/packages/patches/libphonenumber-reproducible-build.patch
@@ -0,0 +1,20 @@ 
+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) {