From: Eric Bavier <ericbavier@openmailbox.org>
To: guix-devel@gnu.org
Subject: [PATCHES] for Haskell packages
Date: Sat, 6 Jun 2015 07:36:47 -0500 [thread overview]
Message-ID: <20150606073647.6cc504fb@openmailbox.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
Hello Guix,
Attached are three patches to help our haskell-build-system and profile
creation work a bit better in the presence of Haskell libraries.
`~Eric
[-- Attachment #2: 0001-profiles-Search-for-ghc-conf-files-only-if-package-d.patch --]
[-- Type: application/octet-stream, Size: 1165 bytes --]
From 75a4305391cd246a6e8db5b11223f9ce243edd35 Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Sat, 6 Jun 2015 06:38:58 -0500
Subject: [PATCH 1/3] profiles: Search for ghc conf files only if package db
exists.
This avoids having 'find-files' report warnings about searching in
non-existent directories.
* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Only search
for *.conf files if the search directory exists.
---
guix/profiles.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 28150af..33a0511 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -500,7 +500,10 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages."
(string-append #$output "/" db-subdir))
(define (conf-files top)
- (find-files (string-append top "/" db-subdir) "\\.conf$"))
+ (let ((db (string-append top "/" db-subdir)))
+ (if (file-exists? db)
+ (find-files db "\\.conf$")
+ '())))
(define (copy-conf-file conf)
(let ((base (basename conf)))
--
2.2.1
[-- Attachment #3: 0002-profiles-Process-ghc-conf-files-only-once.patch --]
[-- Type: application/octet-stream, Size: 1218 bytes --]
From 08d67857d9726a2fddbc834c34caaae3e5a5d4f2 Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Sat, 6 Jun 2015 06:43:19 -0500
Subject: [PATCH 2/3] profiles: Process ghc conf files only once.
A package may be listed in the manifest inputs multiple times. Avoid
copying ghc *.conf files twice by deleting duplicates.
* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Delete
duplicate manifest inputs before copying conf files.
---
guix/profiles.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 33a0511..5c19c95 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -512,7 +512,8 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages."
(system* (string-append #+ghc "/bin/ghc-pkg") "init" db-dir)
(for-each copy-conf-file
(append-map conf-files
- '#$(manifest-inputs manifest)))
+ (delete-duplicates
+ '#$(manifest-inputs manifest))))
(let ((success
(zero?
(system* (string-append #+ghc "/bin/ghc-pkg") "recache"
--
2.2.1
[-- Attachment #4: 0003-build-system-haskell-install-config-for-any-package-.patch --]
[-- Type: application/octet-stream, Size: 1828 bytes --]
From 480d18c683d3d74fab46578c93fb4cbf81d1a8be Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Sat, 6 Jun 2015 07:28:57 -0500
Subject: [PATCH 3/3] build-system/haskell: install config for any package that
creates it.
A Cabal package is allowed to declare an "empty" library, in an
otherwise executable-only package, for the purpose of allowing Cabal
to use it as a dependency for other packages. See e.g. hspec-discover.
* guix/build/haskell-build-system.scm (register): Unconditionally call
setup script with "register", and install any config file generated.
---
guix/build/haskell-build-system.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index d382ee4..c0cb789 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -166,13 +166,13 @@ generate the cache as it would clash in user profiles."
(package-name-version haskell)
"/package.conf.d"))
(id-rx (make-regexp "^id: *(.*)$"))
- (lib-rx (make-regexp "lib.*\\.(a|so)"))
- (config-file (string-append config-dir "/" name ".conf"))
+ (config-file (string-append out "/" name ".conf"))
(params
(list (string-append "--gen-pkg-config=" config-file))))
- (unless (null? (find-files lib lib-rx))
+ (run-setuphs "register" params)
+ ;; The conf file is created only when there is a library to register.
+ (when (file-exists? config-file)
(mkdir-p config-dir)
- (run-setuphs "register" params)
(let ((config-file-name+id
(call-with-ascii-input-file config-file (cut grep id-rx <>))))
(rename-file config-file
--
2.2.1
next reply other threads:[~2015-06-06 18:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-06 12:36 Eric Bavier [this message]
2015-06-10 19:42 ` [PATCHES] for Haskell packages Ludovic Courtès
-- strict thread matches above, loose matches on Subject: below --
2015-06-11 7:39 Federico Beffa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150606073647.6cc504fb@openmailbox.org \
--to=ericbavier@openmailbox.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.