[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/44: haskell-build-system: register: Remove references to the doc outp
From: |
guix-commits |
Subject: |
05/44: haskell-build-system: register: Remove references to the doc output. |
Date: |
Mon, 29 Jun 2020 07:15:18 -0400 (EDT) |
rekado pushed a commit to branch wip-haskell-updates
in repository guix.
commit bc82e17acaf366981e58ca30a1fb07f79d08549b
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Tue Jun 16 22:34:37 2020 +0200
haskell-build-system: register: Remove references to the doc output.
* guix/build/haskell-build-system.scm (register): Strip references to the
doc
output from the generated package config files; move the haddock files from
the "doc" output to the "lib" output.
---
guix/build/haskell-build-system.scm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/guix/build/haskell-build-system.scm
b/guix/build/haskell-build-system.scm
index ea20874..49d1c03 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -241,6 +241,7 @@ given Haskell package."
(loop seen tail))))))
(let* ((out (assoc-ref outputs "out"))
+ (doc (assoc-ref outputs "doc"))
(haskell (assoc-ref inputs "haskell"))
(name-verion (strip-store-file-name haskell))
(lib (string-append (or (assoc-ref outputs "lib") out) "/lib"))
@@ -255,8 +256,25 @@ given Haskell package."
;; The conf file is created only when there is a library to register.
(when (file-exists? config-file)
(mkdir-p config-dir)
- (let* ((config-file-name+id
- (call-with-ascii-input-file config-file (cut grep id-rx <>))))
+ (let ((config-file-name+id
+ (call-with-ascii-input-file config-file (cut grep id-rx <>))))
+
+ ;; Remove reference to "doc" output from "lib" (or "out") by rewriting
the
+ ;; "haddock-interfaces" field and removing the optional "haddock-html"
+ ;; field in the generated .conf file.
+ (when doc
+ (substitute* config-file
+ (("^haddock-html: .*") "\n")
+ (((format #f "^haddock-interfaces: ~a" doc))
+ (string-append "haddock-interfaces: " lib)))
+ ;; Move the referenced file to the "lib" (or "out") output.
+ (match (find-files doc "\\.haddock$")
+ ((haddock-file . rest)
+ (let* ((subdir (string-drop haddock-file (string-length doc)))
+ (new (string-append lib subdir)))
+ (mkdir-p (dirname new))
+ (rename-file haddock-file new)))
+ (_ #f)))
(install-transitive-deps config-file %tmp-db-dir config-dir)
(rename-file config-file
(string-append config-dir "/"
- branch wip-haskell-updates created (now 7750d2f), guix-commits, 2020/06/29
- 05/44: haskell-build-system: register: Remove references to the doc output.,
guix-commits <=
- 06/44: build-system/haskell: Simplify configure step., guix-commits, 2020/06/29
- 02/44: build-system/haskell: Support parallel builds., guix-commits, 2020/06/29
- 07/44: build-system/haskell: Configure to link with shared libraries., guix-commits, 2020/06/29
- 03/44: build-system/haskell: Add default output "static"., guix-commits, 2020/06/29
- 08/44: gnu: Add "static" output to Haskell packages with custom outputs., guix-commits, 2020/06/29
- 01/44: gnu: Add ghc-8.8., guix-commits, 2020/06/29
- 04/44: haskell-build-system: register: Respect lib output., guix-commits, 2020/06/29
- 09/44: gnu: ghc-libyaml: Add libyaml via --extra-lib-dirs., guix-commits, 2020/06/29
- 10/44: gnu: ghc-hslua: Add --extra-lib-dirs configure option., guix-commits, 2020/06/29
- 12/44: gnu: ghc-hspec: Add "doc" output., guix-commits, 2020/06/29