aboutsummaryrefslogtreecommitdiff
# GNU Guix --- Functional package management for GNU
# Copyright © 2013, 2014, 2016, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
#
# 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 hash' command-line utility.
#

guix hash --version

tmpdir="guix-hash-$$"
trap 'rm -rf "$tmpdir"' EXIT

test `guix hash /dev/null` = 0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73
test `echo -n | guix hash -` = 0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73
test `guix hash -f nix-base32 /dev/null` = 0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73
test `guix hash -f hex /dev/null` = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
test `guix hash -f base32 /dev/null` = 4oymiquy7qobjgx36tejs35zeqt24qpemsnzgtfeswmrw6csxbkq
test `guix hash -H sha512 -f hex /dev/null` = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
test `guix hash -H sha1 -f base64 /dev/null` = "2jmj7l5rSw0yVb/vlWAYkK/YBwk="

# Several files.
test "`guix hash /dev/null "$abs_top_srcdir/README"`" = "`guix hash /dev/null ; guix hash "$abs_top_srcdir/README"`"

# Zero files.
guix hash && false

# idem as `cat /dev/null | git hash-object --stdin`
test `guix hash -S git -H sha1 -f hex  /dev/null` = e69de29bb2d1d6434b8b29ae775ad8c2e48c5391

guix hash -H abcd1234 /dev/null && false

mkdir "$tmpdir"
echo -n executable > "$tmpdir/exe"
chmod +x "$tmpdir/exe"
( cd "$tmpdir" ; ln -s exe symlink )
mkdir "$tmpdir/subdir"

test `guix hash -S nar "$tmpdir"` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
test `guix hash -S nar "$tmpdir" -H sha512` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n
test `guix hash -S git "$tmpdir"` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk
test `guix hash -S git "$tmpdir" -H sha512` = 158b10d1bsdk4pm8ym9cg9ckfak1b0cgpw7365cl6s341ir380mh2f4ylicyh8khyrfnwq5cn9766d7m8fbfwwl94ndkv456v6a8knr

# Deprecated --recursive option
test `guix hash -r "$tmpdir" 2>/dev/null` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
test `guix hash -r "$tmpdir" -H sha512 2>/dev/null` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n

# Without '-r', this should fail.
guix hash "$tmpdir" && false

# This should fail because /dev/null is a character device, which
# the archive format doesn't support.
guix hash -S nar /dev/null && false

# Adding a .git directory
mkdir "$tmpdir/.git"
touch "$tmpdir/.git/foo"

# ...changes the hash
test `guix hash -S nar $tmpdir` = 0a50z04zyzf7pidwxv0nwbj82pgzbrhdy9562kncnvkcfvb48m59
test `guix hash -S git $tmpdir` = 0ghlpca9xaswa1ay1g55dknwd9q899mi3ahfr43pq083v8wisjc7

# ...but remains the same when using `-x'
test `guix hash -S nar $tmpdir -x` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
test `guix hash -S git $tmpdir -x` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk

# Without '-r', this should fail.
guix hash "$tmpdir" && false

