2013-01-05 23:47:50 +00:00
|
|
|
# GNU Guix --- Functional package management for GNU
|
2019-02-03 21:10:06 +00:00
|
|
|
# Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
2012-10-31 22:27:51 +00:00
|
|
|
#
|
2013-01-05 23:47:50 +00:00
|
|
|
# This file is part of GNU Guix.
|
2012-10-31 22:27:51 +00:00
|
|
|
#
|
2013-01-05 23:47:50 +00:00
|
|
|
# GNU Guix is free software; you can redistribute it and/or modify it
|
2012-10-31 22:27:51 +00:00
|
|
|
# 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.
|
|
|
|
#
|
2013-01-05 23:47:50 +00:00
|
|
|
# GNU Guix is distributed in the hope that it will be useful, but
|
2012-10-31 22:27:51 +00:00
|
|
|
# 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
|
2013-01-05 23:47:50 +00:00
|
|
|
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
2012-10-31 22:27:51 +00:00
|
|
|
|
|
|
|
#
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
# Test the `guix build' command-line utility.
|
2012-10-31 22:27:51 +00:00
|
|
|
#
|
|
|
|
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
guix build --version
|
2012-10-31 22:27:51 +00:00
|
|
|
|
|
|
|
# Should fail.
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
if guix build -e +;
|
2012-11-07 22:41:59 +00:00
|
|
|
then false; else true; fi
|
|
|
|
|
2016-10-03 13:24:21 +00:00
|
|
|
# Source-less packages are accepted; they just return nothing.
|
|
|
|
guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S
|
|
|
|
test "`guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S`" = ""
|
2012-10-31 22:27:51 +00:00
|
|
|
|
|
|
|
# Should pass.
|
2014-08-26 22:26:47 +00:00
|
|
|
guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' | \
|
2012-10-31 22:27:51 +00:00
|
|
|
grep -e '-guile-'
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
guix build hello -d | \
|
2012-10-31 22:27:51 +00:00
|
|
|
grep -e '-hello-[0-9\.]\+\.drv$'
|
|
|
|
|
2017-04-21 09:39:49 +00:00
|
|
|
# Passing a URI.
|
2019-02-03 21:10:06 +00:00
|
|
|
GUIX_DAEMON_SOCKET="file://$GUIX_STATE_DIRECTORY/daemon-socket/socket" \
|
2017-04-21 09:39:49 +00:00
|
|
|
guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
|
|
|
|
|
|
|
|
( if GUIX_DAEMON_SOCKET="weird://uri" \
|
|
|
|
guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'; \
|
|
|
|
then exit 1; fi )
|
|
|
|
|
2019-04-19 13:18:20 +00:00
|
|
|
# Passing one '-s' flag.
|
|
|
|
test `guix build sed -s x86_64-linux -d | wc -l` = 1
|
|
|
|
|
|
|
|
# Passing multiple '-s' flags.
|
|
|
|
all_systems="-s x86_64-linux -s i686-linux -s armhf-linux -s aarch64-linux"
|
|
|
|
test `guix build sed $all_systems -d | sort -u | wc -l` = 4
|
|
|
|
|
2015-01-28 19:33:28 +00:00
|
|
|
# Check --sources option with its arguments
|
|
|
|
module_dir="t-guix-build-$$"
|
|
|
|
mkdir "$module_dir"
|
|
|
|
trap "rm -rf $module_dir" EXIT
|
|
|
|
|
|
|
|
cat > "$module_dir/foo.scm"<<EOF
|
|
|
|
(define-module (foo)
|
2016-03-02 22:57:23 +00:00
|
|
|
#:use-module (guix tests)
|
2015-01-28 19:33:28 +00:00
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix build-system trivial))
|
|
|
|
|
|
|
|
(define-public foo
|
|
|
|
(package
|
|
|
|
(name "foo")
|
|
|
|
(version "42")
|
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri "http://www.example.com/foo.tar.gz")
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"))))
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
(inputs
|
|
|
|
(quasiquote (("bar" ,bar))))
|
|
|
|
(home-page "www.example.com")
|
|
|
|
(synopsis "Dummy package")
|
|
|
|
(description "foo is a dummy package for testing.")
|
|
|
|
(license #f)))
|
|
|
|
|
|
|
|
(define-public bar
|
|
|
|
(package
|
|
|
|
(name "bar")
|
|
|
|
(version "9001")
|
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri "http://www.example.com/bar.tar.gz")
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"))))
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
(inputs
|
|
|
|
(quasiquote
|
|
|
|
(("data" ,(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri "http://www.example.com/bar.dat")
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz")))))))
|
|
|
|
(home-page "www.example.com")
|
|
|
|
(synopsis "Dummy package")
|
|
|
|
(description "bar is a dummy package for testing.")
|
|
|
|
(license #f)))
|
2016-03-02 22:57:23 +00:00
|
|
|
|
|
|
|
(define-public baz
|
|
|
|
(dummy-package "baz" (replacement foo)))
|
|
|
|
|
2016-09-06 21:14:07 +00:00
|
|
|
(define-public superseded
|
|
|
|
(deprecated-package "superseded" bar))
|
|
|
|
|
2015-01-28 19:33:28 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
GUIX_PACKAGE_PATH="$module_dir"
|
|
|
|
export GUIX_PACKAGE_PATH
|
|
|
|
|
|
|
|
# foo.tar.gz
|
|
|
|
guix build -d -S foo
|
|
|
|
guix build -d -S foo | grep -e 'foo\.tar\.gz'
|
|
|
|
|
2016-03-02 22:57:23 +00:00
|
|
|
# 'baz' has a replacement so we should be getting the replacement's source.
|
|
|
|
(unset GUIX_BUILD_OPTIONS;
|
|
|
|
test "`guix build -d -S baz`" = "`guix build -d -S foo`")
|
|
|
|
|
2015-01-28 19:33:28 +00:00
|
|
|
guix build -d --sources=package foo
|
|
|
|
guix build -d --sources=package foo | grep -e 'foo\.tar\.gz'
|
|
|
|
|
|
|
|
# bar.tar.gz and bar.dat
|
|
|
|
guix build -d --sources bar
|
|
|
|
test `guix build -d --sources bar \
|
|
|
|
| grep -e 'bar\.tar\.gz' -e 'bar\.dat' \
|
|
|
|
| wc -l` -eq 2
|
|
|
|
|
|
|
|
# bar.tar.gz and bar.dat
|
|
|
|
guix build -d --sources=all bar
|
|
|
|
test `guix build -d --sources bar \
|
|
|
|
| grep -e 'bar\.tar\.gz' -e 'bar\.dat' \
|
|
|
|
| wc -l` -eq 2
|
|
|
|
|
|
|
|
# Should include foo.tar.gz, bar.tar.gz, and bar.dat
|
|
|
|
guix build -d --sources=transitive foo
|
|
|
|
test `guix build -d --sources=transitive foo \
|
|
|
|
| grep -e 'foo\.tar\.gz' -e 'bar\.tar\.gz' -e 'bar\.dat' \
|
|
|
|
| wc -l` -eq 3
|
|
|
|
|
2018-05-04 13:05:05 +00:00
|
|
|
|
|
|
|
# Unbound variables.
|
|
|
|
cat > "$module_dir/foo.scm"<<EOF
|
|
|
|
(define-module (foo)
|
|
|
|
#:use-module (guix tests)
|
|
|
|
#:use-module (guix build-system trivial))
|
|
|
|
|
|
|
|
(define-public foo
|
|
|
|
(dummy-package "package-with-something-wrong"
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
(inputs (quasiquote (("sed" ,sed)))))) ;unbound variable
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if guix build package-with-something-wrong -n; then false; else true; fi
|
|
|
|
guix build package-with-something-wrong -n 2> "$module_dir/err" || true
|
|
|
|
grep "unbound" "$module_dir/err" # actual error
|
|
|
|
grep "forget.*(gnu packages base)" "$module_dir/err" # hint
|
|
|
|
rm -f "$module_dir"/*
|
|
|
|
|
2013-11-12 00:06:25 +00:00
|
|
|
# Should all return valid log files.
|
2014-08-26 22:26:47 +00:00
|
|
|
drv="`guix build -d -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
|
|
|
|
out="`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
|
2013-11-12 00:06:25 +00:00
|
|
|
log="`guix build --log-file $drv`"
|
|
|
|
echo "$log" | grep log/.*guile.*drv
|
|
|
|
test -f "$log"
|
2014-08-26 22:26:47 +00:00
|
|
|
test "`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' --log-file`" \
|
2013-11-12 00:06:25 +00:00
|
|
|
= "$log"
|
|
|
|
test "`guix build --log-file guile-bootstrap`" = "$log"
|
|
|
|
test "`guix build --log-file $out`" = "$log"
|
|
|
|
|
2012-10-31 22:27:51 +00:00
|
|
|
# Should fail because the name/version combination could not be found.
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
if guix build hello-0.0.1 -n; then false; else true; fi
|
2012-10-31 22:27:51 +00:00
|
|
|
|
|
|
|
# Keep a symlink to the result, registered as a root.
|
|
|
|
result="t-result-$$"
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
guix build -r "$result" \
|
2014-08-26 22:26:47 +00:00
|
|
|
-e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
|
2012-10-31 22:27:51 +00:00
|
|
|
test -x "$result/bin/guile"
|
|
|
|
|
|
|
|
# Should fail, because $result already exists.
|
2014-08-26 22:26:47 +00:00
|
|
|
if guix build -r "$result" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
|
2012-10-31 22:27:51 +00:00
|
|
|
then false; else true; fi
|
|
|
|
|
|
|
|
rm -f "$result"
|
2013-01-22 21:13:10 +00:00
|
|
|
|
2019-04-15 14:57:12 +00:00
|
|
|
# Check relative file name canonicalization: <https://bugs.gnu.org/35271>.
|
|
|
|
mkdir "$result"
|
|
|
|
guix build -r "$result/x" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
|
|
|
|
test -x "$result/x/bin/guile"
|
|
|
|
rm "$result/x"
|
|
|
|
rmdir "$result"
|
|
|
|
|
2013-05-24 20:52:52 +00:00
|
|
|
# Cross building.
|
|
|
|
guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes
|
|
|
|
|
2016-01-31 22:22:18 +00:00
|
|
|
# Replacements.
|
2017-03-19 16:30:44 +00:00
|
|
|
drv1=`guix build guix --with-input=guile@2.0=guile@2.2 -d`
|
2016-01-31 22:22:18 +00:00
|
|
|
drv2=`guix build guix -d`
|
|
|
|
test "$drv1" != "$drv2"
|
|
|
|
|
|
|
|
drv1=`guix build guile -d`
|
|
|
|
drv2=`guix build guile --with-input=gimp=ruby -d`
|
|
|
|
test "$drv1" = "$drv2"
|
|
|
|
|
|
|
|
if guix build guile --with-input=libunistring=something-really-silly
|
|
|
|
then false; else true; fi
|
|
|
|
|
2016-09-06 21:14:07 +00:00
|
|
|
# Deprecated/superseded packages.
|
|
|
|
test "`guix build superseded -d`" = "`guix build bar -d`"
|
|
|
|
|
2013-01-22 21:13:10 +00:00
|
|
|
# Parsing package names and versions.
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
guix build -n time # PASS
|
2018-03-13 17:47:32 +00:00
|
|
|
guix build -n time@1.9 # PASS, version found
|
2016-02-28 22:11:36 +00:00
|
|
|
if guix build -n time@3.2; # FAIL, version not found
|
2013-01-22 21:13:10 +00:00
|
|
|
then false; else true; fi
|
Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.
* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
(MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
'guix/scripts/import.scm', 'guix/scripts/package.scm', and
'guix/scripts/gc.scm'.
* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build',
'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in
to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to
(guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in
usage help string.
* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
Export $GUIX_UNINSTALLED.
* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
"guix-COMMAND".
* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
"guix COMMAND".
* po/POTFILES.in: Update.
2013-02-14 09:15:25 +00:00
|
|
|
if guix build -n something-that-will-never-exist; # FAIL
|
2013-01-22 21:13:10 +00:00
|
|
|
then false; else true; fi
|
2013-11-18 22:08:20 +00:00
|
|
|
|
|
|
|
# Invoking a monadic procedure.
|
|
|
|
guix build -e "(begin
|
2014-04-27 21:19:11 +00:00
|
|
|
(use-modules (guix gexp))
|
2013-11-18 22:08:20 +00:00
|
|
|
(lambda ()
|
2014-04-27 21:19:11 +00:00
|
|
|
(gexp->derivation \"test\"
|
|
|
|
(gexp (mkdir (ungexp output))))))" \
|
2013-11-18 22:08:20 +00:00
|
|
|
--dry-run
|
2014-06-14 20:37:24 +00:00
|
|
|
|
|
|
|
# Running a gexp.
|
|
|
|
guix build -e '#~(mkdir #$output)' -d
|
|
|
|
guix build -e '#~(mkdir #$output)' -d | grep 'gexp\.drv'
|
2014-11-30 16:47:22 +00:00
|
|
|
|
2018-10-09 16:52:37 +00:00
|
|
|
# Same with a file-like object.
|
|
|
|
guix build -e '(computed-file "foo" #~(mkdir #$output))' -d
|
|
|
|
guix build -e '(computed-file "foo" #~(mkdir #$output))' -d | grep 'foo\.drv'
|
|
|
|
|
2015-10-26 22:09:28 +00:00
|
|
|
# Building from a package file.
|
|
|
|
cat > "$module_dir/package.scm"<<EOF
|
|
|
|
(use-modules (gnu))
|
|
|
|
(use-package-modules bootstrap)
|
|
|
|
|
|
|
|
%bootstrap-guile
|
|
|
|
EOF
|
|
|
|
guix build --file="$module_dir/package.scm"
|
|
|
|
|
|
|
|
# Building from a monadic procedure file.
|
|
|
|
cat > "$module_dir/proc.scm"<<EOF
|
|
|
|
(use-modules (guix gexp))
|
|
|
|
(lambda ()
|
|
|
|
(gexp->derivation "test"
|
|
|
|
(gexp (mkdir (ungexp output)))))
|
|
|
|
EOF
|
|
|
|
guix build --file="$module_dir/proc.scm" --dry-run
|
|
|
|
|
|
|
|
# Building from a gexp file.
|
|
|
|
cat > "$module_dir/gexp.scm"<<EOF
|
|
|
|
(use-modules (guix gexp))
|
|
|
|
|
|
|
|
(gexp (mkdir (ungexp output)))
|
|
|
|
EOF
|
|
|
|
guix build --file="$module_dir/gexp.scm" -d
|
|
|
|
guix build --file="$module_dir/gexp.scm" -d | grep 'gexp\.drv'
|
|
|
|
|
2014-11-30 16:47:22 +00:00
|
|
|
# Using 'GUIX_BUILD_OPTIONS'.
|
2016-03-02 13:44:18 +00:00
|
|
|
GUIX_BUILD_OPTIONS="--dry-run --no-grafts"
|
2014-11-30 16:47:22 +00:00
|
|
|
export GUIX_BUILD_OPTIONS
|
|
|
|
|
|
|
|
guix build emacs
|
|
|
|
|
|
|
|
GUIX_BUILD_OPTIONS="--something-completely-crazy"
|
|
|
|
if guix build emacs;
|
|
|
|
then false; else true; fi
|