Commit | Line | Data |
---|---|---|
c42b7baf LC |
1 | # GNU Guix --- Functional package management for GNU |
2 | # Copyright © 2022 Ludovic Courtès <ludo@gnu.org> | |
3 | # | |
4 | # This file is part of GNU Guix. | |
5 | # | |
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. | |
10 | # | |
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. | |
15 | # | |
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/>. | |
18 | ||
19 | # | |
20 | # Test 'guix shell --export-manifest'. | |
21 | # | |
22 | ||
23 | guix shell --version | |
24 | ||
25 | tmpdir="t-guix-manifest-$$" | |
26 | trap 'rm -r "$tmpdir"' EXIT | |
27 | mkdir "$tmpdir" | |
28 | ||
29 | manifest="$tmpdir/manifest.scm" | |
30 | ||
31 | # Basics. | |
32 | guix shell --export-manifest guile-bootstrap > "$manifest" | |
33 | test "$(guix build -m "$manifest")" = "$(guix build guile-bootstrap)" | |
34 | ||
35 | guix shell -m "$manifest" --bootstrap -- \ | |
36 | "$SHELL" -c 'guix package --export-manifest -p "$GUIX_ENVIRONMENT"' > \ | |
37 | "$manifest.second" | |
38 | for m in "$manifest" "$manifest.second" | |
39 | do | |
40 | grep -v '^;' < "$m" > "$m.new" # filter out comments | |
41 | mv "$m.new" "$m" | |
42 | done | |
43 | ||
44 | cat "$manifest" | |
45 | cat "$manifest.second" | |
46 | ||
47 | cmp "$manifest" "$manifest.second" | |
48 | ||
925a57c5 LC |
49 | # Manifest for a profile. |
50 | guix shell --bootstrap guile-bootstrap -r "$tmpdir/profile" -- \ | |
51 | guile --version | |
52 | test -x "$tmpdir/profile/bin/guile" | |
53 | guix shell -p "$tmpdir/profile" --export-manifest > "$manifest.second" | |
54 | guix shell --export-manifest guile-bootstrap > "$manifest" | |
55 | cat "$manifest.second" | |
56 | cmp "$manifest" "$manifest.second" | |
57 | ||
58 | rm "$tmpdir/profile" | |
59 | ||
c42b7baf LC |
60 | # Combining manifests. |
61 | guix shell --export-manifest -m "$manifest" gash gash-utils \ | |
62 | > "$manifest.second" | |
63 | guix build -m "$manifest.second" -d | \ | |
64 | grep "$(guix build guile-bootstrap -d)" | |
65 | guix build -m "$manifest.second" -d | \ | |
66 | grep "$(guix build gash -d)" | |
67 | ||
68 | # Package transformation option. | |
20691c70 LC |
69 | guix shell --export-manifest guile guix \ |
70 | --with-input=guile-json@3=guile-json > "$manifest" | |
c42b7baf | 71 | grep 'options->transformation' "$manifest" |
20691c70 | 72 | grep '(with-input . "guile-json@3=guile-json")' "$manifest" |
c42b7baf LC |
73 | |
74 | # Development manifest. | |
75 | guix shell --export-manifest -D guile git > "$manifest" | |
76 | grep 'package->development-manifest' "$manifest" | |
77 | grep '"guile"' "$manifest" | |
78 | guix build -m "$manifest" -d | \ | |
79 | grep "$(guix build -e '(@@ (gnu packages commencement) gcc-final)' -d)" | |
80 | guix build -m "$manifest" -d | \ | |
81 | grep "$(guix build git -d)" | |
82 | ||
2acc83da LC |
83 | guix shell --export-manifest -D guile -D python-itsdangerous > "$manifest" |
84 | guix build -m "$manifest" -d | grep "$(guix build libffi -d)" | |
85 | guix build -m "$manifest" -d | \ | |
86 | grep "$(guix build -e '(@ (gnu packages python) python)' -d)" | |
87 | ||
c42b7baf LC |
88 | # Test various combinations to make sure generated code uses interfaces |
89 | # correctly. | |
90 | for options in \ | |
91 | "coreutils grep sed" \ | |
92 | "gsl openblas gcc-toolchain --tune" \ | |
93 | "guile -m $manifest.previous" \ | |
94 | "git:send-email gdb guile:debug" \ | |
95 | "git -D coreutils" | |
96 | do | |
97 | guix shell --export-manifest $options > "$manifest" | |
98 | cat "$manifest" | |
99 | guix shell -m "$manifest" -n | |
100 | mv "$manifest" "$manifest.previous" | |
101 | done |