diff options
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build-system/haskell.scm | 17 | ||||
-rw-r--r-- | guix/build/haskell-build-system.scm | 11 |
2 files changed, 20 insertions, 8 deletions
diff --git a/guix/build-system/haskell.scm b/guix/build-system/haskell.scm index f92fbcd713..8304e3b222 100644 --- a/guix/build-system/haskell.scm +++ b/guix/build-system/haskell.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> +;;; Copyright © 2020 Timothy Sample <samplet@ngyro.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +27,7 @@ #:use-module (guix build-system) #:use-module (guix build-system gnu) #:use-module (ice-9 match) + #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%haskell-build-system-modules haskell-build @@ -100,7 +102,18 @@ version REVISION." (("out") (cons "static" outputs)) (_ outputs))) (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 #:key source @@ -110,6 +123,7 @@ version REVISION." (test-target "test") (parallel-build? #t) (configure-flags ''()) + (extra-directories ''()) (phases '(@ (guix build haskell-build-system) %standard-phases)) (outputs '("out" "static")) @@ -138,6 +152,7 @@ provides a 'Setup.hs' file as its build system." (derivation->output-path revision)) (revision revision)) #:configure-flags ,configure-flags + #:extra-directories ,extra-directories #:haddock-flags ,haddock-flags #:system ,system #:test-target ,test-target diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index d587962b8b..d7789cdef9 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -73,17 +73,14 @@ and parameters ~s~%" (error "no Setup.hs nor Setup.lhs found")))) (define* (configure #:key outputs inputs tests? (configure-flags '()) - #:allow-other-keys) + (extra-directories '()) #:allow-other-keys) "Configure a given Haskell package." (let* ((out (assoc-ref outputs "out")) (doc (assoc-ref outputs "doc")) (lib (assoc-ref outputs "lib")) (bin (assoc-ref outputs "bin")) (name-version (strip-store-file-name out)) - (input-dirs (match inputs - (((_ . dir) ...) - dir) - (_ '()))) + (extra-dirs (filter-map (cut assoc-ref inputs <>) extra-directories)) (ghc-path (getenv "GHC_PACKAGE_PATH")) (params `(,(string-append "--prefix=" out) ,(string-append "--libdir=" (or lib out) "/lib") @@ -94,9 +91,9 @@ and parameters ~s~%" ,(string-append "--package-db=" %tmp-db-dir) "--global" ,@(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=" <>) - (search-path-as-list '("lib") input-dirs)) + (search-path-as-list '("lib") extra-dirs)) ,@(if tests? '("--enable-tests") '()) |