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)"
2023-03-27gnu: colordiff: Update to 1.0.21....* gnu/packages/patchutils.scm (colordiff): Update to 1.0.21. Signed-off-by: Christopher Baines <mail@cbaines.net> Greg Hogan 2023-03-05gnu: meld: Use new package style....* gnu/packages/patchutils.scm (meld)[arguments]: Convert to list of G-Expressions. <#:phases>: Drop trailing #t. [inputs, native-inputs]: Drop labels. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Andy Tai 2023-03-05gnu: meld: Update to 3.22.0...* gnu/packages/patchutils.scm (meld): Update to 3.22.0 [build-system]: Switch to meson-build-system. [native-inputs]: Add desktop-file-utils, itstool, gobject-introspection, pkg-config, and python. [inputs]: Add bash-minimal, python, and python-pycairo. Replace gtksourceview-3 with gtksourceview-4. [arguments]: Add #:glib-or-gtk?, #:imported-modules, and #:modules. <#:phases>: Remove custom ‘install’ and ‘check’. Add ‘skip-gtk-update-icon-cache’. Adjust ‘copy-styles’ to gtksourceview-4. Replace ‘wrap-typelib’ with ‘python-and-gi-wrap’. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Andy Tai 2022-09-11gnu: Add wiggle....* gnu/packages/patchutils.scm (wiggle): New variable. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> jgart 2022-05-31gnu: Remove patches....* gnu/packages/patchutils.scm (patches): Delete variable. Maxim Cournoyer 2022-05-22gnu: clang@14: Include the extras....* gnu/packages/llvm.scm (clang-14): Add a matching #:tools-extra origin. Reported by foobarxyz on #guix. Tobias Geerinckx-Rice 2022-01-08gnu: patchwork: Update to 3.0.4....* gnu/packages/patchutils.scm (patchwork): Update to 3.0.4. [propagated-inputs]: Use Django 3.2. Christopher Baines 2021-12-17gnu: python-djangorestframework: Rename to python-django-rest-framework....* gnu/packages/django.scm (python-djangorestframework): Define as deprecated alias for ... (python-django-rest-framework): ... this new variable. (python-django-filter)[native-inputs]: Adjust accordingly. * gnu/packages/mail.scm (python-hyperkitty)[propagated-inputs]: Likewise. * gnu/packages/patchutils.scm (patchwork)[propagated-inputs]: Likewise. Marius Bakke 2021-12-13gnu: Simplify package inputs....This commit was obtained by running: ./pre-inst-env guix style without any additional argument. Ludovic Courtès 2021-12-06gnu: patchwork: Adjust for python-build-system change....This is a follow-up to commit db5646d957895944007c1bb44fcd998ea392f168, et.al. * gnu/packages/patchutils.scm (patchwork)[arguments]: Adapt one more site-packages call. Marius Bakke 2021-12-05gnu: Adjust for python-build-system behavior change....Commit cb72f9a773e0931ee3758c851d96007ded034e4c changed the semantics of SITE-PACKAGES, but did not adjust all callers. * gnu/packages/bioinformatics.scm (python-pyvcf)[arguments]: Adjust for missing trailing slash. * gnu/packages/maths.scm (nomad-optimizer)[arguments]: Likewise. * gnu/packages/patchutils.scm (patchwork)[arguments]: Likewise. Marius Bakke 2021-10-12Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe 2021-09-21gnu: patchutils: Update to 0.4.2....* gnu/packages/patchutils.scm (patchutils): Update to 0.4.2. [source]: Remove patch. [inputs]: Add ‘python’. [arguments]<#:phases>: Remove trailing #t. * gnu/local.mk (dist_patch_DATA): Remove patch. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Xinglu Chen 2021-09-17Merge branch 'master' into core-updates-frozen... Conflicts: gnu/packages/bioinformatics.scm gnu/packages/chez.scm gnu/packages/docbook.scm gnu/packages/ebook.scm gnu/packages/gnome.scm gnu/packages/linux.scm gnu/packages/networking.scm gnu/packages/python-web.scm gnu/packages/python-xyz.scm gnu/packages/tex.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/dune.scm guix/build-system/go.scm guix/build-system/linux-module.scm guix/packages.scm Marius Bakke 2021-09-14gnu: meld: Copy GTKSourceView styles....This fixes a somewhat cryptic error, that pops up when gtksourceview-3 has not been installed or propagated by any other package. * gnu/packages/patchutils.scm (meld)[#:phases]: Add ‘copy-styles’. Liliana Marie Prikler 2021-09-07Merge branch 'master' into core-updates-frozenLudovic Courtès 2021-09-05gnu: meld: Update to 3.20.4....* gnu/packages/patchutils.scm (meld): Update to 3.20.4. Tobias Geerinckx-Rice 2021-03-06Merge branch 'master' into core-updatesChristopher Baines 2021-03-04gnu: meld: Update to 3.20.3....* gnu/packages/patchutils.scm (meld): Update to 3.20.3. Tobias Geerinckx-Rice 2021-02-24gnu: patchwork: Update to 3.0.1....* gnu/packages/patchutils.scm (patchwork): Update to 3.0.1. Christopher Baines 2021-02-01gnu: Adjust package collection to Wrap using GUIX_PYTHONPATH....This change was automated using: $ git ls-files | grep .scm | \ xargs sed 's/(getenv "PYTHONPATH")/(getenv "GUIX_PYTHONPATH")/' -i $ git ls-files | grep .scm | \ xargs sed 's/`("PYTHONPATH"/`("GUIX_PYTHONPATH"/' -i * gnu/packages/admin.scm (nmap): (dstat): Wrap using GUIX_PYTHONPATH. * gnu/packages/audio.scm (jack-2): (carla): Likewise. * gnu/packages/benchmark.scm (fio): Likewise. * gnu/packages/bioinformatics.scm (couger): Likewise. (gess, find-circ, filtlong, nanopolish): Likewise. * gnu/packages/cdrom.scm (cdemu-client): Likewise. * gnu/packages/chemistry.scm (avogadro): Likewise. * gnu/packages/connman.scm (econnman): Likewise. * gnu/packages/cups.scm (hplip): Likewise. * gnu/packages/debug.scm (scanmem): Likewise. * gnu/packages/display-managers.scm (lightdm): Likewise. * gnu/packages/ebook.scm (cozy): Likewise. * gnu/packages/education.scm (anki): Likewise. * gnu/packages/engineering.scm (kicad, volk, freecad): Likewise. * gnu/packages/game-development.scm (renpy): Likewise. * gnu/packages/games.scm (roguebox-adventures) (seahorse-adventures, kajongg): Likewise. * gnu/packages/gimp.scm (gimp, glimpse): Likewise. * gnu/packages/glib.scm (itstool): Likewise. * gnu/packages/gnome.scm (gnome-music, gtg, rhythmbox): Likewise. (eolie, d-feet, gedit, caribou, gnome-shell, authenticator) (gnome-todo, orca, passwordsafe, terminator, setzer) (libratbag, komikku): Likewise. * gnu/packages/gps.scm (gpsd): Likewise. * gnu/packages/gtk.scm (gtk-doc): Likewise. * gnu/packages/ibus.scm (ibus, ibus-libpinyin, ibus-anthy) (ibus-libhangul): Likewise. * gnu/packages/inkscape.scm (inkscape-1.0): Likewise. * gnu/packages/linux.scm (bcc): Likewise. * gnu/packages/mail.scm (notifymuch): Likewise. * gnu/packages/maths.scm (units): Likewise. * gnu/packages/music.scm (solfege): Likewise. * gnu/packages/networking.scm (blueman): Likewise. * gnu/packages/patchutils.scm (patchwork): Likewise. * gnu/packages/photo.scm (rapid-photo-downloader, entangle): Likewise. * gnu/packages/plotutils.scm (asymptote): Likewise. * gnu/packages/presentation.scm (presentty): Likewise. * gnu/packages/screen.scm (byobu): Likewise. * gnu/packages/storage.scm (ceph): Likewise. * gnu/packages/syndication.scm (liferea): Likewise. * gnu/packages/task-management.scm (blanket): Likewise. * gnu/packages/text-editors.scm (manuskript): Likewise. * gnu/packages/version-control.scm (gitless, cgit, git-when-merged) (git-imerge): Likewise. * gnu/packages/video.scm (pitivi): Likewise. * gnu/packages/virtualization.scm (criu): Likewise. * gnu/packages/xfce.scm (catfish): Likewise. Maxim Cournoyer