1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2022 Ludovic Courtès <ludo@gnu.org>
4 # This file is part of GNU Guix.
6 # GNU Guix is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or (at
9 # your option) any later version.
11 # GNU Guix is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 # Test 'guix shell --export-manifest'.
25 tmpdir
="t-guix-manifest-$$"
26 trap 'rm -r "$tmpdir"' EXIT
29 manifest
="$tmpdir/manifest.scm"
32 guix shell
--export-manifest guile-bootstrap
> "$manifest"
33 test "$(guix build -m "$manifest")" = "$(guix build guile-bootstrap)"
35 guix shell
-m "$manifest" --bootstrap -- \
36 "$SHELL" -c 'guix package --export-manifest -p "$GUIX_ENVIRONMENT"' > \
38 for m
in "$manifest" "$manifest.second"
40 grep -v '^;' < "$m" > "$m.new" # filter out comments
45 cat "$manifest.second"
47 cmp "$manifest" "$manifest.second"
49 # Combining manifests.
50 guix shell
--export-manifest -m "$manifest" gash gash-utils \
52 guix build
-m "$manifest.second" -d | \
53 grep "$(guix build guile-bootstrap -d)"
54 guix build
-m "$manifest.second" -d | \
55 grep "$(guix build gash -d)"
57 # Package transformation option.
58 guix shell
--export-manifest guile guix \
59 --with-input=guile-json@
3=guile-json
> "$manifest"
60 grep 'options->transformation' "$manifest"
61 grep '(with-input . "guile-json@3=guile-json")' "$manifest"
63 # Development manifest.
64 guix shell
--export-manifest -D guile git
> "$manifest"
65 grep 'package->development-manifest' "$manifest"
66 grep '"guile"' "$manifest"
67 guix build
-m "$manifest" -d | \
68 grep "$(guix build -e '(@@ (gnu packages commencement) gcc-final)' -d)"
69 guix build
-m "$manifest" -d | \
70 grep "$(guix build git -d)"
72 # Test various combinations to make sure generated code uses interfaces
75 "coreutils grep sed" \
76 "gsl openblas gcc-toolchain --tune" \
77 "guile -m $manifest.previous" \
78 "git:send-email gdb guile:debug" \
81 guix shell
--export-manifest $options > "$manifest"
83 guix shell
-m "$manifest" -n
84 mv "$manifest" "$manifest.previous"