aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-04-20 21:32:29 +0100
committerChristopher Baines <mail@cbaines.net>2020-04-20 21:32:29 +0100
commit665b48a0d69a8b47b6c5424f13c4a9f2f0030fa5 (patch)
tree7039112ae40922e752891596a6ff69aa1d4420fd
parentfd546bbbeee5237e29264791b61f9ba453ebff9f (diff)
downloadguix-665b48a0d69a8b47b6c5424f13c4a9f2f0030fa5.tar
guix-665b48a0d69a8b47b6c5424f13c4a9f2f0030fa5.tar.gz
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.
-rw-r--r--gnu/packages/web.scm26
1 files changed, 25 insertions, 1 deletions
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