guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/05: gnu: datefudge: Only use glibc-2.31 workaround on supported platf


From: guix-commits
Subject: 05/05: gnu: datefudge: Only use glibc-2.31 workaround on supported platforms.
Date: Tue, 28 Apr 2020 10:11:05 -0400 (EDT)

efraim pushed a commit to branch wip-ppc
in repository guix.

commit 239f4b9f63f8bdb9f00a2f267683487f746acd38
Author: Efraim Flashner <address@hidden>
AuthorDate: Sat Apr 25 22:21:27 2020 +0300

    gnu: datefudge: Only use glibc-2.31 workaround on supported platforms.
    
    The powerPC port is using glibc-2.30.
    
    * gnu/packages/time.scm (datefudge)[source]: Remove patch.
    [arguments]: When not on powerpc-linux, add phase to adapt the code for
    glibc-2.31.
    * gnu/packages/patches/datefudge-gettimeofday.patch: Remove file.
    * gnu/local.mk (dist_patch_DATA): Remove it.
---
 gnu/local.mk                                      |  1 -
 gnu/packages/patches/datefudge-gettimeofday.patch | 13 -------------
 gnu/packages/time.scm                             | 12 ++++++++++--
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index eb9a5dd..4a3f86a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -836,7 +836,6 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch         \
   %D%/packages/patches/date-output-pkg-config-files.patch      \
   %D%/packages/patches/darkice-workaround-fpermissive-error.patch      \
-  %D%/packages/patches/datefudge-gettimeofday.patch            \
   %D%/packages/patches/dbacl-include-locale.h.patch            \
   %D%/packages/patches/dbus-helper-search-path.patch           \
   %D%/packages/patches/dbus-c++-gcc-compat.patch               \
diff --git a/gnu/packages/patches/datefudge-gettimeofday.patch 
b/gnu/packages/patches/datefudge-gettimeofday.patch
deleted file mode 100644
index 11c7640..0000000
--- a/gnu/packages/patches/datefudge-gettimeofday.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Add the 'restrict' qualifier to match the 'gettimeofday' declaration found
-in glibc 2.31.
-
---- datefudge-1.23/datefudge.c 2020-02-17 22:35:21.343341725 +0100
-+++ datefudge-1.23/datefudge.c 2020-02-17 22:35:49.619117874 +0100
-@@ -78,6 +78,6 @@
-     return 0;
- }
- 
--int gettimeofday(struct timeval *x, struct timezone *y) {
-+int gettimeofday(struct timeval *restrict x, void *restrict y) {
-     return __gettimeofday(x,y);
- }
diff --git a/gnu/packages/time.scm b/gnu/packages/time.scm
index a059976..f845ccb 100644
--- a/gnu/packages/time.scm
+++ b/gnu/packages/time.scm
@@ -463,8 +463,7 @@ datetime type.")
                     version ".tar.xz"))
               (sha256
                (base32
-                "0ifnlb0mc8qc2kb5042pbz0ns6rwcb7201di8wyrsphl0yhnhxiv"))
-              (patches (search-patches "datefudge-gettimeofday.patch"))))
+                "0ifnlb0mc8qc2kb5042pbz0ns6rwcb7201di8wyrsphl0yhnhxiv"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
@@ -479,6 +478,15 @@ datetime type.")
                (("VERSION := \\$\\(shell dpkg-parsechangelog .*")
                 (string-append "VERSION = " ,version)))
              #t))
+         ,@(if (string-prefix? "powerpc" (or (%current-target-system)
+                                             (%current-system)))
+             '()
+             '((add-after 'unpack 'patch-for-glibc-2.31
+                 (lambda _
+                   (substitute* "datefudge.c"
+                     (("int gettimeofday\\(struct timeval \\*x, struct 
timezone \\*y")
+                      "int gettimeofday(struct timeval *restrict x, void 
*restrict y"))
+                   #t))))
          (delete 'configure))))
     (native-inputs
      `(("perl" ,perl)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]