unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Antero Mejr via Guix-patches via <guix-patches@gnu.org>
To: 56642@debbugs.gnu.org
Cc: antero@mailbox.org, jonathan.brielmaier@web.de
Subject: [bug#56642] [PATCH v2] gnu: libphonenumber: Build reproducibly.
Date: Tue, 19 Jul 2022 20:36:53 -0400	[thread overview]
Message-ID: <20220720003653.211106-1-antero@mailbox.org> (raw)
In-Reply-To: <20220719152750.128283-1-antero@mailbox.org>

* 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

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) {
-- 
2.36.1





  parent reply	other threads:[~2022-07-20  0:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 15:27 [bug#56642] [PATCH] gnu: Make libphonenumber reproducible Antero Mejr via Guix-patches via
2022-07-19 22:06 ` Jonathan Brielmaier
2022-07-20  0:36 ` Antero Mejr via Guix-patches via [this message]
2022-07-27 14:57   ` bug#56642: [PATCH v2] gnu: libphonenumber: Build reproducibly Jonathan Brielmaier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220720003653.211106-1-antero@mailbox.org \
    --to=guix-patches@gnu.org \
    --cc=56642@debbugs.gnu.org \
    --cc=antero@mailbox.org \
    --cc=jonathan.brielmaier@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).