mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build-system/haskell: Add 'extra-directories' keyword.
See <https://bugs.gnu.org/39309>. * guix/build-system/haskell.scm (lower): Include the transitive propagated inputs of 'extra-directories' inputs. (haskell-build): Add the 'extra-directories' keyword and pass it through to the builder. * guix/build/haskell-build-system.scm (configure): Use it to select which inputs get passed via 'extra-include-dirs' and 'extra-lib-dirs' to Cabal. * gnu/packages/haskell-xyz.scm (ghc-alsa-core, ghc-hmatrix, ghc-hmatrix-gsl, ghc-hslua, ghc-iwlib, ghc-libyaml, ghc-ncurses, ghc-openglraw, ghc-x11, ghc-x11-xft, ghc-zlib): Set 'extra-directories'. * gnu/packages/haskell-crypto.scm (ghc-digest, ghc-hsopenssl): Likewise.
This commit is contained in:
parent
3f7922cbf5
commit
54a5fd0791
4 changed files with 47 additions and 12 deletions
|
@ -343,6 +343,8 @@ generators, and more.")
|
||||||
(base32
|
(base32
|
||||||
"04gy2zp8yzvv7j9bdfvmfzcz3sqyqa6rwslqcn4vyair2vmif5v4"))))
|
"04gy2zp8yzvv7j9bdfvmfzcz3sqyqa6rwslqcn4vyair2vmif5v4"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("zlib")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("zlib" ,zlib)))
|
`(("zlib" ,zlib)))
|
||||||
(home-page
|
(home-page
|
||||||
|
@ -790,6 +792,8 @@ extensions.")
|
||||||
(base32
|
(base32
|
||||||
"0qivl9clmybfglwxqp2sq308rv4ia4rhwshcsc8b029bvpp0mpsi"))))
|
"0qivl9clmybfglwxqp2sq308rv4ia4rhwshcsc8b029bvpp0mpsi"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("openssl")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("ghc-network" ,ghc-network)
|
`(("ghc-network" ,ghc-network)
|
||||||
("openssl" ,openssl)))
|
("openssl" ,openssl)))
|
||||||
|
|
|
@ -327,6 +327,8 @@ tool lex or flex for C/C++.")
|
||||||
(base32
|
(base32
|
||||||
"1avh4a419h9d2zsslg6j8hm87ppgsgqafz8ll037rk2yy1g4jl7b"))))
|
"1avh4a419h9d2zsslg6j8hm87ppgsgqafz8ll037rk2yy1g4jl7b"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("alsa-lib")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
|
`(("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
|
||||||
("alsa-lib" ,alsa-lib)))
|
("alsa-lib" ,alsa-lib)))
|
||||||
|
@ -5636,6 +5638,8 @@ accessed or modified.")
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "1sqy1aci5zfagkb34mz3xdil7cl96z4b4cx28cha54vc5sx1lhpg"))))
|
(base32 "1sqy1aci5zfagkb34mz3xdil7cl96z4b4cx28cha54vc5sx1lhpg"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("lapack")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("ghc-random" ,ghc-random)
|
`(("ghc-random" ,ghc-random)
|
||||||
("ghc-split" ,ghc-split)
|
("ghc-split" ,ghc-split)
|
||||||
|
@ -5667,6 +5671,8 @@ numerical computations based on BLAS and LAPACK.")
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "0v6dla426x4ywaq59jm89ql1i42n39iw6z0j378xwb676v9kfxhm"))))
|
(base32 "0v6dla426x4ywaq59jm89ql1i42n39iw6z0j378xwb676v9kfxhm"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("gsl")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("ghc-hmatrix" ,ghc-hmatrix)
|
`(("ghc-hmatrix" ,ghc-hmatrix)
|
||||||
("ghc-vector" ,ghc-vector)
|
("ghc-vector" ,ghc-vector)
|
||||||
|
@ -5884,7 +5890,8 @@ handler built in.")
|
||||||
"183bgl5jcx5y2r94lviqfw0a5w9089nxjd1z40k8vx9y2h60pm6j"))))
|
"183bgl5jcx5y2r94lviqfw0a5w9089nxjd1z40k8vx9y2h60pm6j"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:configure-flags '("-fsystem-lua")))
|
`(#:configure-flags '("-fsystem-lua")
|
||||||
|
#:extra-directories ("lua")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("lua" ,lua)
|
`(("lua" ,lua)
|
||||||
("ghc-exceptions" ,ghc-exceptions)
|
("ghc-exceptions" ,ghc-exceptions)
|
||||||
|
@ -6494,6 +6501,8 @@ instances for conversion to and from JSON .ipynb files.")
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "0khmfwql4vwj55idsxmhjhrbqzfir3g9wm5lmpvnf77mm95cfpdz"))))
|
(base32 "0khmfwql4vwj55idsxmhjhrbqzfir3g9wm5lmpvnf77mm95cfpdz"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("wireless-tools")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("wireless-tools" ,wireless-tools)))
|
`(("wireless-tools" ,wireless-tools)))
|
||||||
(home-page "https://github.com/jaor/iwlib")
|
(home-page "https://github.com/jaor/iwlib")
|
||||||
|
@ -6876,7 +6885,8 @@ compiler versions.")
|
||||||
#t))))
|
#t))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:configure-flags `("--flags=system-libyaml")))
|
`(#:configure-flags `("--flags=system-libyaml")
|
||||||
|
#:extra-directories ("libyaml")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("ghc-conduit" ,ghc-conduit)
|
`(("ghc-conduit" ,ghc-conduit)
|
||||||
("ghc-resourcet" ,ghc-resourcet)
|
("ghc-resourcet" ,ghc-resourcet)
|
||||||
|
@ -8090,7 +8100,8 @@ between 2 and 3 times faster than the Mersenne Twister.")
|
||||||
"0gsyyaqyh5r9zc0rhwpj5spyd6i4w2vj61h4nihgmmh0yyqvf3z5"))))
|
"0gsyyaqyh5r9zc0rhwpj5spyd6i4w2vj61h4nihgmmh0yyqvf3z5"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:phases
|
'(#:extra-directories ("ncurses")
|
||||||
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-before 'build 'fix-includes
|
(add-before 'build 'fix-includes
|
||||||
(lambda _
|
(lambda _
|
||||||
|
@ -8458,6 +8469,8 @@ version 1.3).")
|
||||||
(base32
|
(base32
|
||||||
"0zgllb4bcash2i2cispa3j565aw3dpxs41ghmhpvyvi4a6xmyldx"))))
|
"0zgllb4bcash2i2cispa3j565aw3dpxs41ghmhpvyvi4a6xmyldx"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("glu")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("ghc-half" ,ghc-half)
|
`(("ghc-half" ,ghc-half)
|
||||||
("ghc-fixed" ,ghc-fixed)
|
("ghc-fixed" ,ghc-fixed)
|
||||||
|
@ -14292,6 +14305,9 @@ modernized interface.")
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "0gg6852mrlgl8zng1j84fismz7k81jr5fk92glgkscf8q6ryg0bm"))))
|
(base32 "0gg6852mrlgl8zng1j84fismz7k81jr5fk92glgkscf8q6ryg0bm"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories
|
||||||
|
("libx11" "libxrandr" "libxinerama" "libxscrnsaver")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("libx11" ,libx11)
|
`(("libx11" ,libx11)
|
||||||
("libxrandr" ,libxrandr)
|
("libxrandr" ,libxrandr)
|
||||||
|
@ -14316,6 +14332,8 @@ bindings are a direct translation of the C bindings.")
|
||||||
"X11-xft-" version ".tar.gz"))
|
"X11-xft-" version ".tar.gz"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "1lgqb0s2qfwwgbvwxhjbi23rbwamzdi0l0slfr20c3jpcbp3zfjf"))))
|
(base32 "1lgqb0s2qfwwgbvwxhjbi23rbwamzdi0l0slfr20c3jpcbp3zfjf"))))
|
||||||
|
(arguments
|
||||||
|
`(#:extra-directories ("libx11" "libxft" "xorgproto")))
|
||||||
(inputs
|
(inputs
|
||||||
`(("ghc-x11" ,ghc-x11)
|
`(("ghc-x11" ,ghc-x11)
|
||||||
("ghc-utf8-string" ,ghc-utf8-string)
|
("ghc-utf8-string" ,ghc-utf8-string)
|
||||||
|
@ -14516,7 +14534,8 @@ modifying, and extracting files from zip archives in Haskell.")
|
||||||
"1l11jraslcrp9d4wnhwfyhwk4fsiq1aq8i6vj81vcq1m2zzi1y7h"))))
|
"1l11jraslcrp9d4wnhwfyhwk4fsiq1aq8i6vj81vcq1m2zzi1y7h"))))
|
||||||
(build-system haskell-build-system)
|
(build-system haskell-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:phases
|
`(#:extra-directories ("zlib")
|
||||||
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-before 'configure 'strip-test-framework-constraints
|
(add-before 'configure 'strip-test-framework-constraints
|
||||||
(lambda _
|
(lambda _
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
|
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
|
||||||
|
;;; Copyright © 2020 Timothy Sample <samplet@ngyro.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
#:use-module (guix build-system)
|
#:use-module (guix build-system)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:export (%haskell-build-system-modules
|
#:export (%haskell-build-system-modules
|
||||||
haskell-build
|
haskell-build
|
||||||
|
@ -100,7 +102,18 @@ version REVISION."
|
||||||
(("out") (cons "static" outputs))
|
(("out") (cons "static" outputs))
|
||||||
(_ outputs)))
|
(_ outputs)))
|
||||||
(build haskell-build)
|
(build haskell-build)
|
||||||
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
(arguments
|
||||||
|
(substitute-keyword-arguments
|
||||||
|
(strip-keyword-arguments private-keywords arguments)
|
||||||
|
((#:extra-directories extra-directories)
|
||||||
|
`(list ,@(append-map
|
||||||
|
(lambda (name)
|
||||||
|
(match (assoc name inputs)
|
||||||
|
((_ pkg)
|
||||||
|
(match (package-transitive-propagated-inputs pkg)
|
||||||
|
(((propagated-names . _) ...)
|
||||||
|
(cons name propagated-names))))))
|
||||||
|
extra-directories))))))))
|
||||||
|
|
||||||
(define* (haskell-build store name inputs
|
(define* (haskell-build store name inputs
|
||||||
#:key source
|
#:key source
|
||||||
|
@ -110,6 +123,7 @@ version REVISION."
|
||||||
(test-target "test")
|
(test-target "test")
|
||||||
(parallel-build? #t)
|
(parallel-build? #t)
|
||||||
(configure-flags ''())
|
(configure-flags ''())
|
||||||
|
(extra-directories ''())
|
||||||
(phases '(@ (guix build haskell-build-system)
|
(phases '(@ (guix build haskell-build-system)
|
||||||
%standard-phases))
|
%standard-phases))
|
||||||
(outputs '("out" "static"))
|
(outputs '("out" "static"))
|
||||||
|
@ -138,6 +152,7 @@ provides a 'Setup.hs' file as its build system."
|
||||||
(derivation->output-path revision))
|
(derivation->output-path revision))
|
||||||
(revision revision))
|
(revision revision))
|
||||||
#:configure-flags ,configure-flags
|
#:configure-flags ,configure-flags
|
||||||
|
#:extra-directories ,extra-directories
|
||||||
#:haddock-flags ,haddock-flags
|
#:haddock-flags ,haddock-flags
|
||||||
#:system ,system
|
#:system ,system
|
||||||
#:test-target ,test-target
|
#:test-target ,test-target
|
||||||
|
|
|
@ -73,17 +73,14 @@ and parameters ~s~%"
|
||||||
(error "no Setup.hs nor Setup.lhs found"))))
|
(error "no Setup.hs nor Setup.lhs found"))))
|
||||||
|
|
||||||
(define* (configure #:key outputs inputs tests? (configure-flags '())
|
(define* (configure #:key outputs inputs tests? (configure-flags '())
|
||||||
#:allow-other-keys)
|
(extra-directories '()) #:allow-other-keys)
|
||||||
"Configure a given Haskell package."
|
"Configure a given Haskell package."
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
(doc (assoc-ref outputs "doc"))
|
(doc (assoc-ref outputs "doc"))
|
||||||
(lib (assoc-ref outputs "lib"))
|
(lib (assoc-ref outputs "lib"))
|
||||||
(bin (assoc-ref outputs "bin"))
|
(bin (assoc-ref outputs "bin"))
|
||||||
(name-version (strip-store-file-name out))
|
(name-version (strip-store-file-name out))
|
||||||
(input-dirs (match inputs
|
(extra-dirs (filter-map (cut assoc-ref inputs <>) extra-directories))
|
||||||
(((_ . dir) ...)
|
|
||||||
dir)
|
|
||||||
(_ '())))
|
|
||||||
(ghc-path (getenv "GHC_PACKAGE_PATH"))
|
(ghc-path (getenv "GHC_PACKAGE_PATH"))
|
||||||
(params `(,(string-append "--prefix=" out)
|
(params `(,(string-append "--prefix=" out)
|
||||||
,(string-append "--libdir=" (or lib out) "/lib")
|
,(string-append "--libdir=" (or lib out) "/lib")
|
||||||
|
@ -94,9 +91,9 @@ and parameters ~s~%"
|
||||||
,(string-append "--package-db=" %tmp-db-dir)
|
,(string-append "--package-db=" %tmp-db-dir)
|
||||||
"--global"
|
"--global"
|
||||||
,@(map (cut string-append "--extra-include-dirs=" <>)
|
,@(map (cut string-append "--extra-include-dirs=" <>)
|
||||||
(search-path-as-list '("include") input-dirs))
|
(search-path-as-list '("include") extra-dirs))
|
||||||
,@(map (cut string-append "--extra-lib-dirs=" <>)
|
,@(map (cut string-append "--extra-lib-dirs=" <>)
|
||||||
(search-path-as-list '("lib") input-dirs))
|
(search-path-as-list '("lib") extra-dirs))
|
||||||
,@(if tests?
|
,@(if tests?
|
||||||
'("--enable-tests")
|
'("--enable-tests")
|
||||||
'())
|
'())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue