From 665b48a0d69a8b47b6c5424f13c4a9f2f0030fa5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 20 Apr 2020 21:32:29 +0100 Subject: gnu: http-parser: Include a pkg-config file. This is useful when using http-parser in the node package, at least at version 12 of node. * gnu/packages/web.scm (http-parser)[arguments]: Add a 'install-pkg-config phase. --- gnu/packages/web.scm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 0092477679..89f4a02c8e 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -5844,7 +5844,31 @@ into your tests. It automatically starts up a HTTP server in a separate thread "CC=gcc" "library") #:phases (modify-phases %standard-phases - (delete 'configure)))) + (delete 'configure) + (add-after 'install 'install-pkg-config + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (include (string-append out "/include")) + (lib (string-append out "/lib")) + (pkgconfig (string-append out "/lib/pkgconfig"))) + (mkdir-p pkgconfig) + ;; The node build system expects this to exist, but a + ;; pkg-config file isn't provided in the upstream source. + (call-with-output-file (string-append pkgconfig "/http_parser.pc") + (lambda (port) + (format port "prefix=~a +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: HTTP Parser +Description: Parser for HTTP messages written in C +Version: ~a +Libs: -L${libdir} -lhttp_parser +Cflags: -I${includedir} +" + out ,version)))) + #t))))) (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