guix-devel
[Top][All Lists]
Advanced

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

[PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specif


From: Alex Kost
Subject: [PATCH 2/6] build-system/emacs: Use "emacs" from native-inputs if specified.
Date: Mon, 16 May 2016 21:20:20 +0300

* guix/build-system/emacs.scm (lower): Do not add "emacs" to
  build-inputs if it is already specified in the native-inputs.
---
 guix/build-system/emacs.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm
index 03c1eb2..017e6ef 100644
--- a/guix/build-system/emacs.scm
+++ b/guix/build-system/emacs.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <address@hidden>
+;;; Copyright © 2016 Alex Kost <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,6 +26,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 (%emacs-build-system-modules
             emacs-build
@@ -73,8 +75,16 @@
 
                         ;; Keep the standard inputs of 'gnu-build-system'.
                         ,@(standard-packages)))
-         (build-inputs `(("emacs" ,emacs)
-                         ,@native-inputs))
+         ;; Add emacs to build-inputs only if native-inputs do not contain
+         ;; emacs already.  This allows us to use non-default emacs for
+         ;; building.
+         (build-inputs (if (find (match-lambda
+                                   (("emacs" _ ...) #t)
+                                   (_ #f))
+                                 native-inputs)
+                           native-inputs
+                           `(("emacs" ,emacs)
+                             ,@native-inputs)))
          (outputs outputs)
          (build emacs-build)
          (arguments (strip-keyword-arguments private-keywords arguments)))))
-- 
2.7.3




reply via email to

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