| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | |
| 24 | |
| 25 | |
| 26 |
|
| 27 | guix package --version
|
| 28 |
|
| 29 | readlink_base ()
|
| 30 | {
|
| 31 | basename `readlink "$1"`
|
| 32 | }
|
| 33 |
|
| 34 | module_dir="t-guix-package-$$"
|
| 35 | profile="t-profile-$$"
|
| 36 | tmpfile="t-guix-package-file-$$"
|
| 37 | rm -f "$profile" "$tmpfile"
|
| 38 |
|
| 39 | trap 'rm -f "$profile" "$profile.lock" "$profile-"[0-9]* "$tmpfile"; rm -rf "$module_dir" t-home-'"$$" EXIT
|
| 40 |
|
| 41 | |
| 42 | guix package --bootstrap -e + && false
|
| 43 |
|
| 44 | |
| 45 | |
| 46 | guix package --bootstrap -p "$profile" -i `guix build guile-bootstrap`
|
| 47 | test "`guix package -A guile-bootstrap | cut -f 1-2`" \
|
| 48 | = "`guix package -p "$profile" -I | cut -f 1-2`"
|
| 49 | test "`guix package -p "$profile" -I | cut -f 3`" = "out"
|
| 50 | rm "$profile"
|
| 51 |
|
| 52 | guix package --bootstrap -p "$profile" -i guile-bootstrap
|
| 53 | test -L "$profile" && test -L "$profile-1-link"
|
| 54 | test -f "$profile/bin/guile"
|
| 55 |
|
| 56 | |
| 57 | guix gc --list-live | grep "`readlink "$profile-1-link"`"
|
| 58 |
|
| 59 | |
| 60 | guix package --bootstrap -p "$profile" -i guile-bootstrap
|
| 61 | test -L "$profile" && test -L "$profile-1-link"
|
| 62 | test ! -f "$profile-2-link"
|
| 63 | test -f "$profile/bin/guile"
|
| 64 |
|
| 65 | |
| 66 | guix package -e '(begin (use-modules (guix) (gnu packages base)) (package (inherit sed) (supported-systems (list))))' -n && false
|
| 67 | case $(uname -m) in
|
| 68 | x86_64|i[3456]86)
|
| 69 | guix package -i novena-eeprom -n && false
|
| 70 | break;;
|
| 71 | *)
|
| 72 | guix package -i intelmetool -n && false
|
| 73 | break;;
|
| 74 | esac
|
| 75 |
|
| 76 | |
| 77 | |
| 78 | guix package --bootstrap -n -p "$profile" -i g-wrap [email protected] && false
|
| 79 |
|
| 80 | guix package --bootstrap -n -p "$profile" -i g-wrap [email protected] \
|
| 81 | --allow-collisions
|
| 82 |
|
| 83 | |
| 84 | guix package -p "$profile" --search-paths
|
| 85 | guix package -p "$profile" --search-paths | grep '^export PATH='
|
| 86 | test "`guix package -p "$profile" --search-paths | wc -l`" = 1 |
| 87 | ( set -e; set -x; \
|
| 88 | eval `guix package --search-paths=prefix -p "$PWD/$profile"`; \
|
| 89 | test "`type -P guile`" = "$PWD/$profile/bin/guile" ; \
|
| 90 | type -P rm )
|
| 91 |
|
| 92 | |
| 93 | guix package -p "$profile" --delete-generations=42 && false
|
| 94 |
|
| 95 | |
| 96 | guix package -p "$profile" --delete-generations=0
|
| 97 |
|
| 98 | |
| 99 | guix package --bootstrap -i guile zile -p "$profile" -n
|
| 100 |
|
| 101 | |
| 102 | guix package --bootstrap -i "glibc:debug" -p "$profile" -n
|
| 103 |
|
| 104 | |
| 105 | guix package --bootstrap -i "guile-bootstrap:out" -p "$profile" -n
|
| 106 | guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" -n && false
|
| 107 | guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile" && false
|
| 108 |
|
| 109 | |
| 110 | |
| 111 | guix package --bootstrap -r something-not-installed -p "$profile" && false
|
| 112 |
|
| 113 | |
| 114 | guix package -p "$profile" -A 'gui.*e' | grep guile
|
| 115 |
|
| 116 | |
| 117 | guix package --show=guile | grep "^name: guile"
|
| 118 |
|
| 119 | |
| 120 | guix package --show=tzdata
|
| 121 |
|
| 122 | |
| 123 | guix package --show=does-not-exist && false
|
| 124 | guix package --show=emacs@42 && false
|
| 125 |
|
| 126 | |
| 127 | LC_MESSAGES=C
|
| 128 | export LC_MESSAGES
|
| 129 | test "`guix package -s "Example GNU package" | grep ^name:`" = \
|
| 130 | "name: hello"
|
| 131 | test -z "`guix package -s "n0t4r341p4ck4g3"`"
|
| 132 |
|
| 133 | |
| 134 | |
| 135 | guix package -s '\<board\>' > "$tmpfile"
|
| 136 | grep '^name: pcb' "$tmpfile"
|
| 137 | grep '^name: gnubg' "$tmpfile"
|
| 138 |
|
| 139 | |
| 140 | guix package -s '\<board\>' -s game > "$tmpfile"
|
| 141 | grep -v '^name: pcb' "$tmpfile" > /dev/null
|
| 142 | grep '^name: gnubg' "$tmpfile"
|
| 143 |
|
| 144 | rm -f "$tmpfile"
|
| 145 |
|
| 146 | |
| 147 | mkdir "$module_dir"
|
| 148 | cat > "$module_dir/foo.scm"<<EOF
|
| 149 | (define-module (foo)
|
| 150 | #:use-module (guix packages)
|
| 151 | #:use-module (gnu packages base))
|
| 152 |
|
| 153 | (define-public deprecated
|
| 154 | (deprecated-package "fileutils-is-the-old-name" coreutils))
|
| 155 | EOF
|
| 156 |
|
| 157 | guix build -L "$module_dir" -e '(@ (foo) deprecated)' -n
|
| 158 | test "`guix package -L "$module_dir" -s ^fileutils-is-the-old-name$ | grep ^name:`" = ""
|
| 159 |
|
| 160 | rm -rf "$module_dir"
|
| 161 |
|
| 162 | |
| 163 | guix package --search="" > /dev/null
|
| 164 |
|
| 165 | |
| 166 | |
| 167 | generation="`readlink_base "$profile"`"
|
| 168 | guix package -p "$profile" --delete-generations=12m && false
|
| 169 | test "`readlink_base "$profile"`" = "$generation"
|
| 170 |
|
| 171 | |
| 172 | |
| 173 | |
| 174 | guix package --list-generations -p "$profile"
|
| 175 | guix package --bootstrap -p "$profile" --delete-generations=1.. && false
|
| 176 | test "`readlink_base "$profile"`" = "$generation"
|
| 177 |
|
| 178 | |
| 179 | real_profile="`readlink -f "$profile"`"
|
| 180 | guix gc -d "$real_profile" && false
|
| 181 | test -d "$real_profile"
|
| 182 |
|
| 183 | |
| 184 | |
| 185 | rm "$profile" "$profile"-[0-9]-link
|
| 186 | guix gc -d "$real_profile"
|
| 187 | [ ! -d "$real_profile" ]
|
| 188 |
|
| 189 | |
| 190 |
|
| 191 | |
| 192 | mkdir "$module_dir"
|
| 193 | emacs_tarball="$module_dir/emacs-42.5.9rc7.tar.gz"
|
| 194 | touch "$emacs_tarball"
|
| 195 | guix package -p "$profile" -i emacs --with-source="$emacs_tarball" -n \
|
| 196 | 2> "$tmpfile"
|
| 197 | grep -E 'emacs[[:blank:]]+42\.5\.9rc7' "$tmpfile"
|
| 198 | rm "$emacs_tarball" "$tmpfile"
|
| 199 | rmdir "$module_dir"
|
| 200 |
|
| 201 | |
| 202 | guix install --bootstrap -p "$profile" sed --with-input=sed=guile-bootstrap
|
| 203 | grep "sed=guile-bootstrap" "$profile/manifest"
|
| 204 | test "$(readlink -f "$profile/bin/guile")" \
|
| 205 | = "$(guix build guile-bootstrap)/bin/guile"
|
| 206 | test ! -f "$profile/bin/sed"
|
| 207 |
|
| 208 | |
| 209 | guix package --bootstrap -p "$profile" -u
|
| 210 | grep "sed=guile-bootstrap" "$profile/manifest"
|
| 211 | test "$(readlink -f "$profile/bin/guile")" \
|
| 212 | = "$(guix build guile-bootstrap)/bin/guile"
|
| 213 | test ! -f "$profile/bin/sed"
|
| 214 | rm "$profile" "$profile"-[0-9]-link
|
| 215 |
|
| 216 | |
| 217 | |
| 218 | |
| 219 | mkdir "$module_dir"
|
| 220 | cat > "$module_dir/test.scm" <<EOF
|
| 221 | (define-module (test)
|
| 222 | #:use-module (guix packages)
|
| 223 | #:use-module (gnu packages base)
|
| 224 | #:use-module (guix build-system trivial))
|
| 225 |
|
| 226 | (define-public dummy-package
|
| 227 | (package
|
| 228 | (name "dummy-package")
|
| 229 | (version "1")
|
| 230 | (source #f)
|
| 231 | (build-system trivial-build-system)
|
| 232 | (propagated-inputs
|
| 233 | (list hello))
|
| 234 | (synopsis "dummy")
|
| 235 | (description "dummy")
|
| 236 | (home-page "dummy")
|
| 237 | (license #f)))
|
| 238 | EOF
|
| 239 | guix package -p "$profile" -L "$module_dir"\
|
| 240 | -i hello dummy-package \
|
| 241 | --without-tests=hello -n
|
| 242 | rm "$module_dir/test.scm"
|
| 243 | rmdir "$module_dir"
|
| 244 |
|
| 245 | |
| 246 | |
| 247 | |
| 248 | mkdir -p "$module_dir/foo"
|
| 249 | ( cd "$module_dir" ; \
|
| 250 | guix package --bootstrap -i guile-bootstrap -p foo/prof )
|
| 251 | test -f "$module_dir/foo/prof/bin/guile"
|
| 252 | rm "$module_dir/foo"/*
|
| 253 | rmdir "$module_dir/foo"
|
| 254 | rmdir "$module_dir"
|
| 255 |
|
| 256 | |
| 257 | |
| 258 | |
| 259 |
|
| 260 | XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
| 261 | export XDG_CACHE_HOME
|
| 262 | HOME="$PWD/t-home-$$"
|
| 263 | export HOME
|
| 264 |
|
| 265 | mkdir -p "$HOME"
|
| 266 |
|
| 267 | |
| 268 | HOME="`cd $HOME; pwd -P`"
|
| 269 |
|
| 270 | guix package --bootstrap -i guile-bootstrap
|
| 271 | test -L "$HOME/.guix-profile"
|
| 272 | test -f "$HOME/.guix-profile/bin/guile"
|
| 273 |
|
| 274 | |
| 275 | default_profile="`readlink "$HOME/.guix-profile"`"
|
| 276 | for i in `seq 1 3`
|
| 277 | do
|
| 278 | |
| 279 | profile_link="`readlink "$default_profile"`"
|
| 280 | guix gc --list-live | grep "`readlink "$profile_link"`"
|
| 281 |
|
| 282 | guix package --bootstrap --roll-back
|
| 283 | test ! -f "$HOME/.guix-profile/bin"
|
| 284 | test ! -f "$HOME/.guix-profile/lib"
|
| 285 | test "`readlink "$default_profile"`" = "`basename $default_profile-0-link`"
|
| 286 | done
|
| 287 |
|
| 288 | |
| 289 | |
| 290 | test ! -e "$HOME/.guix-profile-0-link"
|
| 291 | test ! -e "$HOME/.guix-profile-1-link"
|
| 292 | guix package --bootstrap -p "$HOME/.guix-profile" -i guile-bootstrap
|
| 293 | test ! -e "$HOME/.guix-profile-1-link"
|
| 294 | guix package --bootstrap --roll-back -p "$HOME/.guix-profile"
|
| 295 | test ! -e "$HOME/.guix-profile-0-link"
|
| 296 |
|
| 297 | |
| 298 | guix package install foo-bar && false
|
| 299 |
|
| 300 | |
| 301 | |
| 302 | set -o pipefail || true
|
| 303 | guix package -A g | head -1 2> "$HOME/err1"
|
| 304 | guix package -I | head -1 2> "$HOME/err2"
|
| 305 | test "`cat "$HOME/err1" "$HOME/err2"`" = ""
|
| 306 |
|
| 307 | |
| 308 | mkdir "$module_dir"
|
| 309 |
|
| 310 | cat > "$module_dir/foo.scm"<<EOF
|
| 311 | (define-module (foo)
|
| 312 | #:use-module (guix packages)
|
| 313 | #:use-module (gnu packages emacs))
|
| 314 |
|
| 315 | (define-public x
|
| 316 | (package (inherit emacs)
|
| 317 | (name "emacs-foo-bar")
|
| 318 | (version "42.77.0")))
|
| 319 | EOF
|
| 320 |
|
| 321 | guix package -A emacs-foo-bar -L "$module_dir" | grep 42
|
| 322 | guix package -i emacs-foo-bar@42 -n -L "$module_dir"
|
| 323 |
|
| 324 | |
| 325 | GUIX_PACKAGE_PATH="$module_dir"
|
| 326 | export GUIX_PACKAGE_PATH
|
| 327 | guix package -A emacs-foo-bar | grep 42
|
| 328 | guix package -i emacs-foo-bar@42 -n
|
| 329 |
|
| 330 | |
| 331 | cat > "$module_dir/bar.scm"<<EOF
|
| 332 | (define-module (bar)
|
| 333 | #:use-module (guix packages))
|
| 334 |
|
| 335 | (define-public hello
|
| 336 | (package (inherit (@@ (gnu packages base) hello))
|
| 337 | (synopsis "an overridden version of GNU hello")))
|
| 338 | EOF
|
| 339 |
|
| 340 | guix package -i hello -n 2>&1 | grep choosing.*bar.scm
|
| 341 | ( unset GUIX_PACKAGE_PATH; \
|
| 342 | guix package -i hello -n -L "$module_dir" 2>&1 | grep choosing.*bar.scm )
|
| 343 |
|
| 344 | |
| 345 | cat > "$module_dir/emacs.patch"<<EOF
|
| 346 | This is a fake patch.
|
| 347 | EOF
|
| 348 | cat > "$module_dir/foo.scm"<<EOF
|
| 349 | (define-module (foo)
|
| 350 | #:use-module (guix packages)
|
| 351 | #:use-module (gnu packages)
|
| 352 | #:use-module (gnu packages emacs))
|
| 353 |
|
| 354 | (define-public x
|
| 355 | (package (inherit emacs)
|
| 356 | (source (origin (inherit (package-source emacs))
|
| 357 | (patches (list (search-patch "emacs.patch")))))
|
| 358 | (name "emacs-foo-bar-patched")
|
| 359 | (version "42.42.42")))
|
| 360 |
|
| 361 | (define-public y
|
| 362 | (package (inherit emacs)
|
| 363 | (name "super-non-portable-emacs")
|
| 364 | (supported-systems '("foobar64-hurd"))))
|
| 365 | EOF
|
| 366 | guix package -i emacs-foo-bar-patched -n
|
| 367 |
|
| 368 | |
| 369 | ( unset GUIX_PACKAGE_PATH; \
|
| 370 | guix package -L "$module_dir" -i emacs-foo-bar-patched -n )
|
| 371 |
|
| 372 | |
| 373 | cat > "$module_dir/package.scm"<<EOF
|
| 374 | (use-modules (gnu))
|
| 375 | (use-package-modules bootstrap)
|
| 376 |
|
| 377 | %bootstrap-guile
|
| 378 | EOF
|
| 379 | guix package --bootstrap --install-from-file="$module_dir/package.scm"
|
| 380 |
|
| 381 | |
| 382 | cat > "$module_dir/package.scm"<<EOF
|
| 383 | (use-modules (gnu packages base))
|
| 384 |
|
| 385 | (define my-package coreutils) ;returns *unspecified*
|
| 386 | EOF
|
| 387 | guix package --bootstrap --install-from-file="$module_dir/package.scm" && false
|
| 388 |
|
| 389 | rm "$module_dir/package.scm"
|
| 390 |
|
| 391 | |
| 392 | |
| 393 | test "`guix package -A super-non-portable-emacs`" = ""
|
| 394 | test "`guix package -s super-non-portable-emacs | grep ^systems:`" = "systems: "
|
| 395 |
|
| 396 | |
| 397 | guix package --bootstrap -p "$profile" -i guile-bootstrap
|
| 398 |
|
| 399 | cat > "$module_dir/foo.scm"<<EOF
|
| 400 | (define-module (foo)
|
| 401 | #:use-module (guix)
|
| 402 | #:use-module (gnu packages bootstrap))
|
| 403 |
|
| 404 | (define-public x
|
| 405 | (package (inherit %bootstrap-guile) (version "42")))
|
| 406 | EOF
|
| 407 |
|
| 408 | guix package --bootstrap -p "$profile" -r guile-bootstrap -u guile
|
| 409 | test ! -f "$profile/bin/guile"
|
| 410 | guix package --bootstrap -p "$profile" --roll-back
|
| 411 | test -f "$profile/bin/guile"
|
| 412 | rm "$profile-2-link"
|
| 413 |
|
| 414 | unset GUIX_PACKAGE_PATH
|
| 415 |
|
| 416 |
|
| 417 | |
| 418 | available="`guix package -A | sort`"
|
| 419 | GUIX_BUILD_OPTIONS="--dry-run --no-grafts"
|
| 420 | export GUIX_BUILD_OPTIONS
|
| 421 |
|
| 422 | |
| 423 | |
| 424 | available2="`guix package -A | sort`"
|
| 425 | test "$available2" = "$available"
|
| 426 | guix package -I
|
| 427 |
|
| 428 | |
| 429 | |
| 430 | GUIX_BUILD_OPTIONS="--no-grafts"
|
| 431 |
|
| 432 | |
| 433 | |
| 434 | guix package --bootstrap -i guile-bootstrap --without-tests=foo
|
| 435 | profile_directory="$(readlink -f "$default_profile")"
|
| 436 | guix package --export-manifest > "$tmpfile"
|
| 437 | grep 'without-tests.*foo' "$tmpfile"
|
| 438 | guix package --rollback --bootstrap
|
| 439 | guix package --bootstrap -m "$tmpfile"
|
| 440 | test "$(readlink -f "$default_profile")" = "$profile_directory"
|
| 441 | guix package --export-manifest > "$tmpfile.2nd"
|
| 442 | cmp "$tmpfile" "$tmpfile.2nd"
|
| 443 |
|
| 444 | rm -f "$tmpfile.2nd"
|
| 445 | guix package --rollback --bootstrap
|
| 446 |
|
| 447 | |
| 448 | cat > "$module_dir/manifest.scm"<<EOF
|
| 449 | (use-package-modules bootstrap)
|
| 450 |
|
| 451 | (packages->manifest (list %bootstrap-guile))
|
| 452 | EOF
|
| 453 | guix package --bootstrap -m "$module_dir/manifest.scm"
|
| 454 | guix package -I | grep guile
|
| 455 | test `guix package -I | wc -l` -eq 1
|
| 456 |
|
| 457 | |
| 458 | profile_directory="$(readlink -f "$default_profile")"
|
| 459 | guix package --export-manifest > "$tmpfile"
|
| 460 | guix package --rollback --bootstrap
|
| 461 | guix package --bootstrap -m "$tmpfile"
|
| 462 | test "$(readlink -f "$default_profile")" = "$profile_directory"
|
| 463 |
|
| 464 | guix package --rollback --bootstrap
|
| 465 |
|
| 466 | |
| 467 | cat > "$module_dir/manifest2.scm"<<EOF
|
| 468 | (use-modules (gnu packages bootstrap) (guix))
|
| 469 | (define p (package (inherit %bootstrap-guile) (name "eliug")))
|
| 470 | (packages->manifest (list p))
|
| 471 | EOF
|
| 472 | guix package --bootstrap \
|
| 473 | -m "$module_dir/manifest.scm" -m "$module_dir/manifest2.scm"
|
| 474 | guix package -I | grep guile
|
| 475 | guix package -I | grep eliug
|
| 476 | test `guix package -I | wc -l` -eq 2
|
| 477 | guix package --rollback --bootstrap
|
| 478 |
|
| 479 | |
| 480 | cat > "$module_dir/manifest.scm"<<EOF
|
| 481 | (use-modules (guix inferior))
|
| 482 |
|
| 483 | (define i
|
| 484 | (open-inferior "$abs_top_srcdir" #:command "scripts/guix"))
|
| 485 |
|
| 486 | (let ((guile (car (lookup-inferior-packages i "guile-bootstrap"))))
|
| 487 | (packages->manifest (list guile)))
|
| 488 | EOF
|
| 489 | guix package --bootstrap -m "$module_dir/manifest.scm"
|
| 490 | guix package -I | grep guile
|
| 491 | test `guix package -I | wc -l` -eq 1
|
| 492 |
|
| 493 | |
| 494 | cat > "$module_dir/manifest.scm"<<EOF
|
| 495 | (use-package-modules bootstrap)
|
| 496 | (packages->manifest
|
| 497 | (list %bootstrap-guile
|
| 498 | wonderful-package-that-does-not-exist))
|
| 499 | EOF
|
| 500 | if guix package --bootstrap -n -m "$module_dir/manifest.scm" \
|
| 501 | 2> "$module_dir/stderr"
|
| 502 | then false
|
| 503 | else
|
| 504 | cat "$module_dir/stderr"
|
| 505 | grep "manifest.scm:[1-4]:.*wonderful-package.*: unbound variable" \
|
| 506 | "$module_dir/stderr"
|
| 507 | fi
|
| 508 |
|
| 509 | |
| 510 | rm -rf "$module_dir"
|
| 511 | mkdir "$module_dir"
|
| 512 | cat > "$module_dir/foo.scm"<<EOF
|
| 513 | (define-module (foo)
|
| 514 | #:use-module (guix packages)
|
| 515 | #:use-module (guix build-system trivial))
|
| 516 |
|
| 517 | (define-public dummy-package
|
| 518 | (package
|
| 519 | (name "dummy-package")
|
| 520 | (version "dummy-version")
|
| 521 | (outputs '("out" "dummy-output"))
|
| 522 | (source #f)
|
| 523 | ;; Without a real build system, the "guix package -s" command will fail.
|
| 524 | (build-system trivial-build-system)
|
| 525 | (synopsis "dummy-synopsis")
|
| 526 | (description "dummy-description")
|
| 527 | (home-page "https://dummy-home-page")
|
| 528 | (license #f)))
|
| 529 | EOF
|
| 530 | guix package -L "$module_dir" -s dummy-output > /tmp/out
|
| 531 | test "`guix package -L "$module_dir" -s dummy-output | grep ^name:`" = "name: dummy-package"
|
| 532 | rm -rf "$module_dir"
|
| 533 |
|
| 534 | |
| 535 | guix package --list-profiles | grep "$profile"
|
| 536 | guix package --list-profiles | grep '\.guix-profile'
|
| 537 |
|
| 538 | |
| 539 | mkdir "$module_dir"
|
| 540 | echo "(open-output-file \"$module_dir/ready\") (sleep 60)" \
|
| 541 | > "$module_dir/manifest.scm"
|
| 542 | guix package -m "$module_dir/manifest.scm" -p "$module_dir/profile" &
|
| 543 | pid=$!
|
| 544 | while [ ! -f "$module_dir/ready" ] ; do sleep 0.5 ; done
|
| 545 | if guix install emacs -p "$module_dir/profile"; then kill $pid; false; else true; fi
|
| 546 | kill $pid
|