summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2020-05-21 14:52:01 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2020-05-21 14:54:48 +0200
commitf2de892b375d30ad79502509a47a15f0f4d68fee (patch)
tree579b47b37ebaf8318877b7655626b14a64f8d24e /gnu
parent1476ea0e55f7f644e920e90f48f7d545e24db25a (diff)
downloadguix-f2de892b375d30ad79502509a47a15f0f4d68fee.tar.gz
gnu: http-parser: Fix build [and guix pull!] on i686-linux.
This follows up on commit 5c30eb61d74034a1b7c188b8d7be7df0b926025f.

* gnu/packages/web.scm (http-parser)[source]: Apply the armhf patch not
here…
[arguments]: …but in a phase & only on armhf-linux.
[native-inputs]: Add it on armhf-linux.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/web.scm62
1 files changed, 38 insertions, 24 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 0aaa5e80bb..f6fab8f036 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -5920,30 +5920,28 @@ into your tests.  It automatically starts up a HTTP server in a separate thread
     (name "http-parser")
     (version "2.9.4")
     (home-page "https://github.com/nodejs/http-parser")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference (url home-page)
-                                  (commit (string-append "v" version))))
-              (sha256
-               (base32
-                "1vda4dp75pjf5fcph73sy0ifm3xrssrmf927qd1x8g3q46z0cv6c"))
-              (file-name (git-file-name name version))
-              (patches
-               (cons*
-                (origin
-                  ;; Treat an empty port (e.g. `http://hostname:/`) when parsing
-                  ;; URLs as if no port were specified.  This patch is applied
-                  ;; to Fedora's http-parser and to libgit2's bundled version.
-                  (method url-fetch)
-                  (uri (string-append
-                        "https://src.fedoraproject.org/rpms/http-parser/raw/"
-                        "e89b4c4e2874c19079a5a1a2d2ccc61b551aa289/"
-                        "f/0001-url-treat-empty-port-as-default.patch"))
-                  (sha256
-                   (base32
-                    "0pbxf2nq9pcn299k2b2ls8ldghaqln9glnp79gi57mamx4iy0f6g")))
-                ;; A fix for <https://issues.guix.gnu.org/40604>.
-                (search-patches "http-parser-fix-assertion-on-armhf.patch")))))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference (url home-page)
+                           (commit (string-append "v" version))))
+       (sha256
+        (base32 "1vda4dp75pjf5fcph73sy0ifm3xrssrmf927qd1x8g3q46z0cv6c"))
+       (file-name (git-file-name name version))
+       (patches
+        (list
+         (origin
+           ;; Treat an empty port (e.g. `http://hostname:/`) when parsing
+           ;; URLs as if no port were specified.  This patch is applied
+           ;; to Fedora's http-parser and to libgit2's bundled version.
+           (method url-fetch)
+           (uri (string-append
+                 "https://src.fedoraproject.org/rpms/http-parser/raw/"
+                 "e89b4c4e2874c19079a5a1a2d2ccc61b551aa289/"
+                 "f/0001-url-treat-empty-port-as-default.patch"))
+           (sha256
+            (base32
+             "0pbxf2nq9pcn299k2b2ls8ldghaqln9glnp79gi57mamx4iy0f6g")))))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
@@ -5956,6 +5954,14 @@ into your tests.  It automatically starts up a HTTP server in a separate thread
                    '("CC=gcc")))
        #:phases
        (modify-phases %standard-phases
+         ,@(match (%current-system)
+             ("armhf-linux"
+              '((add-before 'check 'apply-assertion.patch
+                  (lambda* (#:key inputs #:allow-other-keys)
+                    (let ((patch (assoc-ref inputs "assertion.patch")))
+                      (invoke "patch" "-p1" "-i" patch)
+                      #t)))))
+             (_ '()))
          ,@(if (%current-target-system)
                '((replace 'configure
                     (lambda* (#:key target #:allow-other-keys)
@@ -5966,6 +5972,14 @@ into your tests.  It automatically starts up a HTTP server in a separate thread
                          (string-append "AR=" target "-ar\n")))
                       #t)))
                '((delete 'configure))))))
+    (native-inputs
+     `(,@(match (%current-system)
+           ("armhf-linux"
+            ;; A fix for <https://issues.guix.gnu.org/40604> which in turn
+            ;; breaks i686-linux builds.
+            `(("assertion.patch"
+               ,@(search-patches "http-parser-fix-assertion-on-armhf.patch"))))
+           (_ '()))))
     (synopsis "HTTP request/response parser for C")
     (description "This is a parser for HTTP messages written in C.  It parses
 both requests and responses.  The parser is designed to be used in