aboutsummaryrefslogtreecommitdiff
# GNU Guix --- Functional package management for GNU
# Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
# Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# 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.
#
# GNU Guix is distributed in the hope that it will be useful, but
# 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
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

#
# Test the `guix repl' command-line utility.
#

guix repl --version

test_directory="`mktemp -d`"
export test_directory
trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT

tmpfile="$test_directory/foo.scm"
rm -f "$tmpfile"
trap 'rm -f "$tmpfile"' EXIT

module_dir="t-guix-repl-$$"
mkdir "$module_dir"
trap 'rm -rf "$module_dir"' EXIT


cat > "$tmpfile"<<EOF
(use-modules (guix packages)
             (gnu packages base))

(format #t "~a\n" (package-name coreutils))
EOF

test "`guix repl "$tmpfile"`" = "coreutils"

# Make sure that the file can also be loaded when passed as a relative file
# name.
(cd "$(dirname "$tmpfile")"; test "$(guix repl "$(basename "$tmpfile")")" = "coreutils")


cat > "$module_dir/foo.scm"<<EOF
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (gnu packages base))

(define-public dummy
  (package (inherit hello)
    (name "dummy")
    (version "42")
    (synopsis "dummy package")
    (description "dummy package. Only used for testing purposes.")))
EOF

cat > "$tmpfile"<<EOF
(use-modules (guix packages)
             (foo))

