summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/build-system/cmake.scm15
-rw-r--r--guix/build-system/copy.scm13
-rw-r--r--guix/build-system/dune.scm7
-rw-r--r--guix/build-system/font.scm30
-rw-r--r--guix/build-system/glib-or-gtk.scm20
-rw-r--r--guix/build-system/gnu.scm2
-rw-r--r--guix/build-system/maven.scm11
-rw-r--r--guix/build-system/meson.scm20
-rw-r--r--guix/build-system/mozilla.scm52
-rw-r--r--guix/build-system/ocaml.scm5
-rw-r--r--guix/build-system/qt.scm11
-rw-r--r--guix/build/font-build-system.scm8
-rw-r--r--guix/build/gnu-bootstrap.scm32
-rw-r--r--guix/build/gnu-build-system.scm10
-rw-r--r--guix/build/graft.scm5
-rw-r--r--guix/build/minetest-build-system.scm9
-rw-r--r--guix/build/python-build-system.scm6
-rw-r--r--guix/build/qt-utils.scm10
-rw-r--r--guix/build/union.scm25
-rw-r--r--guix/build/utils.scm58
-rw-r--r--guix/gexp.scm2
-rw-r--r--guix/lint.scm1
-rw-r--r--guix/profiles.scm3
-rw-r--r--guix/scripts/home.scm3
-rw-r--r--guix/scripts/package.scm3
-rw-r--r--guix/scripts/system/reconfigure.scm4
-rw-r--r--guix/utils.scm8
27 files changed, 233 insertions, 140 deletions
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index 0aabc95b90..effb54f044 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -110,9 +110,8 @@
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '%standard-phases)
(system (%current-system))
(substitutable? #t)
@@ -150,8 +149,8 @@ provides a 'CMakeLists.txt' file as its build system."
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$(sexp->gexp strip-flags)
- #:strip-directories #$(sexp->gexp strip-directories))))))
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
@@ -185,10 +184,8 @@ provides a 'CMakeLists.txt' file as its build system."
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"
- "--enable-deterministic-archives"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '%standard-phases)
(substitutable? #t)
(system (%current-system))
diff --git a/guix/build-system/copy.scm b/guix/build-system/copy.scm
index c98b266561..e15dc9f616 100644
--- a/guix/build-system/copy.scm
+++ b/guix/build-system/copy.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
-;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2023 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;;
;;; This file is part of GNU Guix.
@@ -85,12 +85,12 @@
(install-plan ''(("." "./")))
(search-paths '())
(out-of-source? #t)
+ (tests? #t)
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '(@ (guix build copy-build-system)
%standard-phases))
(system (%current-system))
@@ -120,11 +120,12 @@
(sexp->gexp phases)
phases)
#:out-of-source? #$out-of-source?
+ #:tests? #$tests?
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$(sexp->gexp strip-flags)
- #:strip-directories #$(sexp->gexp strip-directories))))))
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm
index 12100fd8e8..05784feb32 100644
--- a/guix/build-system/dune.scm
+++ b/guix/build-system/dune.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
-;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021 pukkamustard <pukkamustard@posteo.net>
;;;
;;; This file is part of GNU Guix.
@@ -112,9 +112,8 @@
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags gnu:%strip-flags)
+ (strip-directories gnu:%strip-directories)
(phases '(@ (guix build dune-build-system)
%standard-phases))
(system (%current-system))
diff --git a/guix/build-system/font.scm b/guix/build-system/font.scm
index 74dc80b5db..c43fb9a542 100644
--- a/guix/build-system/font.scm
+++ b/guix/build-system/font.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2017, 2022 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -54,20 +54,20 @@
(bag
(name name)
(system system)
- (host-inputs `(,@(if source
- `(("source" ,source))
- '())
- ,@inputs
- ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
- ,@(let ((compression (resolve-interface '(gnu packages compression))))
- (map (match-lambda
- ((name package)
- (list name (module-ref compression package))))
- `(("gzip" gzip)
- ("bzip2" bzip2)
- ("unzip" unzip)
- ("xz" xz))))))
- (build-inputs native-inputs)
+ (host-inputs inputs)
+ (build-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@native-inputs
+ ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
+ ,@(let ((compression (resolve-interface '(gnu packages compression))))
+ (map (match-lambda
+ ((name package)
+ (list name (module-ref compression package))))
+ `(("gzip" gzip)
+ ("bzip2" bzip2)
+ ("unzip" unzip)
+ ("xz" xz))))))
(outputs outputs)
(build font-build)
(arguments (strip-keyword-arguments private-keywords arguments))))
diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm
index aa9703829b..f4f431273b 100644
--- a/guix/build-system/glib-or-gtk.scm
+++ b/guix/build-system/glib-or-gtk.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013-2015, 2019-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
@@ -139,9 +139,8 @@
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '(@ (guix build glib-or-gtk-build-system)
%standard-phases))
(glib-or-gtk-wrap-excluded-outputs ''())
@@ -179,9 +178,9 @@
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$(sexp->gexp strip-flags)
+ #:strip-flags #$strip-flags
#:strip-directories
- #$(sexp->gexp strip-directories))))))
+ #$strip-directories)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
@@ -214,9 +213,8 @@
(make-dynamic-linker-cache? #f)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '(@ (guix build glib-or-gtk-build-system)
%standard-phases))
(glib-or-gtk-wrap-excluded-outputs ''())
@@ -273,9 +271,9 @@
#:make-dynamic-linker-cache? #$make-dynamic-linker-cache?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$(sexp->gexp strip-flags)
+ #:strip-flags #$strip-flags
#:strip-directories
- #$(sexp->gexp strip-directories))))
+ #$strip-directories)))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index e62ee18367..e37785010b 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -29,6 +29,8 @@
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:export (%gnu-build-system-modules
+ %strip-flags
+ %strip-directories
gnu-build
gnu-build-system
standard-packages
diff --git a/guix/build-system/maven.scm b/guix/build-system/maven.scm
index 0af5922692..9a17dea977 100644
--- a/guix/build-system/maven.scm
+++ b/guix/build-system/maven.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
-;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021, 2022 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -154,9 +154,8 @@
(exclude %default-exclude)
(local-packages '())
(tests? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '%standard-phases)
(system (%current-system))
(imported-modules %maven-build-system-modules)
@@ -184,8 +183,8 @@ provides its own binaries."
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$(sexp->gexp strip-flags)
- #:strip-directories #$(sexp->gexp strip-directories)))))
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index b0bf8cb6e6..0948ad92b5 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
;;;
@@ -181,9 +181,8 @@ TRIPLET."
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(elf-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
(phases '%standard-phases)
@@ -229,8 +228,8 @@ has a 'meson.build' file."
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$(sexp->gexp strip-flags)
- #:strip-directories #$(sexp->gexp strip-directories)
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories
#:elf-directories #$(sexp->gexp elf-directories))))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
@@ -263,9 +262,8 @@ has a 'meson.build' file."
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(elf-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
;; See 'gnu-cross-build' for why this needs to be
@@ -342,8 +340,8 @@ SOURCE has a 'meson.build' file."
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$(sexp->gexp strip-flags)
- #:strip-directories #$(sexp->gexp strip-directories)
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories
#:elf-directories #$(sexp->gexp elf-directories)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/mozilla.scm b/guix/build-system/mozilla.scm
new file mode 100644
index 0000000000..bead1bf5bb
--- /dev/null
+++ b/guix/build-system/mozilla.scm
@@ -0,0 +1,52 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build-system mozilla)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system)
+ #:use-module (guix utils)
+ #:export (mozilla-build-system))
+
+;;
+;; Build procedure for packages using Autotools with the Mozillian conventions
+;; for --target, --host and --build, which are different from the GNU
+;; conventions.
+;;
+;; Code:
+
+(define* (lower-mozilla name #:key system target #:allow-other-keys
+ #:rest arguments)
+ (define lower (build-system-lower gnu-build-system))
+ (if target
+ (apply lower name
+ (substitute-keyword-arguments arguments
+ ;; Override --target and --host to what Mozillian configure
+ ;; scripts expect.
+ ((#:configure-flags configure-flags ''())
+ `(cons* ,(string-append "--target=" target)
+ ,(string-append "--host=" (nix-system->gnu-triplet system))
+ ,configure-flags))))
+ (apply lower name arguments))) ; not cross-compiling
+
+(define mozilla-build-system
+ (build-system
+ (name 'mozilla)
+ (description "The build system for Mozilla software using the Autotools")
+ (lower lower-mozilla)))
+
+;;; mozilla.scm ends here
diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm
index b08985cd4d..5f4308a46e 100644
--- a/guix/build-system/ocaml.scm
+++ b/guix/build-system/ocaml.scm
@@ -270,9 +270,8 @@ pre-defined variants."
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '(@ (guix build ocaml-build-system)
%standard-phases))
(system (%current-system))
diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm
index 7e3a54f1f8..25fd18f8a8 100644
--- a/guix/build-system/qt.scm
+++ b/guix/build-system/qt.scm
@@ -135,9 +135,8 @@
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '%standard-phases)
(qt-wrap-excluded-outputs ''())
(qt-wrap-excluded-inputs %qt-wrap-excluded-inputs)
@@ -209,10 +208,8 @@ provides a 'CMakeLists.txt' file as its build system."
(validate-runpath? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-debug"
- "--enable-deterministic-archives"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(phases '%standard-phases)
(system (%current-system))
(build (nix-system->gnu-triplet system))
diff --git a/guix/build/font-build-system.scm b/guix/build/font-build-system.scm
index 6726595fe1..e4784bc17d 100644
--- a/guix/build/font-build-system.scm
+++ b/guix/build/font-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2017, 2022 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
;;;
;;; This file is part of GNU Guix.
@@ -41,8 +41,7 @@ archive, or a font file."
(begin
(mkdir "source")
(chdir "source")
- (copy-file source (strip-store-file-name source))
- #t)
+ (copy-file source (strip-store-file-name source)))
(gnu:unpack #:source source)))
(define* (install #:key outputs #:allow-other-keys)
@@ -54,7 +53,8 @@ archive, or a font file."
(find-files source "\\.(ttf|ttc)$"))
(for-each (cut install-file <> (string-append fonts "/opentype"))
(find-files source "\\.(otf|otc)$"))
- #t))
+ (for-each (cut install-file <> (string-append fonts "/web"))
+ (find-files source "\\.(woff|woff2)$"))))
(define %standard-phases
(modify-phases gnu:%standard-phases
diff --git a/guix/build/gnu-bootstrap.scm b/guix/build/gnu-bootstrap.scm
index 1cb9dc5512..b4257a3717 100644
--- a/guix/build/gnu-bootstrap.scm
+++ b/guix/build/gnu-bootstrap.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2020 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2020, 2022 Timothy Sample <samplet@ngyro.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,17 +25,18 @@
(define-module (guix build gnu-bootstrap)
#:use-module (guix build utils)
+ #:use-module (srfi srfi-1)
#:use-module (system base compile)
#:export (bootstrap-configure
bootstrap-build
bootstrap-install))
-(define (bootstrap-configure version modules scripts)
+(define (bootstrap-configure name version modules scripts)
"Create a procedure that configures an early bootstrap package. The
-procedure will search the MODULES directory and configure all of the
-'.in' files with VERSION. It will then search the SCRIPTS directory and
-configure all of the '.in' files with the bootstrap Guile and its module
-and object directories."
+procedure will search each directory in MODULES and configure all of the
+'.in' files with NAME and VERSION. It will then search the SCRIPTS
+directory and configure all of the '.in' files with the bootstrap
+Guile and its module and object directories."
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(guile-dir (assoc-ref inputs "guile"))
@@ -50,10 +51,10 @@ and object directories."
(let ((target (string-drop-right template 3)))
(copy-file template target)
(substitute* target
+ (("@PACKAGE_NAME@") name)
(("@VERSION@") version))))
- (find-files modules
- (lambda (fn st)
- (string-suffix? ".in" fn))))
+ (append-map (lambda (dir) (find-files dir "\\.in$"))
+ modules))
(for-each (lambda (template)
(format #t "Configuring ~a~%" template)
(let ((target (string-drop-right template 3)))
@@ -70,7 +71,7 @@ and object directories."
(define (bootstrap-build modules)
"Create a procedure that builds an early bootstrap package. The
-procedure will search the MODULES directory and compile all of the
+procedure will search each directory in MODULES and compile all of the
'.scm' files."
(lambda _
(add-to-load-path (getcwd))
@@ -80,13 +81,15 @@ procedure will search the MODULES directory and compile all of the
(dir (dirname scm)))
(format #t "Compiling ~a~%" scm)
(compile-file scm #:output-file go)))
- (find-files modules "\\.scm$"))
+ (append-map (lambda (dir) (find-files dir "\\.scm$"))
+ modules))
#t))
(define (bootstrap-install modules scripts)
"Create a procedure that installs an early bootstrap package. The
-procedure will install all of the '.scm' and '.go' files in the MODULES
-directory, and all the executable files in the SCRIPTS directory."
+procedure will install all of the '.scm' and '.go' files in each of the
+directories in MODULES, and all the executable files in the SCRIPTS
+directory."
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(guile-dir (assoc-ref inputs "guile"))
@@ -104,7 +107,8 @@ directory, and all the executable files in the SCRIPTS directory."
(install-file scm (string-append moddir "/" dir))
(format #t "Installing ~a~%" go)
(install-file go (string-append godir "/" dir))))
- (find-files modules "\\.scm$"))
+ (append-map (lambda (dir) (find-files dir "\\.scm$"))
+ modules))
(for-each (lambda (script)
(format #t "Installing ~a~%" script)
(install-file script (string-append out "/bin")))
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index d84411c090..ef5873d793 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -83,10 +83,12 @@ there are none."
dir)))
(define native-input-directories
- (match native-inputs
+ ;; When cross-compiling, the source appears in native-inputs rather than
+ ;; inputs.
+ (match (and=> native-inputs (cut alist-delete "source" <>))
(((_ . dir) ...)
dir)
- (#f ; not cross compiling
+ (#f ;not cross-compiling
'())))
;; Tell 'ld-wrapper' to disallow non-store libraries.
@@ -727,9 +729,9 @@ which cannot be found~%"
;; UTF-8-encoded.
(with-fluids ((%default-port-encoding "UTF-8"))
(substitute* files
- (("^Exec=([^/[:blank:]\r\n]*)(.*)$" _ binary rest)
+ (("^Exec=([^/[:blank:]\r\n]+)(.*)$" _ binary rest)
(string-append "Exec=" (which binary) rest))
- (("^TryExec=([^/[:blank:]\r\n]*)(.*)$" _ binary rest)
+ (("^TryExec=([^/[:blank:]\r\n]+)(.*)$" _ binary rest)
(string-append "TryExec="
(which binary) rest)))))))))
outputs))
diff --git a/guix/build/graft.scm b/guix/build/graft.scm
index f04c35fa74..281dbaba6f 100644
--- a/guix/build/graft.scm
+++ b/guix/build/graft.scm
@@ -44,10 +44,7 @@
;;;
;;; Code:
-(define-syntax-rule (define-inline name val)
- (define-syntax name (identifier-syntax val)))
-
-(define-inline hash-length 32)
+(define-constant hash-length %store-hash-string-length)
(define nix-base32-char?
(cute char-set-contains?
diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 5f68686067..4a7a87ab83 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -91,15 +91,6 @@ If it is unknown, make an educated guess."
#:install-plan (mod-install-plan (apply guess-mod-name arguments))
arguments))
-(define %png-magic-bytes
- ;; Magic bytes of PNG images, see ‘5.2 PNG signatures’ in
- ;; ‘Portable Network Graphics (PNG) Specification (Second Edition)’
- ;; on <https://www.w3.org/TR/PNG/>.
- #vu8(137 80 78 71 13 10 26 10))
-
-(define png-file?
- ((@@ (guix build utils) file-header-match) %png-magic-bytes))
-
(define* (minimise-png #:key inputs native-inputs #:allow-other-keys)
"Minimise PNG images found in the working directory."
(define optipng (which "optipng"))
diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index 08871f60cd..aa04664b25 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -68,7 +68,7 @@
;; downloading the package source from PyPI (the Python Package Index). Both
;; of them import setuptools and execute the "setup.py" file under their
;; control. Thus the "setup.py" behaves as if the developer had imported
-;; setuptools within setup.py - even is still using only distutils.
+;; setuptools within setup.py - even if it is still using only distutils.
;;
;; Setuptools' "install" command (to be more precise: the "easy_install"
;; command which is called by "install") will put the path of the currently
@@ -176,8 +176,8 @@ without errors."
(define (site-packages inputs outputs)
"Return the path of the current output's Python site-package."
- (let* ((out (python-output outputs))
- (python (assoc-ref inputs "python")))
+ (let ((out (python-output outputs))
+ (python (assoc-ref inputs "python")))
(string-append out "/lib/python" (python-version python) "/site-packages")))
(define (add-installed-pythonpath inputs outputs)
diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm
index 2e47f1bc02..b8ecfedd43 100644
--- a/guix/build/qt-utils.scm
+++ b/guix/build/qt-utils.scm
@@ -98,7 +98,7 @@
`("QTWEBENGINEPROCESS_PATH" = regular
,(format #f "/lib/qt~a/libexec/QtWebEngineProcess" qt-major-version)))))
-(define* (wrap-qt-program* program #:key inputs output-dir
+(define* (wrap-qt-program* program #:key sh inputs output-dir
qt-wrap-excluded-inputs
(qt-major-version %default-qt-major-version))
@@ -115,9 +115,9 @@
output-dir
#:qt-major-version qt-major-version)))
(when (not (null? vars-to-wrap))
- (apply wrap-program program vars-to-wrap))))
+ (apply wrap-program program #:sh sh vars-to-wrap))))
-(define* (wrap-qt-program program-name #:key inputs output
+(define* (wrap-qt-program program-name #:key (sh (which "bash")) inputs output
(qt-wrap-excluded-inputs %qt-wrap-excluded-inputs)
(qt-major-version %default-qt-major-version))
"Wrap the specified program (which must reside in the OUTPUT's \"/bin\"
@@ -126,11 +126,12 @@ directory) with suitably set environment variables.
This is like qt-build-systems's phase \"qt-wrap\", but only the named program
is wrapped."
(wrap-qt-program* (string-append output "/bin/" program-name)
+ #:sh sh
#:output-dir output #:inputs inputs
#:qt-wrap-excluded-inputs qt-wrap-excluded-inputs
#:qt-major-version qt-major-version))
-(define* (wrap-all-qt-programs #:key inputs outputs
+(define* (wrap-all-qt-programs #:key (sh (which "bash")) inputs outputs
qtbase
(qt-wrap-excluded-outputs '())
(qt-wrap-excluded-inputs %qt-wrap-excluded-inputs)
@@ -169,6 +170,7 @@ add a dependency of that output on Qt."
((output . output-dir)
(unless (member output qt-wrap-excluded-outputs)
(for-each (cut wrap-qt-program* <>
+ #:sh sh
#:output-dir output-dir #:inputs inputs
#:qt-wrap-excluded-inputs qt-wrap-excluded-inputs
#:qt-major-version qt-major-version)
diff --git a/guix/build/union.scm b/guix/build/union.scm
index bf75c67c52..ce6d030109 100644
--- a/guix/build/union.scm
+++ b/guix/build/union.scm
@@ -27,7 +27,7 @@
#:use-module (rnrs io ports)
#:export (union-build
- warn-about-collision
+ resolve-collision/default
relative-file-name
symlink-relative))
@@ -103,22 +103,31 @@ identical, #f otherwise."
;; for most packages.
'("icon-theme.cache" "gschemas.compiled" "ld.so.cache"))
-(define (warn-about-collision files)
- "Handle the collision among FILES by emitting a warning and choosing the
-first one of THEM."
- (let ((file (first files)))
- (unless (member (basename file) %harmless-collisions)
+(define (resolve+warn-if-harmful resolve files)
+ "Same as (resolve files), but print a warning if the resolved file is not
+considered harmless. Also warn if the resolver doesn't pick any file."
+ (let ((file (resolve files)))
+ (cond
+ ((not file)
(format (current-error-port)
"~%warning: collision encountered:~%~{ ~a~%~}"
files)
- (format (current-error-port) "warning: choosing ~a~%" file))
+ (format (current-error-port) "warning: not choosing any file~%"))
+ (((negate member) (basename file) %harmless-collisions)
+ (format (current-error-port)
+ "~%warning: collision encountered:~%~{ ~a~%~}"
+ files)
+ (format (current-error-port) "warning: choosing ~a~%" file)))
file))
+(define (resolve-collision/default files)
+ (resolve+warn-if-harmful first files))
+
(define* (union-build output inputs
#:key (log-port (current-error-port))
(create-all-directories? #f)
(symlink symlink)
- (resolve-collision warn-about-collision))
+ (resolve-collision resolve-collision/default))
"Build in the OUTPUT directory a symlink tree that is the union of all the
INPUTS, using SYMLINK to create symlinks. As a special case, if
CREATE-ALL-DIRECTORIES?, creates the subdirectories in the output directory to
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index dd5a91f52f..2352a627e9 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -3,11 +3,11 @@
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2015, 2018, 2021 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2018, 2022 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;;
;;; This file is part of GNU Guix.
@@ -48,6 +48,7 @@
;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26805#16>.
delete)
#:export (%store-directory
+ %store-hash-string-length
store-file-name?
strip-store-file-name
package-name->name+version
@@ -60,8 +61,11 @@
directory-exists?
executable-file?
symbolic-link?
+ switch-symlinks
call-with-temporary-output-file
call-with-ascii-input-file
+ file-header-match
+ png-file?
elf-file?
ar-file?
gzip-file?
@@ -87,6 +91,8 @@
search-error-path
search-error-file
+ define-constant
+
every*
alist-cons-before
alist-cons-after
@@ -128,6 +134,16 @@
;;;
+;;; Syntax
+;;;
+
+;; Note that in its current form VAL doesn't get evaluated, just simply
+;; inlined. TODO?
+(define-syntax-rule (define-constant name val)
+ (define-syntax name (identifier-syntax val)))
+
+
+;;;
;;; Guile 2.0 compatibility later.
;;;
@@ -183,15 +199,21 @@ compression."
(getenv "NIX_STORE") ;inside builder, set by the daemon
"/gnu/store"))
+(define-constant %store-hash-string-length 32)
+
(define (store-file-name? file)
"Return true if FILE is in the store."
(string-prefix? (%store-directory) file))
+(define (store-path-prefix-length)
+ (+ 2 ; the slash after %store-directory, and the dash after the hash
+ (string-length (%store-directory))
+ %store-hash-string-length))
+
(define (strip-store-file-name file)
"Strip the '/gnu/store' and hash from FILE, a store file name. The result
is typically a \"PACKAGE-VERSION\" string."
- (string-drop file
- (+ 34 (string-length (%store-directory)))))
+ (string-drop file (store-path-prefix-length)))
(define (package-name->name+version name)
"Given NAME, a package name like \"foo-0.9.1b\", return two values:
@@ -238,6 +260,25 @@ introduce the version part."
"Return #t if FILE is a symbolic link (aka. \"symlink\".)"
(eq? (stat:type (lstat file)) 'symlink))
+(define (switch-symlinks link target)
+ "Atomically switch LINK, a symbolic link, to point to TARGET. Works
+both when LINK already exists and when it does not."
+ (let ((pivot (string-append link ".new")))
+ ;; Create pivot link, deleting it if it already exists. This can
+ ;; happen if a previous switch-symlinks was interrupted.
+ (let symlink/remove-old ()
+ (catch 'system-error
+ (lambda ()
+ (symlink target pivot))
+ (lambda args
+ (if (= (system-error-errno args) EEXIST)
+ (begin
+ ;; Remove old link and retry.
+ (delete-file pivot)
+ (symlink/remove-old))
+ (apply throw args)))))
+ (rename-file pivot link)))
+
(define (call-with-temporary-output-file proc)
"Call PROC with a name of a temporary file and open output port to that
file; close the file and delete it when leaving the dynamic extent of this
@@ -291,6 +332,15 @@ with the bytes in HEADER, a bytevector."
#f ;FILE is a directory
(apply throw args))))))
+(define %png-magic-bytes
+ ;; Magic bytes of PNG images, see ‘5.2 PNG signatures’ in
+ ;; ‘Portable Network Graphics (PNG) Specification (Second Edition)’
+ ;; on <https://www.w3.org/TR/PNG/>.
+ #vu8(137 80 78 71 13 10 26 10))
+
+(define png-file?
+ (file-header-match %png-magic-bytes))
+
(define %elf-magic-bytes
;; Magic bytes of ELF files. See <elf.h>.
(u8-list->bytevector (map char->integer (string->list "\x7FELF"))))
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 5f92174a2c..0fe4f1c98a 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -2127,7 +2127,7 @@ This yields an 'etc' directory containing these two files."
(define* (directory-union name things
#:key (copy? #f) (quiet? #f)
- (resolve-collision 'warn-about-collision))
+ (resolve-collision 'resolve-collision/default))
"Return a directory that is the union of THINGS, where THINGS is a list of
file-like objects denoting directories. For example:
diff --git a/guix/lint.scm b/guix/lint.scm
index 8e3976171f..a8a375e502 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -595,7 +595,6 @@ or \"bash-minimal\" is not in its inputs. 'wrap-script' is not supported."
(('wrap-program _ . _)
(list (report-wrap-program-error package 'wrap-program)))
;; Wrapper of 'wrap-program' for Qt programs.
- ;; TODO #:sh is not yet supported but probably will be.
(('wrap-qt-program _ '#:sh . _) '())
(('wrap-qt-program _ . _)
(list (report-wrap-program-error package 'wrap-qt-program)))
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 03333785f9..a7445c2ed8 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2014 David Thompson <davet@gnu.org>
+;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -32,7 +33,7 @@
#:use-module ((guix config) #:select (%state-directory))
#:use-module ((guix utils) #:hide (package-name->name+version))
#:use-module ((guix build utils)
- #:select (package-name->name+version mkdir-p))
+ #:select (package-name->name+version mkdir-p switch-symlinks))
#:use-module ((guix diagnostics) #:select (&fix-hint formatted-message))
#:use-module (guix i18n)
#:use-module (guix records)
diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm
index 1d8aae727e..a37f059711 100644
--- a/guix/scripts/home.scm
+++ b/guix/scripts/home.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2022-2023 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
;;;
;;; This file is part of GNU Guix.
@@ -63,7 +64,7 @@
#:autoload (guix scripts home edit) (guix-home-edit)
#:autoload (guix scripts home import) (import-manifest)
#:use-module ((guix status) #:select (with-status-verbosity))
- #:use-module ((guix build utils) #:select (mkdir-p))
+ #:use-module ((guix build utils) #:select (mkdir-p switch-symlinks))
#:use-module (guix gexp)
#:use-module (guix monads)
#:use-module (srfi srfi-1)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index b9090307ac..2f774621bb 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -11,6 +11,7 @@
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
+;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
;;;
;;; This file is part of GNU Guix.
@@ -49,7 +50,7 @@
#:autoload (guix channels) (channel-name channel-commit channel->code)
#:autoload (guix store roots) (gc-roots user-owned?)
#:use-module ((guix build utils)
- #:select (directory-exists? mkdir-p))
+ #:select (directory-exists? mkdir-p switch-symlinks))
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:autoload (ice-9 pretty-print) (pretty-print)
diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm
index 544aacfef4..9948df0ca6 100644
--- a/guix/scripts/system/reconfigure.scm
+++ b/guix/scripts/system/reconfigure.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
+;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -93,7 +94,8 @@ atomically, and run OS's activation script."
#:select? not-config?)
((guix config) => ,(make-config.scm)))
#~(begin
- (use-modules (guix config)
+ (use-modules (guix build utils)
+ (guix config)
(guix profiles)
(guix utils))
diff --git a/guix/utils.scm b/guix/utils.scm
index aca0af4e4b..1a1cf673b8 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -126,7 +126,6 @@
file-sans-extension
tarball-sans-extension
compressed-file?
- switch-symlinks
call-with-temporary-directory
with-atomic-file-output
@@ -913,13 +912,6 @@ VERSIONS. For example:
(->bool (member (file-extension file)
'("gz" "bz2" "xz" "lz" "lzma" "tgz" "tbz2" "zip"))))
-(define (switch-symlinks link target)
- "Atomically switch LINK, a symbolic link, to point to TARGET. Works
-both when LINK already exists and when it does not."
- (let ((pivot (string-append link ".new")))
- (symlink target pivot)
- (rename-file pivot link)))
-
(define* (string-replace-substring str substr replacement
#:optional
(start 0)