exit 0
td>gnu: gmic: Update to 3.4.0....* gnu/packages/image-processing.scm (gmic): Update to 3.4.0. Change-Id: I2c9335a96bb22625012f35b60620b9b9ad435a64 Vinicius Monego 2024-06-27gnu: vtk: Update to 9.3.0....* gnu/packages/image-processing.scm (vtk): Update to 9.3.0. Change-Id: Id31d41e7dc457d1f17c0e8e824c170942d81698c Signed-off-by: Andreas Enge <andreas@enge.fr> Lars Bilke 2024-05-23gnu: dcmtk: Update to 3.6.8. [security-fixes]...This fixes CVE-2022-43272. * gnu/packages/image-processing.scm (dcmtk): Update to 3.6.8. Change-Id: I4e0203219280a2571267f566cdfc8c2a9ea3fd18 Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn> Nicolas Graves via Guix-patches via 2024-04-22gnu: Add python-pims....* gnu/packages/image-processing.scm (python-pims): New variable. Change-Id: I33e89dd865a38b526a1f766cf321a6c67a170a36 Ricardo Wurmus 2024-04-22gnu: Add python-spatial-image....* gnu/packages/image-processing.scm (python-spatial-image): New variable. Change-Id: I0e2bbfb94499aca71b33703153ad408530b60658 Ricardo Wurmus 2024-04-06gnu: opencolorio: Update to 2.3.2....* gnu/packages/image-processing.scm (opencolorio): Update to 2.3.2. [source]: Remove snippet. [arguments]: Use G-Expressions. <#:configure-flags>: Unset "-DCMAKE-CXX_FLAGS", "-DOCIO_BUILD_STATIC", "-DUSE_EXTERNAL_TINXML", "-DUSE_EXTERNAL_LCMS". Pass "-DCIO_BUILD_GPU_TESTS=false". <#:phases>: Delete the patch-test-suite phase. [native-inputs]: Remove git, pkg-config. Add openimageio, pybind11-2.10, python-wrapper. [inputs]: Remove openexr-2, tinyxml. Add expat, freeglut, glew, imath, libglvnd, minizip-ng, openexr, pystring, yaml-cpp, zlib. [license]: Simplify. * gnu/packages/patches/opencolorio-fix-build-with-gcc11.patch: Delete patch. * gnu/local.mk (dist_patch_DATA): Unregister it. Change-Id: Iafd87762df81d0f5c23089251b4241a57d414dc4 Vinicius Monego 2024-03-27gnu: insight-toolkit: Build and install Python bindings....* gnu/packages/image-processing.scm (insight-toolkit)[outputs]: Add "python" output. [arguments]: Add configure flags to build Python bindings; add phase 'ignore-warnings. [native-inputs]: Add castxml, swig, and which. (insight-toolkit-4)[outputs]: Override. [native-inputs]: Override. Change-Id: I4177d0c0239027290678a43f2ea26cb8e1e74918 Ricardo Wurmus 2024-03-25gnu: opencv: Update to 4.9.0....* gnu/packages/image-processing.scm (opencv): Update to 4.9.0. [source]: Remove non-existent "libtengine" from 3rdParty drectory list to be deleted. Change-Id: I982256730e33b418491ba2b9238c0e532cb9a7a9 Signed-off-by: Christopher Baines <mail@cbaines.net> Andy Tai 2024-03-23gnu: gmic: Update to 3.3.5....* gnu/packages/image-processing.scm (gmic): Update to 3.3.5. Change-Id: I5e5ced3044ff92bbf66bc4dde5506fac1b883f0b Vinicius Monego 2024-02-13gnu: opencv: Update to 4.8.1....* gnu/packages/image-processing.scm (opencv): Update to 4.8.1. Change-Id: Ia493896c063b32c5b42cdfee5e8e921dc957ff71 Signed-off-by: Christopher Baines <mail@cbaines.net> Andy Tai 2024-02-09gnu: vxl: Update to 3.5.0....* gnu/packages/image-processing.scm (vxl): Update to 3.5.0. Change-Id: I90eeb3659b0b208591e7eb6b2bfa19f28cb39a6f Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Felix Gruber 2024-01-19gnu: gmic: Update to 3.3.3....gmic was integrated into Krita 5+. * gnu/packages/image-processing.scm (gmic, gmic-qt): Update to 3.3.3. (gmic-qt-krita): Delete variable. Change-Id: I44e33b570bcf3e1df3eba5eb9ede1f333f8a177a Vinicius Monego 2023-12-05gnu: python-imgviz: Adjust for newer python....* gnu/packages/image-processing.scm (python-imgviz)[source]: Add snippet to adjust python module imports. Change-Id: I50b39fa5acfc766eb9f18658dbfc3053473e0287 Efraim Flashner 2023-11-14gnu: insight-toolkit-4.12: Fix building....* gnu/packages/image-processing.scm (insight-toolkit-4.12)[arguments]: Add a configure-flag to build with c++14. Change-Id: I5e7a0a3ed47e4e3f25611147f8e66c58a1bf8a8c Efraim Flashner