2013-01-06 00:47:50 +01:00
|
|
|
# GNU Guix --- Functional package management for GNU
|
2017-03-19 17:30:44 +01:00
|
|
|
# Copyright © 2012, 2013, 2014, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
2012-10-31 23:27:51 +01:00
|
|
|
#
|
2013-01-06 00:47:50 +01:00
|
|
|
# This file is part of GNU Guix.
|
2012-10-31 23:27:51 +01:00
|
|
|
#
|
2013-01-06 00:47:50 +01:00
|
|
|
# GNU Guix is free software; you can redistribute it and/or modify it
|
2012-10-31 23:27:51 +01: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-06 00:47:50 +01:00
|
|
|
# GNU Guix is distributed in the hope that it will be useful, but
|
2012-10-31 23:27:51 +01: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-06 00:47:50 +01:00
|
|
|
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
2012-10-31 23:27:51 +01: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 10:15:25 +01:00
|
|
|
# Test the `guix build' command-line utility.
|
2012-10-31 23:27:51 +01: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 10:15:25 +01:00
|
|
|
guix build --version
|
2012-10-31 23:27:51 +01: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 10:15:25 +01:00
|
|
|
if guix build -e +;
|
2012-11-07 23:41:59 +01:00
|
|
|
then false; else true; fi
|
|
|
|
|
2016-10-03 15:24:21 +02: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 23:27:51 +01:00
|
|
|
|
|
|
|
# Should pass.
|
2014-08-27 00:26:47 +02:00
|
|
|
guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' | \
|
2012-10-31 23:27:51 +01: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 10:15:25 +01:00
|
|
|
guix build hello -d | \
|
2012-10-31 23:27:51 +01:00
|
|
|
grep -e '-hello-[0-9\.]\+\.drv$'
|
|
|
|
|
2017-04-21 11:39:49 +02:00
|
|
|
# Passing a URI.
|
|
|
|
GUIX_DAEMON_SOCKET="file://$NIX_STATE_DIR/daemon-socket/socket" \
|
|
|
|
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 )
|
|
|
|
|
2015-01-28 20:33:28 +01: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 23:57:23 +01:00
|
|
|
#:use-module (guix tests)
|
2015-01-28 20:33:28 +01: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 23:57:23 +01:00
|
|
|
|
|
|
|
(define-public baz
|
|
|
|
(dummy-package "baz" (replacement foo)))
|
|
|
|
|
2016-09-06 23:14:07 +02:00
|
|
|
(define-public superseded
|
|
|
|
(deprecated-package "superseded" bar))
|
|
|
|
|
2015-01-28 20:33:28 +01: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 23:57:23 +01: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 20:33:28 +01: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
|
|
|
|
|
2013-11-12 01:06:25 +01:00
|
|
|
# Should all return valid log files.
|
2014-08-27 00:26:47 +02:00
|
|
|
drv="`guix build -d -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
|
|
|
|
out="`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
|
2013-11-12 01:06:25 +01:00
|
|
|
log="`guix build --log-file $drv`"
|
|
|
|
echo "$log" | grep log/.*guile.*drv
|
|
|
|
test -f "$log"
|
2014-08-27 00:26:47 +02:00
|
|
|
test "`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' --log-file`" \
|
2013-11-12 01:06:25 +01:00
|
|
|
= "$log"
|
|
|
|
test "`guix build --log-file guile-bootstrap`" = "$log"
|
|
|
|
test "`guix build --log-file $out`" = "$log"
|
|
|
|
|
2012-10-31 23:27:51 +01: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 10:15:25 +01:00
|
|
|
if guix build hello-0.0.1 -n; then false; else true; fi
|
2012-10-31 23:27:51 +01: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 10:15:25 +01:00
|
|
|
guix build -r "$result" \
|
2014-08-27 00:26:47 +02:00
|
|
|
-e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
|
2012-10-31 23:27:51 +01:00
|
|
|
test -x "$result/bin/guile"
|
|
|
|
|
|
|
|
# Should fail, because $result already exists.
|
2014-08-27 00:26:47 +02:00
|
|
|
if guix build -r "$result" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
|
2012-10-31 23:27:51 +01:00
|
|
|
then false; else true; fi
|
|
|
|
|
|
|
|
rm -f "$result"
|
2013-01-22 22:13:10 +01:00
|
|
|
|
2013-05-24 22:52:52 +02:00
|
|
|
# Cross building.
|
|
|
|
guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes
|
|
|
|
|
2016-01-31 23:22:18 +01:00
|
|
|
# Replacements.
|
2017-03-19 17:30:44 +01:00
|
|
|
drv1=`guix build guix --with-input=guile@2.0=guile@2.2 -d`
|
2016-01-31 23:22:18 +01: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 23:14:07 +02:00
|
|
|
# Deprecated/superseded packages.
|
|
|
|
test "`guix build superseded -d`" = "`guix build bar -d`"
|
|
|
|
|
2013-01-22 22:13:10 +01: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 10:15:25 +01:00
|
|
|
guix build -n time # PASS
|
2016-02-28 23:11:36 +01:00
|
|
|
guix build -n time@1.7 # PASS, version found
|
2016-03-08 11:38:46 +01:00
|
|
|
guix build -n time-1.7 # PASS, deprecated version syntax
|
2016-02-28 23:11:36 +01:00
|
|
|
if guix build -n time@3.2; # FAIL, version not found
|
2013-01-22 22:13:10 +01: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 10:15:25 +01:00
|
|
|
if guix build -n something-that-will-never-exist; # FAIL
|
2013-01-22 22:13:10 +01:00
|
|
|
then false; else true; fi
|
2013-11-18 23:08:20 +01:00
|
|
|
|
|
|
|
# Invoking a monadic procedure.
|
|
|
|
guix build -e "(begin
|
2014-04-27 23:19:11 +02:00
|
|
|
(use-modules (guix gexp))
|
2013-11-18 23:08:20 +01:00
|
|
|
(lambda ()
|
2014-04-27 23:19:11 +02:00
|
|
|
(gexp->derivation \"test\"
|
|
|
|
(gexp (mkdir (ungexp output))))))" \
|
2013-11-18 23:08:20 +01:00
|
|
|
--dry-run
|
2014-06-14 22:37:24 +02:00
|
|
|
|
|
|
|
# Running a gexp.
|
|
|
|
guix build -e '#~(mkdir #$output)' -d
|
|
|
|
guix build -e '#~(mkdir #$output)' -d | grep 'gexp\.drv'
|
2014-11-30 17:47:22 +01:00
|
|
|
|
2015-10-26 23:09:28 +01: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 17:47:22 +01:00
|
|
|
# Using 'GUIX_BUILD_OPTIONS'.
|
2016-03-02 14:44:18 +01:00
|
|
|
GUIX_BUILD_OPTIONS="--dry-run --no-grafts"
|
2014-11-30 17:47:22 +01:00
|
|
|
export GUIX_BUILD_OPTIONS
|
|
|
|
|
|
|
|
guix build emacs
|
|
|
|
|
|
|
|
GUIX_BUILD_OPTIONS="--something-completely-crazy"
|
|
|
|
if guix build emacs;
|
|
|
|
then false; else true; fi
|