projects/guix·blob python-team · refs

102 lines · 3.3 KiB

1# GNU Guix --- Functional package management for GNU
2# Copyright © 2022 Ludovic Courtès <[email protected]>
3# Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
4#
5# This file is part of GNU Guix.
6#
7# GNU Guix is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3 of the License, or (at
10# your option) any later version.
11#
12# GNU Guix is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20#
21# Test 'guix shell --export-manifest'.
22#
23
24guix shell --version
25
26tmpdir="t-guix-manifest-$$"
27trap 'rm -r "$tmpdir"' EXIT
28mkdir "$tmpdir"
29
30manifest="$tmpdir/manifest.scm"
31
32# Basics.
33guix shell --export-manifest guile-bootstrap > "$manifest"
34test "$(guix build -m "$manifest")" = "$(guix build guile-bootstrap)"
35
36guix shell -m "$manifest" --bootstrap -- \
37 "$SHELL" -c 'guix package --export-manifest -p "$GUIX_ENVIRONMENT"' > \
38 "$manifest.second"
39for m in "$manifest" "$manifest.second"
40do
41 grep -v '^;' < "$m" > "$m.new" # filter out comments
42 mv "$m.new" "$m"
43done
44
45cat "$manifest"
46cat "$manifest.second"
47
48cmp "$manifest" "$manifest.second"
49
50# Manifest for a profile.
51guix shell --bootstrap guile-bootstrap -r "$tmpdir/profile" -- \
52 guile --version
53test -x "$tmpdir/profile/bin/guile"
54guix shell -p "$tmpdir/profile" --export-manifest > "$manifest.second"
55guix shell --export-manifest guile-bootstrap > "$manifest"
56cat "$manifest.second"
57cmp "$manifest" "$manifest.second"
58
59rm "$tmpdir/profile"
60
61# Combining manifests.
62guix shell --export-manifest -m "$manifest" gash gash-utils \
63 > "$manifest.second"
64guix build -m "$manifest.second" -d | \
65 grep "$(guix build guile-bootstrap -d)"
66guix build -m "$manifest.second" -d | \
67 grep "$(guix build gash -d)"
68
69# Package transformation option.
70guix shell --export-manifest guile guix \
71 --with-input=guile-json@3=guile-json > "$manifest"
72grep 'options->transformation' "$manifest"
73grep '(with-input . "guile-json@3=guile-json")' "$manifest"
74
75# Development manifest.
76guix shell --export-manifest -D guile git > "$manifest"
77grep 'package->development-manifest' "$manifest"
78grep '"guile"' "$manifest"
79guix build -m "$manifest" -d | \
80 grep "$(guix build -e '(@@ (gnu packages commencement) gcc-final)' -d)"
81guix build -m "$manifest" -d | \
82 grep "$(guix build git -d)"
83
84guix shell --export-manifest -D guile -D python-itsdangerous > "$manifest"
85guix build -m "$manifest" -d | grep "$(guix build libffi -d)"
86guix build -m "$manifest" -d | \
87 grep "$(guix build -e '(@ (gnu packages python) python-sans-pip-wrapper)' -d)"
88
89# Test various combinations to make sure generated code uses interfaces
90# correctly.
91for options in \
92 "coreutils grep sed" \
93 "gsl openblas gcc-toolchain --tune" \
94 "guile -m $manifest.previous" \
95 "git:send-email gdb guile:debug" \
96 "git -D coreutils"
97do
98 guix shell --export-manifest $options > "$manifest"
99 cat "$manifest"
100 guix shell -m "$manifest" -n
101 mv "$manifest" "$manifest.previous"
102done