2022-09-09 14:08:57 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchurl
|
|
|
|
|
, pkg-config
|
|
|
|
|
, cmake
|
|
|
|
|
, zlib
|
|
|
|
|
, openssl
|
|
|
|
|
, libsodium
|
|
|
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
|
, ffmpeg
|
|
|
|
|
, sshping
|
|
|
|
|
, wireshark
|
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "libssh";
|
2024-01-13 08:15:51 +00:00
|
|
|
|
version = "0.10.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-13 08:15:51 +00:00
|
|
|
|
url = "https://www.libssh.org/files/${lib.versions.majorMinor version}/libssh-${version}.tar.xz";
|
|
|
|
|
hash = "sha256-GGHUmPW28XQbarxz5ghHhJHtz5ydS2Yw7vbnRZbencE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
|
# Do not split 'dev' output until lib/cmake/libssh/libssh-config.cmake
|
|
|
|
|
# is fixed to point INTERFACE_INCLUDE_DIRECTORIES to .dev output.
|
|
|
|
|
# Otherwise it breaks `plasma5Packages.kio-extras`:
|
|
|
|
|
# https://hydra.nixos.org/build/221540008/nixlog/3/tail
|
|
|
|
|
#outputs = [ "out" "dev" ];
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
# Fix headers to use libsodium instead of NaCl
|
|
|
|
|
sed -i 's,nacl/,sodium/,g' ./include/libssh/curve25519.h src/curve25519.c
|
|
|
|
|
'';
|
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
|
# Don’t build examples, which are not installed and require additional dependencies not
|
|
|
|
|
# included in `buildInputs` such as libX11.
|
|
|
|
|
cmakeFlags = [ "-DWITH_EXAMPLES=OFF" ];
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# single output, otherwise cmake and .pc files point to the wrong directory
|
|
|
|
|
# outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
|
|
buildInputs = [ zlib openssl libsodium ];
|
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
|
passthru.tests = {
|
|
|
|
|
inherit ffmpeg sshping wireshark;
|
|
|
|
|
};
|
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "SSH client library";
|
|
|
|
|
homepage = "https://libssh.org";
|
|
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
|
maintainers = with maintainers; [ sander ];
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
};
|
|
|
|
|
}
|