summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-06-19 17:02:16 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-06-19 17:02:16 +0200
commit0106d6b40dc0b8f1c81326e633bfa5134a446a9c (patch)
tree978cc8408f2d52a024f692a31e98cb555da95462 /guix
parent7e66e0b3e7f69e045362f9452f9b745aa850d354 (diff)
parent793a66e5fef3f562080000280c022af517aad612 (diff)
Merge branch 'master' into staging
Diffstat (limited to 'guix')
-rw-r--r--guix/build/compile.scm14
-rw-r--r--guix/build/waf-build-system.scm5
-rw-r--r--guix/config.scm.in4
-rw-r--r--guix/import/snix.scm4
-rw-r--r--guix/self.scm58
5 files changed, 56 insertions, 29 deletions
diff --git a/guix/build/compile.scm b/guix/build/compile.scm
index 7b6e31107c..5a1363556a 100644
--- a/guix/build/compile.scm
+++ b/guix/build/compile.scm
@@ -196,6 +196,20 @@ files are for HOST, a GNU triplet such as \"x86_64-linux-gnu\"."
(unless (zero? total)
(report-compilation #f total total)))))
+(eval-when (eval load)
+ (when (and (string=? "2" (major-version))
+ (or (string=? "0" (minor-version))
+ (and (string=? (minor-version) "2")
+ (< (string->number (micro-version)) 4))))
+ ;; Work around <https://bugs.gnu.org/31878> on Guile < 2.2.4.
+ ;; Serialize 'try-module-autoload' calls.
+ (set! (@ (guile) try-module-autoload)
+ (let ((mutex (make-mutex 'recursive))
+ (real (@ (guile) try-module-autoload)))
+ (lambda* (module #:optional version)
+ (with-mutex mutex
+ (real module version)))))))
+
;;; Local Variables:
;;; eval: (put 'with-augmented-search-path 'scheme-indent-function 2)
;;; eval: (put 'with-target 'scheme-indent-function 1)
diff --git a/guix/build/waf-build-system.scm b/guix/build/waf-build-system.scm
index f0364e867d..56048e7685 100644
--- a/guix/build/waf-build-system.scm
+++ b/guix/build/waf-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -38,7 +38,8 @@
(begin
(format #t "running \"python waf\" with command ~s and parameters ~s~%"
command params)
- (zero? (apply system* "python" "waf" command params)))
+ (apply invoke "python" "waf" command params)
+ #t)
(error "no waf found")))
(define* (configure #:key target native-inputs inputs outputs
diff --git a/guix/config.scm.in b/guix/config.scm.in
index 4490112e07..1a761b912e 100644
--- a/guix/config.scm.in
+++ b/guix/config.scm.in
@@ -35,7 +35,6 @@
%system
%libgcrypt
%libz
- %nix-instantiate
%gzip
%bzip2
%xz))
@@ -95,9 +94,6 @@
(define %libz
"@LIBZ@")
-(define %nix-instantiate
- "@NIX_INSTANTIATE@")
-
(define %gzip
"@GZIP@")
diff --git a/guix/import/snix.scm b/guix/import/snix.scm
index 778768ff2d..56934e8cf9 100644
--- a/guix/import/snix.scm
+++ b/guix/import/snix.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -283,7 +283,7 @@ ATTRIBUTE is true, only that attribute is considered."
platform = (import ~a/pkgs/top-level/platforms.nix).sheevaplug;
}" nixpkgs)))
(apply open-pipe* OPEN_READ
- %nix-instantiate "--strict" "--eval-only" "--xml"
+ "nix-instantiate" "--strict" "--eval-only" "--xml"
;; Pass a dummy `crossSystem' argument so that `buildInputs' and
;; `nativeBuildInputs' are not coalesced.
diff --git a/guix/self.scm b/guix/self.scm
index 5a10f72012..0ad8c34e2a 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -26,9 +26,8 @@
#:use-module (guix discovery)
#:use-module (guix packages)
#:use-module (guix sets)
- #:use-module (guix utils)
#:use-module (guix modules)
- #:use-module (guix build utils)
+ #:use-module ((guix build utils) #:select (find-files))
#:use-module ((guix build compile) #:select (%lightweight-optimizations))
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
@@ -656,7 +655,7 @@ assumed to be part of MODULES."
(define %dependency-variables
;; (guix config) variables corresponding to dependencies.
- '(%libgcrypt %libz %xz %gzip %bzip2 %nix-instantiate))
+ '(%libgcrypt %libz %xz %gzip %bzip2))
(define %persona-variables
;; (guix config) variables that define Guix's persona.
@@ -666,17 +665,14 @@ assumed to be part of MODULES."
%guix-home-page-url))
(define %config-variables
- ;; (guix config) variables corresponding to Guix configuration (storedir,
- ;; localstatedir, etc.)
- (sort (filter pair?
- (module-map (lambda (name var)
- (and (not (memq name %dependency-variables))
- (not (memq name %persona-variables))
- (cons name (variable-ref var))))
- (resolve-interface '(guix config))))
- (lambda (name+value1 name+value2)
- (string<? (symbol->string (car name+value1))
- (symbol->string (car name+value2))))))
+ ;; (guix config) variables corresponding to Guix configuration.
+ (letrec-syntax ((variables (syntax-rules ()
+ ((_)
+ '())
+ ((_ variable rest ...)
+ (cons `(variable . ,variable)
+ (variables rest ...))))))
+ (variables %localstatedir %storedir %sysconfdir %system)))
(define* (make-config.scm #:key libgcrypt zlib gzip xz bzip2
(package-name "GNU Guix")
@@ -694,18 +690,41 @@ assumed to be part of MODULES."
%guix-version
%guix-bug-report-address
%guix-home-page-url
+ %store-directory
+ %state-directory
+ %store-database-directory
+ %config-directory
%libgcrypt
%libz
%gzip
%bzip2
- %xz
- %nix-instantiate))
+ %xz))
#$@(map (match-lambda
((name . value)
#~(define-public #$name #$value)))
%config-variables)
+ (define %store-directory
+ (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)
+ %storedir))
+
+ (define %state-directory
+ ;; This must match `NIX_STATE_DIR' as defined in
+ ;; `nix/local.mk'.
+ (or (getenv "NIX_STATE_DIR")
+ (string-append %localstatedir "/guix")))
+
+ (define %store-database-directory
+ (or (getenv "NIX_DB_DIR")
+ (string-append %state-directory "/db")))
+
+ (define %config-directory
+ ;; This must match `GUIX_CONFIGURATION_DIRECTORY' as
+ ;; defined in `nix/local.mk'.
+ (or (getenv "GUIX_CONFIGURATION_DIRECTORY")
+ (string-append %sysconfdir "/guix")))
+
(define %guix-package-name #$package-name)
(define %guix-version #$package-version)
(define %guix-bug-report-address #$bug-report-address)
@@ -723,13 +742,10 @@ assumed to be part of MODULES."
(file-append libgcrypt "/lib/libgcrypt")))
(define %libz
#+(and zlib
- (file-append zlib "/lib/libz")))
-
- (define %nix-instantiate ;for (guix import snix)
- "nix-instantiate"))
+ (file-append zlib "/lib/libz"))))
;; Guile 2.0 *requires* the 'define-module' to be at the
- ;; top-level or it 'toplevel-ref' in the resulting .go file are
+ ;; top-level or the 'toplevel-ref' in the resulting .go file are
;; made relative to a nonexistent anonymous module.
#:splice? #t))