2017-03-12 16:48:40 +01:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2019-01-06 22:02:40 +01:00
|
|
|
|
;;; Copyright © 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
2018-05-25 16:24:49 +02:00
|
|
|
|
;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
|
2018-02-09 20:33:12 +01:00
|
|
|
|
;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
|
2018-03-11 01:13:01 +01:00
|
|
|
|
;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
|
2018-11-06 10:50:48 +01:00
|
|
|
|
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
|
2017-03-12 16:48:40 +01:00
|
|
|
|
;;;
|
|
|
|
|
;;; 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 scripts pack)
|
|
|
|
|
#:use-module (guix scripts)
|
|
|
|
|
#:use-module (guix ui)
|
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
|
#:use-module (guix utils)
|
|
|
|
|
#:use-module (guix store)
|
2019-02-11 23:05:36 +01:00
|
|
|
|
#:use-module ((guix status) #:select (with-status-verbosity))
|
2019-07-02 09:19:48 +02:00
|
|
|
|
#:use-module ((guix self) #:select (make-config.scm))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (guix grafts)
|
2019-02-23 04:38:47 +01:00
|
|
|
|
#:autoload (guix inferior) (inferior-package?)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (guix monads)
|
2017-03-16 18:02:59 +01:00
|
|
|
|
#:use-module (guix modules)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (guix profiles)
|
2019-03-06 23:53:08 +01:00
|
|
|
|
#:use-module (guix describe)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (guix derivations)
|
2018-05-02 17:08:37 +02:00
|
|
|
|
#:use-module (guix search-paths)
|
|
|
|
|
#:use-module (guix build-system gnu)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (guix scripts build)
|
2018-06-06 23:58:18 +02:00
|
|
|
|
#:use-module ((guix self) #:select (make-config.scm))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (gnu packages)
|
2018-03-11 01:13:01 +01:00
|
|
|
|
#:use-module (gnu packages bootstrap)
|
2018-10-27 12:52:47 +02:00
|
|
|
|
#:use-module ((gnu packages compression) #:hide (zip))
|
2018-03-11 01:13:01 +01:00
|
|
|
|
#:use-module (gnu packages guile)
|
2018-05-07 10:36:13 +02:00
|
|
|
|
#:use-module (gnu packages base)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:autoload (gnu packages package-management) (guix)
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 17:07:07 +02:00
|
|
|
|
#:autoload (gnu packages gnupg) (guile-gcrypt)
|
2017-05-20 14:28:24 +02:00
|
|
|
|
#:autoload (gnu packages guile) (guile2.0-json guile-json)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (srfi srfi-1)
|
|
|
|
|
#:use-module (srfi srfi-9)
|
2018-05-07 10:44:18 +02:00
|
|
|
|
#:use-module (srfi srfi-26)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
#:use-module (srfi srfi-37)
|
|
|
|
|
#:use-module (ice-9 match)
|
|
|
|
|
#:export (compressor?
|
|
|
|
|
lookup-compressor
|
|
|
|
|
self-contained-tarball
|
2018-11-03 21:53:07 +01:00
|
|
|
|
docker-image
|
2018-11-04 17:16:22 +01:00
|
|
|
|
squashfs-image
|
2018-11-03 21:53:07 +01:00
|
|
|
|
|
2017-03-12 16:48:40 +01:00
|
|
|
|
guix-pack))
|
|
|
|
|
|
|
|
|
|
;; Type of a compression tool.
|
|
|
|
|
(define-record-type <compressor>
|
2017-03-17 17:37:00 +01:00
|
|
|
|
(compressor name extension command)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
compressor?
|
2017-03-17 17:37:00 +01:00
|
|
|
|
(name compressor-name) ;string (e.g., "gzip")
|
2017-08-19 17:56:28 +02:00
|
|
|
|
(extension compressor-extension) ;string (e.g., ".lz")
|
2017-03-17 17:37:00 +01:00
|
|
|
|
(command compressor-command)) ;gexp (e.g., #~("/gnu/store/…/gzip" "-9n"))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
|
|
|
|
|
(define %compressors
|
|
|
|
|
;; Available compression tools.
|
2017-08-19 17:56:28 +02:00
|
|
|
|
(list (compressor "gzip" ".gz"
|
2017-03-17 17:37:00 +01:00
|
|
|
|
#~(#+(file-append gzip "/bin/gzip") "-9n"))
|
2017-08-19 17:56:28 +02:00
|
|
|
|
(compressor "lzip" ".lz"
|
2017-03-17 17:37:00 +01:00
|
|
|
|
#~(#+(file-append lzip "/bin/lzip") "-9"))
|
2017-08-19 17:56:28 +02:00
|
|
|
|
(compressor "xz" ".xz"
|
2018-07-22 18:01:35 +02:00
|
|
|
|
#~(#+(file-append xz "/bin/xz") "-e"))
|
2017-08-19 17:56:28 +02:00
|
|
|
|
(compressor "bzip2" ".bz2"
|
|
|
|
|
#~(#+(file-append bzip2 "/bin/bzip2") "-9"))
|
|
|
|
|
(compressor "none" "" #f)))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
|
2018-03-11 01:13:01 +01:00
|
|
|
|
;; This one is only for use in this module, so don't put it in %compressors.
|
|
|
|
|
(define bootstrap-xz
|
|
|
|
|
(compressor "bootstrap-xz" ".xz"
|
2018-07-22 18:01:35 +02:00
|
|
|
|
#~(#+(file-append %bootstrap-coreutils&co "/bin/xz") "-e")))
|
2018-03-11 01:13:01 +01:00
|
|
|
|
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(define (lookup-compressor name)
|
|
|
|
|
"Return the compressor object called NAME. Error out if it could not be
|
|
|
|
|
found."
|
|
|
|
|
(or (find (match-lambda
|
|
|
|
|
(($ <compressor> name*)
|
|
|
|
|
(string=? name* name)))
|
|
|
|
|
%compressors)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(leave (G_ "~a: compressor not found~%") name)))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
|
2018-06-25 21:49:12 +02:00
|
|
|
|
(define not-config?
|
|
|
|
|
;; Select (guix …) and (gnu …) modules, except (guix config).
|
|
|
|
|
(match-lambda
|
|
|
|
|
(('guix 'config) #f)
|
|
|
|
|
(('guix _ ...) #t)
|
|
|
|
|
(('gnu _ ...) #t)
|
|
|
|
|
(_ #f)))
|
|
|
|
|
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 17:07:07 +02:00
|
|
|
|
(define gcrypt-sqlite3&co
|
|
|
|
|
;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs.
|
|
|
|
|
(append-map (lambda (package)
|
|
|
|
|
(cons package
|
2019-02-11 22:52:28 +01:00
|
|
|
|
(match (package-transitive-propagated-inputs package)
|
|
|
|
|
(((labels packages) ...)
|
|
|
|
|
packages))))
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 17:07:07 +02:00
|
|
|
|
(list guile-gcrypt guile-sqlite3)))
|
2018-06-25 21:49:12 +02:00
|
|
|
|
|
2018-10-27 23:47:59 +02:00
|
|
|
|
(define (store-database items)
|
|
|
|
|
"Return a directory containing a store database where all of ITEMS and their
|
|
|
|
|
dependencies are registered."
|
|
|
|
|
(define schema
|
|
|
|
|
(local-file (search-path %load-path
|
|
|
|
|
"guix/store/schema.sql")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define labels
|
|
|
|
|
(map (lambda (n)
|
|
|
|
|
(string-append "closure" (number->string n)))
|
|
|
|
|
(iota (length items))))
|
|
|
|
|
|
|
|
|
|
(define build
|
|
|
|
|
(with-extensions gcrypt-sqlite3&co
|
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build store-copy)
|
2019-04-04 17:28:00 +02:00
|
|
|
|
(guix store database)))
|
2018-10-27 23:47:59 +02:00
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix store database)
|
|
|
|
|
(guix build store-copy)
|
|
|
|
|
(srfi srfi-1))
|
|
|
|
|
|
|
|
|
|
(define (read-closure closure)
|
|
|
|
|
(call-with-input-file closure read-reference-graph))
|
|
|
|
|
|
|
|
|
|
(let ((items (append-map read-closure '#$labels)))
|
|
|
|
|
(register-items items
|
|
|
|
|
#:state-directory #$output
|
|
|
|
|
#:deduplicate? #f
|
|
|
|
|
#:reset-timestamps? #f
|
|
|
|
|
#:registration-time %epoch
|
|
|
|
|
#:schema #$schema))))))
|
|
|
|
|
|
|
|
|
|
(computed-file "store-database" build
|
|
|
|
|
#:options `(#:references-graphs ,(zip labels items))))
|
|
|
|
|
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(define* (self-contained-tarball name profile
|
2017-03-17 22:45:32 +01:00
|
|
|
|
#:key target
|
2018-10-20 19:28:05 +02:00
|
|
|
|
(profile-name "guix-profile")
|
2017-03-17 22:45:32 +01:00
|
|
|
|
deduplicate?
|
2019-06-04 18:43:23 +02:00
|
|
|
|
entry-point
|
2017-03-14 15:11:03 +01:00
|
|
|
|
(compressor (first %compressors))
|
2017-03-14 16:37:17 +01:00
|
|
|
|
localstatedir?
|
2017-03-14 22:43:10 +01:00
|
|
|
|
(symlinks '())
|
2018-05-25 16:22:30 +02:00
|
|
|
|
(archiver tar))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
"Return a self-contained tarball containing a store initialized with the
|
2017-03-14 15:11:03 +01:00
|
|
|
|
closure of PROFILE, a derivation. The tarball contains /gnu/store; if
|
|
|
|
|
LOCALSTATEDIR? is true, it also contains /var/guix, including /var/guix/db
|
2017-03-14 16:37:17 +01:00
|
|
|
|
with a properly initialized store database.
|
|
|
|
|
|
|
|
|
|
SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be
|
|
|
|
|
added to the pack."
|
2018-10-27 23:47:59 +02:00
|
|
|
|
(define database
|
2018-06-06 23:58:18 +02:00
|
|
|
|
(and localstatedir?
|
2018-10-27 23:47:59 +02:00
|
|
|
|
(file-append (store-database (list profile))
|
|
|
|
|
"/db/db.sqlite")))
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(define build
|
2018-10-28 00:17:08 +02:00
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
`((guix build utils)
|
|
|
|
|
(guix build union)
|
|
|
|
|
(gnu build install))
|
|
|
|
|
#:select? not-config?)
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
((guix build union) #:select (relative-file-name))
|
|
|
|
|
(gnu build install)
|
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(srfi srfi-26)
|
|
|
|
|
(ice-9 match))
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
(define %root "root")
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
(define symlink->directives
|
|
|
|
|
;; Return "populate directives" to make the given symlink and its
|
|
|
|
|
;; parent directories.
|
|
|
|
|
(match-lambda
|
|
|
|
|
((source '-> target)
|
|
|
|
|
(let ((target (string-append #$profile "/" target))
|
|
|
|
|
(parent (dirname source)))
|
|
|
|
|
;; Never add a 'directory' directive for "/" so as to
|
|
|
|
|
;; preserve its ownnership when extracting the archive (see
|
|
|
|
|
;; below), and also because this would lead to adding the
|
|
|
|
|
;; same entries twice in the tarball.
|
|
|
|
|
`(,@(if (string=? parent "/")
|
|
|
|
|
'()
|
|
|
|
|
`((directory ,parent)))
|
|
|
|
|
(,source
|
|
|
|
|
-> ,(relative-file-name parent target)))))))
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
(define directives
|
|
|
|
|
;; Fully-qualified symlinks.
|
|
|
|
|
(append-map symlink->directives '#$symlinks))
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
;; The --sort option was added to GNU tar in version 1.28, released
|
|
|
|
|
;; 2014-07-28. For testing, we use the bootstrap tar, which is
|
|
|
|
|
;; older and doesn't support it.
|
|
|
|
|
(define tar-supports-sort?
|
|
|
|
|
(zero? (system* (string-append #+archiver "/bin/tar")
|
|
|
|
|
"cf" "/dev/null" "--files-from=/dev/null"
|
|
|
|
|
"--sort=name")))
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
;; Add 'tar' to the search path.
|
|
|
|
|
(setenv "PATH" #+(file-append archiver "/bin"))
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
;; Note: there is not much to gain here with deduplication and there
|
|
|
|
|
;; is the overhead of the '.links' directory, so turn it off.
|
|
|
|
|
;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs
|
|
|
|
|
;; with hard links:
|
|
|
|
|
;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>.
|
|
|
|
|
(populate-single-profile-directory %root
|
|
|
|
|
#:profile #$profile
|
2018-10-20 19:28:05 +02:00
|
|
|
|
#:profile-name #$profile-name
|
2018-10-28 00:17:08 +02:00
|
|
|
|
#:closure "profile"
|
|
|
|
|
#:database #+database)
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
;; Create SYMLINKS.
|
|
|
|
|
(for-each (cut evaluate-populate-directive <> %root)
|
|
|
|
|
directives)
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
;; Create the tarball. Use GNU format so there's no file name
|
|
|
|
|
;; length limitation.
|
|
|
|
|
(with-directory-excursion %root
|
|
|
|
|
(exit
|
|
|
|
|
(zero? (apply system* "tar"
|
|
|
|
|
#+@(if (compressor-command compressor)
|
|
|
|
|
#~("-I"
|
|
|
|
|
(string-join
|
|
|
|
|
'#+(compressor-command compressor)))
|
|
|
|
|
#~())
|
|
|
|
|
"--format=gnu"
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
;; Avoid non-determinism in the archive. Use
|
|
|
|
|
;; mtime = 1, not zero, because that is what the
|
|
|
|
|
;; daemon does for files in the store (see the
|
|
|
|
|
;; 'mtimeStore' constant in local-store.cc.)
|
|
|
|
|
(if tar-supports-sort? "--sort=name" "--mtime=@1")
|
|
|
|
|
"--mtime=@1" ;for files in /var/guix
|
|
|
|
|
"--owner=root:0"
|
|
|
|
|
"--group=root:0"
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
"--check-links"
|
|
|
|
|
"-cvf" #$output
|
|
|
|
|
;; Avoid adding / and /var to the tarball, so
|
|
|
|
|
;; that the ownership and permissions of those
|
|
|
|
|
;; directories will not be overwritten when
|
|
|
|
|
;; extracting the archive. Do not include /root
|
|
|
|
|
;; because the root account might have a
|
|
|
|
|
;; different home directory.
|
|
|
|
|
#$@(if localstatedir?
|
|
|
|
|
'("./var/guix")
|
|
|
|
|
'())
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
(string-append "." (%store-directory))
|
2018-06-06 23:58:18 +02:00
|
|
|
|
|
2018-10-28 00:17:08 +02:00
|
|
|
|
(delete-duplicates
|
|
|
|
|
(filter-map (match-lambda
|
|
|
|
|
(('directory directory)
|
|
|
|
|
(string-append "." directory))
|
|
|
|
|
((source '-> _)
|
|
|
|
|
(string-append "." source))
|
|
|
|
|
(_ #f))
|
|
|
|
|
directives)))))))))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
|
2019-06-04 18:43:23 +02:00
|
|
|
|
(when entry-point
|
|
|
|
|
(warning (G_ "entry point not supported in the '~a' format~%")
|
|
|
|
|
'tarball))
|
|
|
|
|
|
2017-08-19 17:56:28 +02:00
|
|
|
|
(gexp->derivation (string-append name ".tar"
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(compressor-extension compressor))
|
|
|
|
|
build
|
|
|
|
|
#:references-graphs `(("profile" ,profile))))
|
|
|
|
|
|
2019-07-02 10:30:23 +02:00
|
|
|
|
(define (singularity-environment-file profile)
|
|
|
|
|
"Return a shell script that defines the environment variables corresponding
|
|
|
|
|
to the search paths of PROFILE."
|
|
|
|
|
(define build
|
|
|
|
|
(with-extensions (list guile-gcrypt)
|
|
|
|
|
(with-imported-modules `(((guix config) => ,(make-config.scm))
|
|
|
|
|
,@(source-module-closure
|
|
|
|
|
`((guix profiles)
|
|
|
|
|
(guix search-paths))
|
|
|
|
|
#:select? not-config?))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix profiles) (guix search-paths)
|
|
|
|
|
(ice-9 match))
|
|
|
|
|
|
|
|
|
|
(call-with-output-file #$output
|
|
|
|
|
(lambda (port)
|
|
|
|
|
(for-each (match-lambda
|
|
|
|
|
((spec . value)
|
|
|
|
|
(format port "~a=~a~%export ~a~%"
|
|
|
|
|
(search-path-specification-variable spec)
|
|
|
|
|
value
|
|
|
|
|
(search-path-specification-variable spec))))
|
|
|
|
|
(profile-search-paths #$profile))))))))
|
|
|
|
|
|
|
|
|
|
(computed-file "singularity-environment.sh" build))
|
|
|
|
|
|
2018-05-25 16:24:49 +02:00
|
|
|
|
(define* (squashfs-image name profile
|
|
|
|
|
#:key target
|
2018-10-20 19:28:05 +02:00
|
|
|
|
(profile-name "guix-profile")
|
2018-05-25 16:24:49 +02:00
|
|
|
|
(compressor (first %compressors))
|
2019-06-04 18:43:23 +02:00
|
|
|
|
entry-point
|
2018-05-25 16:24:49 +02:00
|
|
|
|
localstatedir?
|
|
|
|
|
(symlinks '())
|
|
|
|
|
(archiver squashfs-tools-next))
|
|
|
|
|
"Return a squashfs image containing a store initialized with the closure of
|
|
|
|
|
PROFILE, a derivation. The image contains a subset of /gnu/store, empty mount
|
|
|
|
|
points for virtual file systems (like procfs), and optional symlinks.
|
|
|
|
|
|
|
|
|
|
SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be
|
|
|
|
|
added to the pack."
|
2018-11-04 17:16:22 +01:00
|
|
|
|
(define database
|
|
|
|
|
(and localstatedir?
|
|
|
|
|
(file-append (store-database (list profile))
|
|
|
|
|
"/db/db.sqlite")))
|
2018-06-25 21:49:12 +02:00
|
|
|
|
|
2019-07-02 10:30:23 +02:00
|
|
|
|
(define environment
|
|
|
|
|
(singularity-environment-file profile))
|
|
|
|
|
|
2018-05-25 16:24:49 +02:00
|
|
|
|
(define build
|
2018-10-27 23:47:59 +02:00
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build utils)
|
2018-11-04 17:16:22 +01:00
|
|
|
|
(guix build store-copy)
|
2019-03-19 11:03:35 +01:00
|
|
|
|
(guix build union)
|
2018-11-04 17:16:22 +01:00
|
|
|
|
(gnu build install))
|
2018-10-27 23:47:59 +02:00
|
|
|
|
#:select? not-config?)
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
(guix build store-copy)
|
2019-03-19 11:03:35 +01:00
|
|
|
|
((guix build union) #:select (relative-file-name))
|
2018-11-04 17:16:22 +01:00
|
|
|
|
(gnu build install)
|
2018-10-27 23:47:59 +02:00
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(srfi srfi-26)
|
|
|
|
|
(ice-9 match))
|
2018-06-25 21:49:12 +02:00
|
|
|
|
|
2018-11-04 17:16:22 +01:00
|
|
|
|
(define database #+database)
|
2019-06-04 18:43:23 +02:00
|
|
|
|
(define entry-point #$entry-point)
|
2018-11-04 17:16:22 +01:00
|
|
|
|
|
2018-10-27 23:47:59 +02:00
|
|
|
|
(setenv "PATH" (string-append #$archiver "/bin"))
|
|
|
|
|
|
|
|
|
|
;; We need an empty file in order to have a valid file argument when
|
|
|
|
|
;; we reparent the root file system. Read on for why that's
|
|
|
|
|
;; necessary.
|
|
|
|
|
(with-output-to-file ".empty" (lambda () (display "")))
|
|
|
|
|
|
|
|
|
|
;; Create the squashfs image in several steps.
|
|
|
|
|
;; Add all store items. Unfortunately mksquashfs throws away all
|
|
|
|
|
;; ancestor directories and only keeps the basename. We fix this
|
|
|
|
|
;; in the following invocations of mksquashfs.
|
|
|
|
|
(apply invoke "mksquashfs"
|
|
|
|
|
`(,@(map store-info-item
|
|
|
|
|
(call-with-input-file "profile"
|
|
|
|
|
read-reference-graph))
|
2019-07-02 10:30:23 +02:00
|
|
|
|
#$environment
|
2018-10-27 23:47:59 +02:00
|
|
|
|
,#$output
|
|
|
|
|
|
|
|
|
|
;; Do not perform duplicate checking because we
|
|
|
|
|
;; don't have any dupes.
|
|
|
|
|
"-no-duplicates"
|
|
|
|
|
"-comp"
|
|
|
|
|
,#+(compressor-name compressor)))
|
|
|
|
|
|
|
|
|
|
;; Here we reparent the store items. For each sub-directory of
|
|
|
|
|
;; the store prefix we need one invocation of "mksquashfs".
|
|
|
|
|
(for-each (lambda (dir)
|
|
|
|
|
(apply invoke "mksquashfs"
|
|
|
|
|
`(".empty"
|
|
|
|
|
,#$output
|
|
|
|
|
"-root-becomes" ,dir)))
|
|
|
|
|
(reverse (string-tokenize (%store-directory)
|
|
|
|
|
(char-set-complement (char-set #\/)))))
|
|
|
|
|
|
|
|
|
|
;; Add symlinks and mount points.
|
|
|
|
|
(apply invoke "mksquashfs"
|
|
|
|
|
`(".empty"
|
|
|
|
|
,#$output
|
|
|
|
|
;; Create SYMLINKS via pseudo file definitions.
|
|
|
|
|
,@(append-map
|
|
|
|
|
(match-lambda
|
|
|
|
|
((source '-> target)
|
2019-03-19 11:03:35 +01:00
|
|
|
|
;; Create relative symlinks to work around a bug in
|
|
|
|
|
;; Singularity 2.x:
|
|
|
|
|
;; https://bugs.gnu.org/34913
|
|
|
|
|
;; https://github.com/sylabs/singularity/issues/1487
|
|
|
|
|
(let ((target (string-append #$profile "/" target)))
|
|
|
|
|
(list "-p"
|
|
|
|
|
(string-join
|
|
|
|
|
;; name s mode uid gid symlink
|
|
|
|
|
(list source
|
|
|
|
|
"s" "777" "0" "0"
|
|
|
|
|
(relative-file-name (dirname source)
|
|
|
|
|
target)))))))
|
2018-10-27 23:47:59 +02:00
|
|
|
|
'#$symlinks)
|
|
|
|
|
|
2019-07-02 10:30:23 +02:00
|
|
|
|
"-p" "/.singularity.d d 555 0 0"
|
|
|
|
|
|
|
|
|
|
;; Create the environment file.
|
|
|
|
|
"-p" "/.singularity.d/env d 555 0 0"
|
|
|
|
|
"-p" ,(string-append
|
|
|
|
|
"/.singularity.d/env/90-environment.sh s 777 0 0 "
|
|
|
|
|
(relative-file-name "/.singularity.d/env"
|
|
|
|
|
#$environment))
|
|
|
|
|
|
2019-06-04 18:43:23 +02:00
|
|
|
|
;; Create /.singularity.d/actions, and optionally the 'run'
|
|
|
|
|
;; script, used by 'singularity run'.
|
|
|
|
|
"-p" "/.singularity.d/actions d 555 0 0"
|
2019-07-02 10:30:23 +02:00
|
|
|
|
|
2019-06-04 18:43:23 +02:00
|
|
|
|
,@(if entry-point
|
|
|
|
|
`(;; This one if for Singularity 2.x.
|
|
|
|
|
"-p"
|
|
|
|
|
,(string-append
|
|
|
|
|
"/.singularity.d/actions/run s 777 0 0 "
|
|
|
|
|
(relative-file-name "/.singularity.d/actions"
|
|
|
|
|
(string-append #$profile "/"
|
|
|
|
|
entry-point)))
|
|
|
|
|
|
|
|
|
|
;; This one is for Singularity 3.x.
|
|
|
|
|
"-p"
|
|
|
|
|
,(string-append
|
|
|
|
|
"/.singularity.d/runscript s 777 0 0 "
|
|
|
|
|
(relative-file-name "/.singularity.d"
|
|
|
|
|
(string-append #$profile "/"
|
|
|
|
|
entry-point))))
|
|
|
|
|
'())
|
|
|
|
|
|
2018-10-27 23:47:59 +02:00
|
|
|
|
;; Create empty mount points.
|
|
|
|
|
"-p" "/proc d 555 0 0"
|
|
|
|
|
"-p" "/sys d 555 0 0"
|
2019-03-19 11:14:39 +01:00
|
|
|
|
"-p" "/dev d 555 0 0"
|
|
|
|
|
"-p" "/home d 555 0 0"))
|
2018-11-04 17:16:22 +01:00
|
|
|
|
|
|
|
|
|
(when database
|
|
|
|
|
;; Initialize /var/guix.
|
|
|
|
|
(install-database-and-gc-roots "var-etc" database #$profile)
|
|
|
|
|
(invoke "mksquashfs" "var-etc" #$output)))))
|
2018-05-25 16:24:49 +02:00
|
|
|
|
|
|
|
|
|
(gexp->derivation (string-append name
|
|
|
|
|
(compressor-extension compressor)
|
|
|
|
|
".squashfs")
|
|
|
|
|
build
|
|
|
|
|
#:references-graphs `(("profile" ,profile))))
|
|
|
|
|
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(define* (docker-image name profile
|
2017-03-17 22:45:32 +01:00
|
|
|
|
#:key target
|
2018-10-20 19:28:05 +02:00
|
|
|
|
(profile-name "guix-profile")
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(compressor (first %compressors))
|
2019-06-04 18:43:23 +02:00
|
|
|
|
entry-point
|
2017-03-16 18:02:59 +01:00
|
|
|
|
localstatedir?
|
|
|
|
|
(symlinks '())
|
2018-05-25 16:22:30 +02:00
|
|
|
|
(archiver tar))
|
2017-03-16 18:02:59 +01:00
|
|
|
|
"Return a derivation to construct a Docker image of PROFILE. The
|
|
|
|
|
image is a tarball conforming to the Docker Image Specification, compressed
|
2017-03-17 22:45:32 +01:00
|
|
|
|
with COMPRESSOR. It can be passed to 'docker load'. If TARGET is true, it
|
|
|
|
|
must a be a GNU triplet and it is used to derive the architecture metadata in
|
|
|
|
|
the image."
|
2018-11-03 21:53:07 +01:00
|
|
|
|
(define database
|
|
|
|
|
(and localstatedir?
|
|
|
|
|
(file-append (store-database (list profile))
|
|
|
|
|
"/db/db.sqlite")))
|
|
|
|
|
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(define defmod 'define-module) ;trick Geiser
|
|
|
|
|
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(define build
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 17:07:07 +02:00
|
|
|
|
;; Guile-JSON and Guile-Gcrypt are required by (guix docker).
|
2019-07-21 23:05:54 +02:00
|
|
|
|
(with-extensions (list guile-json-3 guile-gcrypt)
|
2019-07-02 09:19:48 +02:00
|
|
|
|
(with-imported-modules `(((guix config) => ,(make-config.scm))
|
|
|
|
|
,@(source-module-closure
|
|
|
|
|
`((guix docker)
|
|
|
|
|
(guix build store-copy)
|
|
|
|
|
(guix profiles)
|
|
|
|
|
(guix search-paths))
|
|
|
|
|
#:select? not-config?))
|
2018-05-28 18:22:24 +02:00
|
|
|
|
#~(begin
|
2019-07-02 09:19:48 +02:00
|
|
|
|
(use-modules (guix docker) (guix build store-copy)
|
|
|
|
|
(guix profiles) (guix search-paths)
|
|
|
|
|
(srfi srfi-19) (ice-9 match))
|
|
|
|
|
|
|
|
|
|
(define environment
|
|
|
|
|
(map (match-lambda
|
|
|
|
|
((spec . value)
|
|
|
|
|
(cons (search-path-specification-variable spec)
|
|
|
|
|
value)))
|
|
|
|
|
(profile-search-paths #$profile)))
|
2018-05-28 18:22:24 +02:00
|
|
|
|
|
|
|
|
|
(setenv "PATH" (string-append #$archiver "/bin"))
|
|
|
|
|
|
|
|
|
|
(build-docker-image #$output
|
2018-06-04 22:06:34 +02:00
|
|
|
|
(map store-info-item
|
|
|
|
|
(call-with-input-file "profile"
|
|
|
|
|
read-reference-graph))
|
2018-05-28 18:22:24 +02:00
|
|
|
|
#$profile
|
2018-11-03 21:53:07 +01:00
|
|
|
|
#:database #+database
|
2018-05-28 18:22:24 +02:00
|
|
|
|
#:system (or #$target (utsname:machine (uname)))
|
2019-07-02 09:19:48 +02:00
|
|
|
|
#:environment environment
|
2019-07-22 00:45:42 +02:00
|
|
|
|
#:entry-point
|
|
|
|
|
#$(and entry-point
|
|
|
|
|
#~(list (string-append #$profile "/"
|
|
|
|
|
#$entry-point)))
|
2018-05-28 18:22:24 +02:00
|
|
|
|
#:symlinks '#$symlinks
|
|
|
|
|
#:compressor '#$(compressor-command compressor)
|
|
|
|
|
#:creation-time (make-time time-utc 0 1))))))
|
2017-03-16 18:02:59 +01:00
|
|
|
|
|
2017-08-19 17:56:28 +02:00
|
|
|
|
(gexp->derivation (string-append name ".tar"
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(compressor-extension compressor))
|
|
|
|
|
build
|
|
|
|
|
#:references-graphs `(("profile" ,profile))))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
|
2018-05-02 17:08:37 +02:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Compiling C programs.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
;; A C compiler. That lowers to a single program that can be passed typical C
|
|
|
|
|
;; compiler flags, and it makes sure the whole toolchain is available.
|
|
|
|
|
(define-record-type <c-compiler>
|
|
|
|
|
(%c-compiler toolchain guile)
|
|
|
|
|
c-compiler?
|
|
|
|
|
(toolchain c-compiler-toolchain)
|
|
|
|
|
(guile c-compiler-guile))
|
|
|
|
|
|
|
|
|
|
(define* (c-compiler #:optional inputs
|
|
|
|
|
#:key (guile (default-guile)))
|
|
|
|
|
(%c-compiler inputs guile))
|
|
|
|
|
|
|
|
|
|
(define (bootstrap-c-compiler)
|
|
|
|
|
"Return the C compiler that uses the bootstrap toolchain. This is used only
|
|
|
|
|
by '--bootstrap', for testing purposes."
|
|
|
|
|
(define bootstrap-toolchain
|
2018-09-09 11:54:27 +02:00
|
|
|
|
(list (first (assoc-ref (%bootstrap-inputs) "gcc"))
|
|
|
|
|
(first (assoc-ref (%bootstrap-inputs) "binutils"))
|
|
|
|
|
(first (assoc-ref (%bootstrap-inputs) "libc"))))
|
2018-05-02 17:08:37 +02:00
|
|
|
|
|
|
|
|
|
(c-compiler bootstrap-toolchain
|
|
|
|
|
#:guile %bootstrap-guile))
|
|
|
|
|
|
|
|
|
|
(define-gexp-compiler (c-compiler-compiler (compiler <c-compiler>) system target)
|
|
|
|
|
"Lower COMPILER to a single script that does the right thing."
|
|
|
|
|
(define toolchain
|
|
|
|
|
(or (c-compiler-toolchain compiler)
|
|
|
|
|
(list (first (assoc-ref (standard-packages) "gcc"))
|
|
|
|
|
(first (assoc-ref (standard-packages) "ld-wrapper"))
|
|
|
|
|
(first (assoc-ref (standard-packages) "binutils"))
|
|
|
|
|
(first (assoc-ref (standard-packages) "libc"))
|
|
|
|
|
(gexp-input (first (assoc-ref (standard-packages) "libc"))
|
|
|
|
|
"static"))))
|
|
|
|
|
|
|
|
|
|
(define inputs
|
|
|
|
|
(match (append-map package-propagated-inputs
|
|
|
|
|
(filter package? toolchain))
|
|
|
|
|
(((labels things . _) ...)
|
|
|
|
|
(append toolchain things))))
|
|
|
|
|
|
|
|
|
|
(define search-paths
|
|
|
|
|
(cons $PATH
|
|
|
|
|
(append-map package-native-search-paths
|
|
|
|
|
(filter package? inputs))))
|
|
|
|
|
|
|
|
|
|
(define run
|
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build utils)
|
|
|
|
|
(guix search-paths)))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils) (guix search-paths)
|
|
|
|
|
(ice-9 match))
|
|
|
|
|
|
|
|
|
|
(define (output-file args)
|
|
|
|
|
(let loop ((args args))
|
|
|
|
|
(match args
|
|
|
|
|
(() "a.out")
|
|
|
|
|
(("-o" file _ ...) file)
|
|
|
|
|
((head rest ...) (loop rest)))))
|
|
|
|
|
|
|
|
|
|
(set-search-paths (map sexp->search-path-specification
|
|
|
|
|
'#$(map search-path-specification->sexp
|
|
|
|
|
search-paths))
|
|
|
|
|
'#$inputs)
|
|
|
|
|
|
|
|
|
|
(let ((output (output-file (command-line))))
|
|
|
|
|
(apply invoke "gcc" (cdr (command-line)))
|
|
|
|
|
(invoke "strip" output)))))
|
|
|
|
|
|
|
|
|
|
(when target
|
|
|
|
|
;; TODO: Yep, we'll have to do it someday!
|
|
|
|
|
(leave (G_ "cross-compilation not implemented here;
|
|
|
|
|
please email '~a'~%")
|
|
|
|
|
(@ (guix config) %guix-bug-report-address)))
|
|
|
|
|
|
|
|
|
|
(gexp->script "c-compiler" run
|
|
|
|
|
#:guile (c-compiler-guile compiler)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Wrapped package.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define* (wrapped-package package
|
2019-03-14 17:02:53 +01:00
|
|
|
|
#:optional (compiler (c-compiler))
|
|
|
|
|
#:key proot?)
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(define runner
|
|
|
|
|
(local-file (search-auxiliary-file "run-in-namespace.c")))
|
|
|
|
|
|
2019-03-14 17:02:53 +01:00
|
|
|
|
(define (proot)
|
|
|
|
|
(specification->package "proot-static"))
|
|
|
|
|
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(define build
|
2018-05-14 22:59:14 +02:00
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build utils)
|
|
|
|
|
(guix build union)))
|
2018-05-02 17:08:37 +02:00
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
2018-05-14 22:59:14 +02:00
|
|
|
|
((guix build union) #:select (relative-file-name))
|
|
|
|
|
(ice-9 ftw)
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(ice-9 match))
|
|
|
|
|
|
|
|
|
|
(define (strip-store-prefix file)
|
|
|
|
|
;; Given a file name like "/gnu/store/…-foo-1.2/bin/foo", return
|
|
|
|
|
;; "/bin/foo".
|
|
|
|
|
(let* ((len (string-length (%store-directory)))
|
|
|
|
|
(base (string-drop file (+ 1 len))))
|
|
|
|
|
(match (string-index base #\/)
|
|
|
|
|
(#f base)
|
|
|
|
|
(index (string-drop base index)))))
|
|
|
|
|
|
|
|
|
|
(define (build-wrapper program)
|
|
|
|
|
;; Build a user-namespace wrapper for PROGRAM.
|
|
|
|
|
(format #t "building wrapper for '~a'...~%" program)
|
|
|
|
|
(copy-file #$runner "run.c")
|
|
|
|
|
|
|
|
|
|
(substitute* "run.c"
|
|
|
|
|
(("@WRAPPED_PROGRAM@") program)
|
|
|
|
|
(("@STORE_DIRECTORY@") (%store-directory)))
|
|
|
|
|
|
|
|
|
|
(let* ((base (strip-store-prefix program))
|
2019-03-14 17:02:53 +01:00
|
|
|
|
(result (string-append #$output "/" base))
|
|
|
|
|
(proot #$(and proot?
|
|
|
|
|
#~(string-drop
|
|
|
|
|
#$(file-append (proot) "/bin/proot")
|
|
|
|
|
(+ (string-length (%store-directory))
|
|
|
|
|
1)))))
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(mkdir-p (dirname result))
|
2019-03-14 17:02:53 +01:00
|
|
|
|
(apply invoke #$compiler "-std=gnu99" "-static" "-Os" "-g0" "-Wall"
|
|
|
|
|
"run.c" "-o" result
|
|
|
|
|
(if proot
|
|
|
|
|
(list (string-append "-DPROOT_PROGRAM=\""
|
|
|
|
|
proot "\""))
|
|
|
|
|
'()))
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(delete-file "run.c")))
|
|
|
|
|
|
2019-01-06 22:02:40 +01:00
|
|
|
|
(setvbuf (current-output-port) 'line)
|
2018-05-14 22:59:14 +02:00
|
|
|
|
|
|
|
|
|
;; Link the top-level files of PACKAGE so that search paths are
|
|
|
|
|
;; properly defined in PROFILE/etc/profile.
|
|
|
|
|
(mkdir #$output)
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(unless (member file '("." ".." "bin" "sbin" "libexec"))
|
|
|
|
|
(let ((file* (string-append #$package "/" file)))
|
|
|
|
|
(symlink (relative-file-name #$output file*)
|
|
|
|
|
(string-append #$output "/" file)))))
|
|
|
|
|
(scandir #$package))
|
|
|
|
|
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(for-each build-wrapper
|
|
|
|
|
(append (find-files #$(file-append package "/bin"))
|
|
|
|
|
(find-files #$(file-append package "/sbin"))
|
|
|
|
|
(find-files #$(file-append package "/libexec")))))))
|
|
|
|
|
|
2019-02-23 04:38:47 +01:00
|
|
|
|
(computed-file (string-append
|
|
|
|
|
(cond ((package? package)
|
|
|
|
|
(package-full-name package "-"))
|
|
|
|
|
((inferior-package? package)
|
|
|
|
|
(string-append (inferior-package-name package)
|
|
|
|
|
"-"
|
|
|
|
|
(inferior-package-version package)))
|
|
|
|
|
(else "wrapper"))
|
|
|
|
|
"R")
|
2018-05-02 17:08:37 +02:00
|
|
|
|
build))
|
|
|
|
|
|
|
|
|
|
(define (map-manifest-entries proc manifest)
|
|
|
|
|
"Apply PROC to all the entries of MANIFEST and return a new manifest."
|
|
|
|
|
(make-manifest
|
|
|
|
|
(map (lambda (entry)
|
|
|
|
|
(manifest-entry
|
|
|
|
|
(inherit entry)
|
|
|
|
|
(item (proc (manifest-entry-item entry)))))
|
|
|
|
|
(manifest-entries manifest))))
|
|
|
|
|
|
2017-03-12 16:48:40 +01:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Command-line options.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define %default-options
|
|
|
|
|
;; Alist of default option values.
|
2017-03-16 18:02:59 +01:00
|
|
|
|
`((format . tarball)
|
2018-10-20 19:28:05 +02:00
|
|
|
|
(profile-name . "guix-profile")
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(system . ,(%current-system))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(substitutes? . #t)
|
2017-12-07 22:49:08 +01:00
|
|
|
|
(build-hook? . #t)
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(graft? . #t)
|
2017-01-18 23:21:29 +01:00
|
|
|
|
(print-build-trace? . #t)
|
|
|
|
|
(print-extended-build-trace? . #t)
|
2018-10-15 23:06:55 +02:00
|
|
|
|
(multiplexed-build-output? . #t)
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 14:17:19 +01:00
|
|
|
|
(debug . 0)
|
2019-04-04 17:32:37 +02:00
|
|
|
|
(verbosity . 1)
|
2017-03-14 16:37:17 +01:00
|
|
|
|
(symlinks . ())
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(compressor . ,(first %compressors))))
|
|
|
|
|
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(define %formats
|
|
|
|
|
;; Supported pack formats.
|
|
|
|
|
`((tarball . ,self-contained-tarball)
|
2018-05-25 16:24:49 +02:00
|
|
|
|
(squashfs . ,squashfs-image)
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(docker . ,docker-image)))
|
|
|
|
|
|
2018-11-06 10:50:48 +01:00
|
|
|
|
(define (show-formats)
|
|
|
|
|
;; Print the supported pack formats.
|
|
|
|
|
(display (G_ "The supported formats for 'guix pack' are:"))
|
|
|
|
|
(newline)
|
|
|
|
|
(display (G_ "
|
|
|
|
|
tarball Self-contained tarball, ready to run on another machine"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
squashfs Squashfs image suitable for Singularity"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
docker Tarball ready for 'docker load'"))
|
|
|
|
|
(newline))
|
|
|
|
|
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(define %options
|
|
|
|
|
;; Specifications of the command-line options.
|
|
|
|
|
(cons* (option '(#\h "help") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-help)
|
|
|
|
|
(exit 0)))
|
|
|
|
|
(option '(#\V "version") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-version-and-exit "guix pack")))
|
|
|
|
|
|
|
|
|
|
(option '(#\n "dry-run") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'dry-run? #t (alist-cons 'graft? #f result))))
|
2017-03-16 18:02:59 +01:00
|
|
|
|
(option '(#\f "format") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'format (string->symbol arg) result)))
|
2018-11-06 10:50:48 +01:00
|
|
|
|
(option '("list-formats") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-formats)
|
|
|
|
|
(exit 0)))
|
2018-05-02 17:08:37 +02:00
|
|
|
|
(option '(#\R "relocatable") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
2019-03-14 17:02:53 +01:00
|
|
|
|
(match (assq-ref result 'relocatable?)
|
|
|
|
|
(#f
|
|
|
|
|
(alist-cons 'relocatable? #t result))
|
|
|
|
|
(_
|
|
|
|
|
(alist-cons 'relocatable? 'proot
|
|
|
|
|
(alist-delete 'relocatable? result))))))
|
2017-04-07 22:20:28 +02:00
|
|
|
|
(option '(#\e "expression") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'expression arg result)))
|
2018-02-09 20:33:12 +01:00
|
|
|
|
(option '(#\m "manifest") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'manifest arg result)))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(option '(#\s "system") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'system arg
|
|
|
|
|
(alist-delete 'system result eq?))))
|
2019-06-04 18:43:23 +02:00
|
|
|
|
(option '("entry-point") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'entry-point arg result)))
|
2017-03-17 22:45:32 +01:00
|
|
|
|
(option '("target") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'target arg
|
|
|
|
|
(alist-delete 'target result eq?))))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(option '(#\C "compression") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'compressor (lookup-compressor arg)
|
|
|
|
|
result)))
|
2017-03-14 16:37:17 +01:00
|
|
|
|
(option '(#\S "symlink") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
2017-03-16 22:46:43 +01:00
|
|
|
|
;; Note: Using 'string-split' allows us to handle empty
|
|
|
|
|
;; TARGET (as in "/opt/guile=", meaning that /opt/guile is
|
|
|
|
|
;; a symlink to the profile) correctly.
|
|
|
|
|
(match (string-split arg (char-set #\=))
|
2017-03-14 16:37:17 +01:00
|
|
|
|
((source target)
|
|
|
|
|
(let ((symlinks (assoc-ref result 'symlinks)))
|
|
|
|
|
(alist-cons 'symlinks
|
|
|
|
|
`((,source -> ,target) ,@symlinks)
|
|
|
|
|
(alist-delete 'symlinks result eq?))))
|
|
|
|
|
(x
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(leave (G_ "~a: invalid symlink specification~%")
|
2017-03-14 16:37:17 +01:00
|
|
|
|
arg)))))
|
2019-03-06 23:53:08 +01:00
|
|
|
|
(option '("save-provenance") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'save-provenance? #t result)))
|
2017-03-14 15:11:03 +01:00
|
|
|
|
(option '("localstatedir") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'localstatedir? #t result)))
|
2018-10-20 19:28:05 +02:00
|
|
|
|
(option '("profile-name") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(match arg
|
|
|
|
|
((or "guix-profile" "current-guix")
|
|
|
|
|
(alist-cons 'profile-name arg result))
|
|
|
|
|
(_
|
|
|
|
|
(leave (G_ "~a: unsupported profile name~%") arg)))))
|
2019-05-21 14:33:51 +02:00
|
|
|
|
(option '(#\r "root") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'gc-root arg result)))
|
|
|
|
|
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 14:17:19 +01:00
|
|
|
|
(option '(#\v "verbosity") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(let ((level (string->number* arg)))
|
|
|
|
|
(alist-cons 'verbosity level
|
|
|
|
|
(alist-delete 'verbosity result)))))
|
2018-03-11 01:13:01 +01:00
|
|
|
|
(option '("bootstrap") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'bootstrap? #t result)))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
|
|
|
|
|
(append %transformation-options
|
|
|
|
|
%standard-build-options)))
|
|
|
|
|
|
|
|
|
|
(define (show-help)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "Usage: guix pack [OPTION]... PACKAGE...
|
2017-03-12 16:48:40 +01:00
|
|
|
|
Create a bundle of PACKAGE.\n"))
|
|
|
|
|
(show-build-options-help)
|
|
|
|
|
(newline)
|
|
|
|
|
(show-transformation-options-help)
|
|
|
|
|
(newline)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-16 18:02:59 +01:00
|
|
|
|
-f, --format=FORMAT build a pack in the given FORMAT"))
|
2018-11-06 10:50:48 +01:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--list-formats list the formats available"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2018-05-02 17:08:37 +02:00
|
|
|
|
-R, --relocatable produce relocatable executables"))
|
|
|
|
|
(display (G_ "
|
2017-04-07 22:20:28 +02:00
|
|
|
|
-e, --expression=EXPR consider the package EXPR evaluates to"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-12 16:48:40 +01:00
|
|
|
|
-s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\""))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-17 22:45:32 +01:00
|
|
|
|
--target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\""))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-12 16:48:40 +01:00
|
|
|
|
-C, --compression=TOOL compress using TOOL--e.g., \"lzip\""))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-14 16:37:17 +01:00
|
|
|
|
-S, --symlink=SPEC create symlinks to the profile according to SPEC"))
|
2018-02-09 20:33:12 +01:00
|
|
|
|
(display (G_ "
|
2018-02-15 22:23:20 +01:00
|
|
|
|
-m, --manifest=FILE create a pack with the manifest from FILE"))
|
2019-06-04 18:43:23 +02:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--entry-point=PROGRAM
|
|
|
|
|
use PROGRAM as the entry point of the pack"))
|
2019-03-06 23:53:08 +01:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--save-provenance save provenance information"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-14 15:11:03 +01:00
|
|
|
|
--localstatedir include /var/guix in the resulting pack"))
|
2018-10-20 19:28:05 +02:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--profile-name=NAME
|
|
|
|
|
populate /var/guix/profiles/.../NAME"))
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 14:17:19 +01:00
|
|
|
|
(display (G_ "
|
2019-05-21 14:33:51 +02:00
|
|
|
|
-r, --root=FILE make FILE a symlink to the result, and register it
|
|
|
|
|
as a garbage collector root"))
|
|
|
|
|
(display (G_ "
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 14:17:19 +01:00
|
|
|
|
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
|
2018-03-11 01:13:01 +01:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--bootstrap use the bootstrap binaries to build the pack"))
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(newline)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-12 16:48:40 +01:00
|
|
|
|
-h, --help display this help and exit"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 15:57:02 +02:00
|
|
|
|
(display (G_ "
|
2017-03-12 16:48:40 +01:00
|
|
|
|
-V, --version display version information and exit"))
|
|
|
|
|
(newline)
|
|
|
|
|
(show-bug-report-information))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Entry point.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define (guix-pack . args)
|
|
|
|
|
(define opts
|
|
|
|
|
(parse-command-line args %options (list %default-options)))
|
|
|
|
|
|
2017-04-07 22:20:28 +02:00
|
|
|
|
(define maybe-package-argument
|
|
|
|
|
;; Given an option pair, return a package, a package/output tuple, or #f.
|
|
|
|
|
(match-lambda
|
|
|
|
|
(('argument . spec)
|
|
|
|
|
(call-with-values
|
|
|
|
|
(lambda ()
|
|
|
|
|
(specification->package+output spec))
|
|
|
|
|
list))
|
|
|
|
|
(('expression . exp)
|
|
|
|
|
(read/eval-package-expression exp))
|
|
|
|
|
(x #f)))
|
|
|
|
|
|
2018-05-07 10:44:18 +02:00
|
|
|
|
(define (manifest-from-args store opts)
|
|
|
|
|
(let* ((transform (options->transformation opts))
|
|
|
|
|
(packages (map (match-lambda
|
|
|
|
|
(((? package? package) output)
|
2018-05-07 14:04:19 +02:00
|
|
|
|
(list (transform store package) output))
|
|
|
|
|
((? package? package)
|
|
|
|
|
(list (transform store package) "out")))
|
2018-05-07 10:44:18 +02:00
|
|
|
|
(filter-map maybe-package-argument opts)))
|
|
|
|
|
(manifest-file (assoc-ref opts 'manifest)))
|
2019-03-06 23:53:08 +01:00
|
|
|
|
(define properties
|
|
|
|
|
(if (assoc-ref opts 'save-provenance?)
|
|
|
|
|
(lambda (package)
|
|
|
|
|
(match (package-provenance package)
|
|
|
|
|
(#f
|
|
|
|
|
(warning (G_ "could not determine provenance of package ~a~%")
|
|
|
|
|
(package-full-name package))
|
|
|
|
|
'())
|
|
|
|
|
(sexp
|
|
|
|
|
`((provenance . ,sexp)))))
|
|
|
|
|
(const '())))
|
|
|
|
|
|
2018-02-09 20:33:12 +01:00
|
|
|
|
(cond
|
|
|
|
|
((and manifest-file (not (null? packages)))
|
|
|
|
|
(leave (G_ "both a manifest and a package list were given~%")))
|
|
|
|
|
(manifest-file
|
|
|
|
|
(let ((user-module (make-user-module '((guix profiles) (gnu)))))
|
|
|
|
|
(load* manifest-file user-module)))
|
2019-03-06 23:53:08 +01:00
|
|
|
|
(else
|
|
|
|
|
(manifest
|
|
|
|
|
(map (match-lambda
|
|
|
|
|
((package output)
|
|
|
|
|
(package->manifest-entry package output
|
|
|
|
|
#:properties
|
|
|
|
|
(properties package))))
|
|
|
|
|
packages))))))
|
2018-02-09 20:33:12 +01:00
|
|
|
|
|
2017-03-12 16:48:40 +01:00
|
|
|
|
(with-error-handling
|
2018-05-07 10:44:18 +02:00
|
|
|
|
(with-store store
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 14:17:19 +01:00
|
|
|
|
(with-status-verbosity (assoc-ref opts 'verbosity)
|
2017-01-18 23:21:29 +01:00
|
|
|
|
;; Set the build options before we do anything else.
|
|
|
|
|
(set-build-options-from-command-line store opts)
|
|
|
|
|
|
|
|
|
|
(parameterize ((%graft? (assoc-ref opts 'graft?))
|
|
|
|
|
(%guile-for-build (package-derivation
|
|
|
|
|
store
|
|
|
|
|
(if (assoc-ref opts 'bootstrap?)
|
|
|
|
|
%bootstrap-guile
|
|
|
|
|
(canonical-package guile-2.2))
|
|
|
|
|
(assoc-ref opts 'system)
|
|
|
|
|
#:graft? (assoc-ref opts 'graft?))))
|
|
|
|
|
(let* ((dry-run? (assoc-ref opts 'dry-run?))
|
|
|
|
|
(relocatable? (assoc-ref opts 'relocatable?))
|
2019-03-14 17:02:53 +01:00
|
|
|
|
(proot? (eq? relocatable? 'proot))
|
2017-01-18 23:21:29 +01:00
|
|
|
|
(manifest (let ((manifest (manifest-from-args store opts)))
|
|
|
|
|
;; Note: We cannot honor '--bootstrap' here because
|
|
|
|
|
;; 'glibc-bootstrap' lacks 'libc.a'.
|
|
|
|
|
(if relocatable?
|
2019-03-14 17:02:53 +01:00
|
|
|
|
(map-manifest-entries
|
|
|
|
|
(cut wrapped-package <> #:proot? proot?)
|
|
|
|
|
manifest)
|
2017-01-18 23:21:29 +01:00
|
|
|
|
manifest)))
|
|
|
|
|
(pack-format (assoc-ref opts 'format))
|
|
|
|
|
(name (string-append (symbol->string pack-format)
|
|
|
|
|
"-pack"))
|
|
|
|
|
(target (assoc-ref opts 'target))
|
|
|
|
|
(bootstrap? (assoc-ref opts 'bootstrap?))
|
|
|
|
|
(compressor (if bootstrap?
|
|
|
|
|
bootstrap-xz
|
|
|
|
|
(assoc-ref opts 'compressor)))
|
|
|
|
|
(archiver (if (equal? pack-format 'squashfs)
|
|
|
|
|
squashfs-tools-next
|
|
|
|
|
(if bootstrap?
|
|
|
|
|
%bootstrap-coreutils&co
|
|
|
|
|
tar)))
|
|
|
|
|
(symlinks (assoc-ref opts 'symlinks))
|
|
|
|
|
(build-image (match (assq-ref %formats pack-format)
|
|
|
|
|
((? procedure? proc) proc)
|
|
|
|
|
(#f
|
|
|
|
|
(leave (G_ "~a: unknown pack format~%")
|
|
|
|
|
pack-format))))
|
2018-10-20 19:28:05 +02:00
|
|
|
|
(localstatedir? (assoc-ref opts 'localstatedir?))
|
2019-06-04 18:43:23 +02:00
|
|
|
|
(entry-point (assoc-ref opts 'entry-point))
|
2019-05-21 14:33:51 +02:00
|
|
|
|
(profile-name (assoc-ref opts 'profile-name))
|
|
|
|
|
(gc-root (assoc-ref opts 'gc-root)))
|
2019-05-21 14:49:58 +02:00
|
|
|
|
(when (null? (manifest-entries manifest))
|
|
|
|
|
(warning (G_ "no packages specified; building an empty pack~%")))
|
|
|
|
|
|
2017-01-18 23:21:29 +01:00
|
|
|
|
(run-with-store store
|
|
|
|
|
(mlet* %store-monad ((profile (profile-derivation
|
|
|
|
|
manifest
|
2019-03-19 11:03:35 +01:00
|
|
|
|
|
|
|
|
|
;; Always produce relative
|
|
|
|
|
;; symlinks for Singularity (see
|
|
|
|
|
;; <https://bugs.gnu.org/34913>).
|
|
|
|
|
#:relative-symlinks?
|
|
|
|
|
(or relocatable?
|
|
|
|
|
(eq? 'squashfs pack-format))
|
|
|
|
|
|
2017-01-18 23:21:29 +01:00
|
|
|
|
#:hooks (if bootstrap?
|
|
|
|
|
'()
|
|
|
|
|
%default-profile-hooks)
|
|
|
|
|
#:locales? (not bootstrap?)
|
|
|
|
|
#:target target))
|
|
|
|
|
(drv (build-image name profile
|
|
|
|
|
#:target
|
|
|
|
|
target
|
|
|
|
|
#:compressor
|
|
|
|
|
compressor
|
|
|
|
|
#:symlinks
|
|
|
|
|
symlinks
|
|
|
|
|
#:localstatedir?
|
|
|
|
|
localstatedir?
|
2019-06-04 18:43:23 +02:00
|
|
|
|
#:entry-point
|
|
|
|
|
entry-point
|
2018-10-20 19:28:05 +02:00
|
|
|
|
#:profile-name
|
|
|
|
|
profile-name
|
2017-01-18 23:21:29 +01:00
|
|
|
|
#:archiver
|
|
|
|
|
archiver)))
|
|
|
|
|
(mbegin %store-monad
|
|
|
|
|
(show-what-to-build* (list drv)
|
|
|
|
|
#:use-substitutes?
|
|
|
|
|
(assoc-ref opts 'substitutes?)
|
|
|
|
|
#:dry-run? dry-run?)
|
|
|
|
|
(munless dry-run?
|
|
|
|
|
(built-derivations (list drv))
|
2019-05-21 14:33:51 +02:00
|
|
|
|
(mwhen gc-root
|
|
|
|
|
(register-root* (match (derivation->output-paths drv)
|
|
|
|
|
(((names . items) ...)
|
|
|
|
|
items))
|
|
|
|
|
gc-root))
|
2017-01-18 23:21:29 +01:00
|
|
|
|
(return (format #t "~a~%"
|
|
|
|
|
(derivation->output-path drv))))))
|
|
|
|
|
#:system (assoc-ref opts 'system))))))))
|