From: David Craven <david@craven.ch>
To: guix-devel@gnu.org
Cc: David Craven <david@craven.ch>
Subject: [PATCH 3/7] gnu: Add replace-input procedure.
Date: Thu, 2 Feb 2017 00:35:27 +0100 [thread overview]
Message-ID: <20170201233531.2640-3-david@craven.ch> (raw)
In-Reply-To: <20170201233531.2640-1-david@craven.ch>
* gnu/packages.scm (replace-input): New procedure.
---
gnu/packages.scm | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 0aa289d56..2535e10b1 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -53,7 +53,9 @@
find-newest-available-packages
specification->package
- specification->package+output))
+ specification->package+output
+
+ replace-input))
;;; Commentary:
;;;
@@ -356,3 +358,26 @@ version; if SPEC does not specify an output, return OUTPUT."
(leave (_ "package `~a' lacks output `~a'~%")
(package-full-name package)
sub-drv))))))
+
+\f
+;;;
+;;; Package utilities.
+;;;
+
+(define (replace-input pkg name replacement)
+ "Returns a package with all inputs of NAME replaced with REPLACEMENT. Is
+usefull for resolving circular dependencies."
+ (define replace
+ (match-lambda
+ ((tag input)
+ (if (string=? tag name)
+ (list name replacement)
+ (list tag (replace-input input name replacement))))))
+ (package
+ (inherit pkg)
+ (inputs
+ (map replace (package-inputs pkg)))
+ (native-inputs
+ (map replace (package-native-inputs pkg)))
+ (propagated-inputs
+ (map replace (package-propagated-inputs pkg)))))
--
2.11.0
next prev parent reply other threads:[~2017-02-01 23:35 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 23:35 [PATCH 1/7] gnu: mutter: Update to HEAD David Craven
2017-02-01 23:35 ` [PATCH 2/7] gnu: Add git-crypt David Craven
2017-02-09 16:52 ` Ludovic Courtès
2017-02-01 23:35 ` David Craven [this message]
2017-02-09 16:54 ` [PATCH 3/7] gnu: Add replace-input procedure Ludovic Courtès
2017-02-10 11:31 ` David Craven
2017-02-01 23:35 ` [PATCH 4/7] gnu: Add appstream-glib David Craven
2017-02-09 16:55 ` Ludovic Courtès
2017-02-01 23:35 ` [PATCH 5/7] gnu: Add gnome-disk-utility David Craven
2017-02-05 5:53 ` Maxim Cournoyer
2017-02-09 16:57 ` Ludovic Courtès
2017-02-01 23:35 ` [PATCH 6/7] system: install: Add gptfdisk to installation os David Craven
2017-02-09 16:58 ` Ludovic Courtès
2017-02-01 23:35 ` [PATCH 7/7] gnu: Enable CONFIG_HOTPLUG_PCI David Craven
2017-02-02 0:39 ` David Craven
2017-02-02 15:53 ` David Craven
2017-02-02 17:07 ` David Craven
2017-02-02 19:20 ` Danny Milosavljevic
2017-02-02 20:18 ` David Craven
2017-02-02 20:41 ` Danny Milosavljevic
2017-02-02 21:50 ` David Craven
2017-02-03 2:54 ` David Craven
2017-02-03 17:45 ` Danny Milosavljevic
2017-02-09 17:02 ` Ludovic Courtès
2017-02-10 11:58 ` David Craven
2017-02-02 0:38 ` [PATCH 1/7] gnu: mutter: Update to HEAD David Craven
2017-02-09 17:00 ` Ludovic Courtès
2017-02-10 14:56 ` David Craven
2017-02-09 16:52 ` Ludovic Courtès
2017-02-09 16:57 ` David Craven
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=20170201233531.2640-3-david@craven.ch \
--to=david@craven.ch \
--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.