summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-10-21 18:06:02 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-10-21 18:06:02 +0200
commitffddb42d6c510456997ee6de1c1b8026c9ce6d14 (patch)
tree5be4a965bb14f3de4af9f733f802b80840aff84c /guix
parente381ae317c054a8ac52037c3f0df72ca3c96b91f (diff)
parent3a69b59332f02805fde2aee22b8f622c651f7007 (diff)
downloadgnu-guix-ffddb42d6c510456997ee6de1c1b8026c9ce6d14.tar
gnu-guix-ffddb42d6c510456997ee6de1c1b8026c9ce6d14.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r--guix/build-system/python.scm2
-rw-r--r--guix/gexp.scm8
-rw-r--r--guix/import/pypi.scm2
-rw-r--r--guix/scripts/pack.scm7
-rw-r--r--guix/tests.scm37
5 files changed, 51 insertions, 5 deletions
diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
index ffed837313..b753940bad 100644
--- a/guix/build-system/python.scm
+++ b/guix/build-system/python.scm
@@ -50,7 +50,7 @@
"Return a URI string for the Python package hosted on the Python Package
Index (PyPI) corresponding to NAME and VERSION. EXTENSION is the file name
extension, such as '.tar.gz'."
- (string-append "https://pypi.io/packages/source/"
+ (string-append "https://pypi.org/packages/source/"
(string-take name 1) "/" name "/"
name "-" version extension))
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 770b79e012..f7def5862b 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -438,6 +438,14 @@ This is the declarative counterpart of 'gexp->file'."
(base file-append-base) ;<package> | <derivation> | ...
(suffix file-append-suffix)) ;list of strings
+(define (write-file-append file port)
+ (match file
+ (($ <file-append> base suffix)
+ (format port "#<file-append ~s ~s>" base
+ (string-join suffix)))))
+
+(set-record-type-printer! <file-append> write-file-append)
+
(define (file-append base . suffix)
"Return a <file-append> object that expands to the concatenation of BASE and
SUFFIX."
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 87b047bdac..3a20fc4b9b 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -330,7 +330,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(define (pypi-url? url)
(or (string-prefix? "https://pypi.org/" url)
(string-prefix? "https://pypi.python.org/" url)
- (string-prefix? "https://pypi.io/packages" url)))
+ (string-prefix? "https://pypi.org/packages" url)))
(let ((source-url (and=> (package-source package) origin-uri))
(fetch-method (and=> (package-source package) origin-method)))
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index fb3c50521d..b7b4e22bbe 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -198,8 +198,11 @@ added to the pack."
(with-directory-excursion %root
(exit
(zero? (apply system* "tar"
- "-I"
- (string-join '#+(compressor-command compressor))
+ #+@(if (compressor-command compressor)
+ #~("-I"
+ (string-join
+ '#+(compressor-command compressor)))
+ #~())
"--format=gnu"
;; Avoid non-determinism in the archive. Use
diff --git a/guix/tests.scm b/guix/tests.scm
index 06e9f8da0b..bcf9b990e5 100644
--- a/guix/tests.scm
+++ b/guix/tests.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -17,6 +17,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix tests)
+ #:use-module ((guix config) #:select (%storedir %localstatedir))
#:use-module (guix store)
#:use-module (guix derivations)
#:use-module (guix packages)
@@ -30,6 +31,7 @@
#:use-module (ice-9 binary-ports)
#:use-module (web uri)
#:export (open-connection-for-tests
+ with-external-store
random-text
random-bytevector
file=?
@@ -74,6 +76,39 @@
store)))
+(define (call-with-external-store proc)
+ "Call PROC with an open connection to the external store or #f it there is
+no external store to talk to."
+ (parameterize ((%daemon-socket-uri
+ (string-append %localstatedir
+ "/guix/daemon-socket/socket"))
+ (%store-prefix %storedir))
+ (define store
+ (catch #t
+ (lambda ()
+ (open-connection))
+ (const #f)))
+
+ (dynamic-wind
+ (const #t)
+ (lambda ()
+ ;; Since we're using a different store we must clear the
+ ;; package-derivation cache.
+ (hash-clear! (@@ (guix packages) %derivation-cache))
+
+ (proc store))
+ (lambda ()
+ (when store
+ (close-connection store))))))
+
+(define-syntax-rule (with-external-store store exp ...)
+ "Evaluate EXP with STORE bound to the external store rather than the
+temporary test store, or #f if there is no external store to talk to.
+
+This is meant to be used for tests that need to build packages that would be
+too expensive to build entirely in the test store."
+ (call-with-external-store (lambda (store) exp ...)))
+
(define (random-seed)
(or (and=> (getenv "GUIX_TESTS_RANDOM_SEED")
number->string)