summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/derivations.scm13
-rw-r--r--guix/licenses.scm42
-rw-r--r--guix/utils.scm10
3 files changed, 59 insertions, 6 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index b1f54232bc..6fbce14da0 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -364,6 +364,15 @@ the derivation called NAME with hash HASH."
store path and <derivation> object. When HASH, HASH-ALGO, and HASH-MODE
are given, a fixed-output derivation is created---i.e., one whose result is
known in advance, such as a file download."
+ (define direct-store-path?
+ (let ((len (+ 1 (string-length (%store-prefix)))))
+ (lambda (p)
+ ;; Return #t if P is a store path, and not a sub-directory of a
+ ;; store path. This predicate is needed because files *under* a
+ ;; store path are not valid inputs.
+ (and (store-path? p)
+ (not (string-index (substring p len) #\/))))))
+
(define (add-output-paths drv)
;; Return DRV with an actual store path for each of its output and the
;; corresponding environment variable.
@@ -411,9 +420,9 @@ known in advance, such as a file download."
(make-derivation-output "" hash-algo hash)))
outputs))
(inputs (map (match-lambda
- (((? store-path? input))
+ (((? direct-store-path? input))
(make-derivation-input input '("out")))
- (((? store-path? input) sub-drvs ...)
+ (((? direct-store-path? input) sub-drvs ...)
(make-derivation-input input sub-drvs))
((input . _)
(let ((path (add-to-store store
diff --git a/guix/licenses.scm b/guix/licenses.scm
index 9c1b7249e1..cc2369bb8e 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -22,14 +22,15 @@
#:export (license? license-name license-uri license-comment
asl2.0
boost1.0
- bsd-2 bsd-3 bsd-4
+ bsd-2 bsd-3 bsd-4 bsd-style
cddl1.0
cpl1.0
epl1.0
- gpl2 gpl2+ gpl3 gpl3+
+ expat
+ gpl1 gpl1+ gpl2 gpl2+ gpl3 gpl3+
ijg
ibmpl1.0
- lgpl2.1 lgpl2.1+ lgpl3 lgpl3+
+ lgpl2.0 lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3 lgpl3+
mpl2.0
openssl
public-domain
@@ -78,6 +79,16 @@
"http://directory.fsf.org/wiki/License:BSD_4Clause"
"https://www.gnu.org/licenses/license-list#OriginalBSD"))
+(define* (bsd-style uri #:optional (comment ""))
+ "Return a BSD-style license, whose full text can be found at URI,
+which may be a file:// URI pointing the package's tree."
+ (license "BSD-style"
+ uri
+ (string-append
+ "This is a BSD-style, non-copyleft free software license. "
+ "Check the URI for details. "
+ comment)))
+
(define cddl1.0
(license "CDDL 1.0"
"http://directory.fsf.org/wiki/License:CDDLv1.0"
@@ -93,6 +104,21 @@
"http://directory.fsf.org/wiki/License:EPLv1.0"
"https://www.gnu.org/licenses/license-list#EPL"))
+(define expat
+ (license "Expat"
+ "http://directory.fsf.org/wiki/License:Expat"
+ "https://www.gnu.org/licenses/license-list.html#Expat"))
+
+(define gpl1
+ (license "GPL 1"
+ "https://www.gnu.org/licenses/old-licenses/gpl-1.0.html"
+ #f))
+
+(define gpl1+
+ (license "GPL 1+"
+ "https://www.gnu.org/licenses/old-licenses/gpl-1.0.html"
+ #f))
+
(define gpl2
(license "GPL 2"
"https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
@@ -123,6 +149,16 @@
"http://directory.fsf.org/wiki/License:IBMPLv1.0"
"https://www.gnu.org/licenses/license-list#IBMPL"))
+(define lgpl2.0
+ (license "LGPL 2.0"
+ "https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html"
+ "https://www.gnu.org/licenses/why-not-lgpl.html"))
+
+(define lgpl2.0+
+ (license "LGPL 2.0+"
+ "https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html"
+ "https://www.gnu.org/licenses/why-not-lgpl.html"))
+
(define lgpl2.1
(license "LGPL 2.1"
"https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html"
diff --git a/guix/utils.scm b/guix/utils.scm
index 4089b11cb1..ad50c20cce 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -156,7 +156,15 @@ evaluate to a simple datum."
(define %nixpkgs-directory
(make-parameter
;; Capture the build-time value of $NIXPKGS.
- (or %nixpkgs (getenv "NIXPKGS"))))
+ (or %nixpkgs
+ (and=> (getenv "NIXPKGS")
+ (lambda (val)
+ ;; Bail out when passed an empty string, otherwise
+ ;; `nix-instantiate' will sit there and attempt to read
+ ;; from its standard input.
+ (if (string=? val "")
+ #f
+ val))))))
(define* (nixpkgs-derivation attribute #:optional (system (%current-system)))
"Return the derivation path of ATTRIBUTE in Nixpkgs."