guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/27: build-system/haskell: Update configure flags, 'haddock' and %stan


From: Federico Beffa
Subject: 03/27: build-system/haskell: Update configure flags, 'haddock' and %standard-phases.
Date: Wed, 08 Apr 2015 15:31:45 +0000

beffa pushed a commit to branch master
in repository guix.

commit 283cce508ae2d300132be21ed1e37ce9f59cd1cb
Author: Federico Beffa <address@hidden>
Date:   Sat Apr 4 11:16:37 2015 +0200

    build-system/haskell: Update configure flags, 'haddock' and 
%standard-phases.
    
    * guix/build/haskell-build-system.scm (%standard-phases): move 'haddock 
phase
      before 'install phase.
    * guix/build/haskell-build-system.scm (haddock): Simplify it as the 'install
      phase takes care of copying files.
    * guix/build/haskell-build-system.scm (configure): Add '--libsubdir' flag.
      Fix use of '--extra-include-dirs' and '--extra-lib-dirs' flags.  Use 
'doc',
      'bin' and 'lib' outputs if they are defined.
    * guix/build/haskell-build-system.scm (make-ghc-package-database, register):
      Aligh location of 'package.conf.d' directory with '--libsubdir' flag.
---
 guix/build/haskell-build-system.scm |   44 +++++++++++++++-------------------
 1 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/guix/build/haskell-build-system.scm 
b/guix/build/haskell-build-system.scm
index 52b9c79..e17967f 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -70,26 +70,28 @@ and parameters ~s~%"
                     #: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"))
          (input-dirs (match inputs
                        (((_ . dir) ...)
                         dir)
                        (_ '())))
          (params (append `(,(string-append "--prefix=" out))
+                         `(,(string-append "--libdir=" (or lib out) "/lib"))
+                         `(,(string-append "--bindir=" (or bin out) "/bin"))
                          `(,(string-append
-                             "--docdir=" out "/share/doc/"
-                             (package-name-version out)))
+                             "--docdir=" (or doc out)
+                             "/share/doc/" (package-name-version out)))
+                         '("--libsubdir=$compiler/$pkg-$version")
                          `(,(string-append "--package-db=" %tmp-db-dir))
                          '("--global")
-                         `(,(string-append
-                             "--extra-include-dirs="
-                             (list->search-path-as-string
-                              (search-path-as-list '("include") input-dirs)
-                              ":")))
-                         `(,(string-append
-                             "--extra-lib-dirs="
-                             (list->search-path-as-string
-                              (search-path-as-list '("lib") input-dirs)
-                              ":")))
+                         `(,@(map
+                              (cut string-append "--extra-include-dirs=" <>)
+                              (search-path-as-list '("include") input-dirs)))
+                         `(,@(map
+                              (cut string-append "--extra-lib-dirs=" <>)
+                              (search-path-as-list '("lib") input-dirs)))
                          (if tests?
                              '("--enable-tests")
                              '())
@@ -140,7 +142,7 @@ first match and return the content of the group."
                         dir)
                        (_ '())))
          (conf-dirs (search-path-as-list
-                     `(,(string-append "lib/" system "-"
+                     `(,(string-append "lib/"
                                        (package-name-version haskell)
                                        "/package.conf.d"))
                      input-dirs))
@@ -160,8 +162,8 @@ generate the cache as it would clash in user profiles."
   (let* ((out (assoc-ref outputs "out"))
          (haskell  (assoc-ref inputs "haskell"))
          (lib (string-append out "/lib"))
-         (config-dir (string-append lib "/" system
-                                    "-" (package-name-version haskell)
+         (config-dir (string-append lib "/"
+                                    (package-name-version haskell)
                                     "/package.conf.d"))
          (id-rx (make-regexp "^id: *(.*)$"))
          (lib-rx (make-regexp "lib.*\\.(a|so)"))
@@ -189,21 +191,13 @@ generate the cache as it would clash in user profiles."
 (define* (haddock #:key outputs haddock? haddock-flags #:allow-other-keys)
   "Run the test suite of a given Haskell package."
   (if haddock?
-      (let* ((out (assoc-ref outputs "out"))
-             (doc-src (string-append (getcwd) "/dist/doc"))
-             (doc-dest (string-append out "/share/doc/"
-                                      (package-name-version out))))
-        (if (run-setuphs "haddock" haddock-flags)
-            (begin
-              (copy-recursively doc-src doc-dest)
-              #t)
-            #f))
+      (run-setuphs "haddock" haddock-flags)
       #t))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
     (add-before configure setup-compiler setup-compiler)
-    (add-after install haddock haddock)
+    (add-before install haddock haddock)
     (add-after install register register)
     (replace install install)
     (replace check check)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]