(format #t "~a\n" (package-version dummy))
EOF

test "`guix repl "$tmpfile" -L "$module_dir"`" = "42"

cat > "$tmpfile"<<EOF
(format #t "~a\n" (cdr (command-line)))
EOF

test "`guix repl -- "$tmpfile" -a b --input=foo.txt`" = "(-a b --input=foo.txt)"

cat > "$tmpfile"<<EOF
#!$(type -P env) -S guix repl --
!#
(format #t "~a\n" (cdr (command-line)))
EOF
chmod 755 $tmpfile

test "`"$tmpfile" -a b --input=foo.txt`" = "(-a b --input=foo.txt)"
branch 'origin/master' into stagingEfraim Flashner 2019-01-07gnu: Fix top-level circular references between emacs.scm and llvm.scm....Previously, loading either of these two modules could fail somewhat non-deterministically because each top-level was referencing a variable defined by the other module's top-level. * gnu/packages/emacs.scm (package-elisp-from-package): Move to... * gnu/packages/llvm.scm (package-elisp-from-package): Here. Keep private. Ludovic Courtès 2019-01-07Revert "gnu: Use package-elisp-from-package for clangs emacs lisp files"...This reverts commit 5bc2e14add6433adbade3ccdf28c60e57334c20a. Pierre Neidhardt 2019-01-07gnu: Use package-elisp-from-package for clangs emacs lisp files...Use package-elisp-from-package for emacs-clang-format and emacs-clang-rename. Also remove package-from-clang-elisp-file as it is not needed anymore. * gnu/packages/llvm.scm (emacs-clang-format): Use package-elisp-from-package * gnu/packages/llvm.scm (emacs-clang-rename): Use package-elisp-from-package * gnu/packages/llvm.scm (package-from-clang-elisp-file): Remove function Tim Gesthuizen 2018-12-26Merge branch 'master' into stagingMarius Bakke 2018-12-25gnu: llvm@7.0.0: Update to 7.0.1....* gnu/packages/llvm.scm (llvm@7.0.0): Update to 7.0.1. Rename to llvm@7.0.1. Rutger Helling 2018-12-22Merge branch 'master' into stagingMarius Bakke 2018-12-13gnu: Add llvm@7.0.0....* gnu/packages/llvm.scm (llvm@7.0.0): New variable. Rutger Helling 2018-12-04gnu: mesa: Build against the regular LLVM package....* gnu/packages/gl.scm (mesa)[inputs]: Change LLVM-WITHOUT-RTTI to LLVM. * gnu/packages/llvm.scm (llvm-without-rtti): Remove variable. Marius Bakke 2018-11-29Merge branch 'master' into core-updatesMarius Bakke 2018-11-28gnu: clang-from-llvm: Fix install for clang-3.*....* gnu/packages/llvm.scm (clang-from-llvm): Fix install for clang-3.*. Pierre Neidhardt 2018-11-26gnu: clang-from-llvm: Clean up share/clang folder....* gnu/packages/llvm.scm (clang-from-llvm): Remove useless files, install completion. Pierre Neidhardt 2018-11-26gnu: Add emacs-clang-rename....* gnu/packages/llvm.scm (emacs-clang-rename): New variable. Pierre Neidhardt 2018-11-26gnu: emacs-clang-format: Inherit from clang....* gnu/packages/emacs.scm (emacs-clang-format): Remove. * gnu/packages/llvm.scm (emacs-clang-format): Add. Tim Gesthuizen 2018-11-20Merge branch 'master' into core-updatesMarius Bakke 2018-11-17gnu: mesa: Stay on RTTI-less LLVM....* gnu/packages/llvm.scm (llvm-without-rtti): New public variable. * gnu/packages/gl.scm (mesa)[inputs]: Use that instead of LLVM. Marius Bakke 2018-11-17llvm: Build with RTTI by default....Increases size of llvm@6 by 2.5MiB (2.5%), but saves building specialized llvm's with rtti enabled for packages that require RTTI when linking with the llvm libraries. * gnu/packages/llvm.scm (llvm-3.8-with-rtti): Remove variable. (llvm)[arguments]: Add '-DLLVM_REQUIRES_RTTI=1' to #:configure-flags. * gnu/packages/audio.scm (faust-2)[native-inputs]: 'llvm-3.8-with-rtti' -> 'llvm-3.8'. Eric Bavier 2018-11-14Merge branch 'master' into core-updatesMarius Bakke 2018-11-11gnu: faust-2: Update to 2.5.23....* gnu/packages/audio.scm (faust-2): Update to 2.5.23. [native-inputs]: Replace llvm-with-rtti with llvm-3.8-with-rtti. * gnu/packages/llvm.scm (llvm-with-rtti): Rename this variable... (llvm-3.8-with-rtti): ...to this variable; inherit from llvm-3.8. Ricardo Wurmus 2018-10-15* gnu: clang-runtime: Fix typo in patch name....This is a follow-up to 0627f93db6a57e7411cb332b7509f35753b149e4. * gnu/packages/patches/libsantitizer-ustat-fix.patch: Rename to gnu/packages/patches/libsanitizer-ustat-fix.patch. * gnu/packages/llvm.scm (clang-runtime@3.7, clang-runtime@3.8, clang-runtime@3.9)[patches]: Fix patch name. Efraim Flashner 2018-10-15gnu: clang-runtime: Adapt for glibc@2.28....* gnu/packages/llvm.scm (clang-runtime@3.7, clang-runtime@3.8, clang-runtime@3.9)[patches]: Add patch to work around removed ustat.h. * gnu/packages/patches/clang-3.5-libsanitizer-ustat-fix.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Efraim Flashner 2018-09-14gnu: python-llvmlite: Remove obsolete patch....* gnu/packages/llvm.scm (python-llvmlite)[inputs]: Remove patch that is obsolete since the upgrade to LLVM 6.0.1. Ricardo Wurmus 2018-08-29gnu: Add python-llvmlite....* gnu/packages/llvm.scm (python-llvmlite): New variable. Ricardo Wurmus 2018-07-28Revert "Revert "gnu: llvm: Update to 6.0.1.""...This reverts commit bb8221d41cc7b2dc928d1c9501946d3dc6063c4b. Marius Bakke 2018-04-06gnu: llvm, clang: Update to 6.0.0....* gnu/packages/llvm.scm (llvm, clang-runtime, clang): Update to 6.0.0. (clang-from-llvm)(patches): Set to empty list. [arguments]: Adjust substitutions depending on major version. (llvm-3.8, clang-runtime-3.8, clang-3.8): New public variables. (clang-3.7, clang-3.6, clang-3.5)(patches): Add 'clang-3.5-libc-search-path.patch'. (clang-3.9.1)(patches): Add 'clang-3.8-libc-search-path.patch'. * gnu/packages/patches/clang-6.0-libc-search-path.patch: New file. * gnu/packages/patches/clang-libc-search-path.patch: Rename to ... * gnu/packages/patches/clang-3.5-libc-search-path.patch: ... this. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. Marius Bakke 2018-01-18gnu: clang-runtime: Fix build issues against glibc 2.26....* gnu/packages/patches/clang-runtime-asan-build-fixes.patch, gnu/packages/patches/clang-runtime-esan-build-fixes.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/llvm.scm (clang-runtime-from-llvm): Add 'patches' parameter and honor it. (clang-runtime): Pass patch list. (clang-runtime-3.9.1, clang-runtime-3.7, clang-runtime-3.6) (clang-runtime-3.5): Likewise. Ludovic Courtès 2017-12-25gnu: check, llvm: Use HTTPS for llvm.org home pages....* gnu/packages/check.scm (python-lit)[home-page]: Use HTTPS. * gnu/packages/llvm.scm (llvm, clang, clang-runtime)[home-page]: Likewise. Tobias Geerinckx-Rice