From f2de892b375d30ad79502509a47a15f0f4d68fee Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 21 May 2020 14:52:01 +0200 Subject: gnu: http-parser: Fix build [and guix pull!] on i686-linux. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- gnu/packages/web.scm | 62 ++++++++++++++++++++++++++++++++-------------------- 1 file 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 . - (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 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 -- cgit v1.2.3