diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-04-26 10:00:28 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-04-26 20:40:02 +0900 |
| commit | 9acef235e131d4cb2bcbeb2e7358fbf3af4ad9fe (patch) | |
| tree | 24988279dd3b3e9c84171039f7cd46a418529525 /gnu/packages/ssh.scm | |
| parent | 7ff20b9e94c429f1160bd8f0db86b153a03e4683 (diff) | |
gnu: libssh: Apply upstream patch and enable all tests.
* gnu/packages/patches/libssh-openssh-banner.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/ssh.scm (libssh) [source]: Apply it.
[arguments] <#:phase>: Remove disable-problematic-tests phase. Add
patch-commands and prepare-for-tests phases.
Change-Id: Iaead28f77b81fdf42b77f15dd37e6450537cba30
Diffstat (limited to 'gnu/packages/ssh.scm')
| -rw-r--r-- | gnu/packages/ssh.scm | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index 0b1ebfad56e..9fa765c2108 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -154,7 +154,8 @@ file names. (string-append all "\n" "#ifndef PATH_MAX\n" "# define PATH_MAX 4096\n" - "#endif\n")))))) + "#endif\n")))) + (patches (search-patches "libssh-openssh-banner.patch")))) (build-system cmake-build-system) (outputs '("out" "debug")) (arguments @@ -172,19 +173,25 @@ file names. #~())) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'disable-problematic-tests + (add-after 'unpack 'patch-commands + (lambda* (#:key inputs #:allow-other-keys) + ;; Runtime sources. + (substitute* '("src/config.c" + "src/socket.c") + (("\"/bin/sh\"") + (format #f "~s" (search-input-file inputs "/bin/sh")))) + ;; Test sources. + (substitute* '("tests/server/test_server/default_cb.c") + (("\"/bin/sh\"") + (format #f "~s" (which "sh")))))) + (add-before 'check 'prepare-for-tests + ;; A few test rely on the assumption that HOME == user's pw_dir, + ;; which is not satisfied in Guix, where `pw_dir' is '/' while + ;; HOME is '/homeless-shelter'. (lambda _ - ;; XXX: There is no finer-grain control on skipping tests using - ;; cmocka, short of patching sources, which isn't trivial with - ;; substitute*/sed. - (substitute* "tests/unittests/CMakeLists.txt" - ;; Some torture tests fail due to assuming the user directory - ;; (from the passwd database) matches HOME, and other fail for - ;; unknown reasons (see: - ;; https://gitlab.com/libssh/libssh-mirror/-/issues/302). - (("^ torture_(config|misc|options).*$") ""))))))) + (setenv "HOME" "/")))))) (native-inputs (list cmocka)) - (inputs (list zlib libgcrypt mit-krb5)) + (inputs (list bash-minimal mit-krb5 libgcrypt zlib)) (synopsis "SSH client library") (description "libssh is a C library implementing the SSHv2 and SSHv1 protocol for client |
