2022-08-28 13:52:05 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchurl
|
|
|
|
|
, pkg-config
|
|
|
|
|
, cmake
|
|
|
|
|
, zlib
|
|
|
|
|
, openssl
|
|
|
|
|
, libsodium
|
|
|
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
|
, ffmpeg
|
|
|
|
|
, sshping
|
|
|
|
|
, wireshark
|
|
|
|
|
}:
|
2010-02-14 21:56:35 +00:00
|
|
|
|
|
2011-06-07 21:49:42 +00:00
|
|
|
|
stdenv.mkDerivation rec {
|
2020-03-13 01:14:37 +00:00
|
|
|
|
pname = "libssh";
|
2023-05-07 15:05:19 +00:00
|
|
|
|
version = "0.10.5";
|
2012-11-29 15:21:01 +00:00
|
|
|
|
|
2010-02-14 21:56:35 +00:00
|
|
|
|
src = fetchurl {
|
2021-08-26 17:37:15 +00:00
|
|
|
|
url = "https://www.libssh.org/files/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2023-05-07 15:05:19 +00:00
|
|
|
|
sha256 = "sha256-tg4v9/Nnue7itWNNOmMwPd/t4OahjfyojESodw5+QjQ=";
|
2010-02-14 21:56:35 +00:00
|
|
|
|
};
|
2012-11-29 15:21:01 +00:00
|
|
|
|
|
2023-05-29 10:53:14 +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" ];
|
2023-05-11 21:22:31 +00:00
|
|
|
|
|
2015-05-21 23:13: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
|
|
|
|
|
'';
|
2015-05-20 06:30:51 +00:00
|
|
|
|
|
2023-05-19 19:53:05 +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" ];
|
|
|
|
|
|
2019-04-24 03:43:35 +00:00
|
|
|
|
# single output, otherwise cmake and .pc files point to the wrong directory
|
|
|
|
|
# outputs = [ "out" "dev" ];
|
2015-10-07 21:03:07 +00:00
|
|
|
|
|
2015-06-02 09:55:30 +00:00
|
|
|
|
buildInputs = [ zlib openssl libsodium ];
|
2012-11-29 15:21:01 +00:00
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2012-11-29 15:21:01 +00:00
|
|
|
|
|
2022-08-28 13:52:05 +00:00
|
|
|
|
passthru.tests = {
|
|
|
|
|
inherit ffmpeg sshping wireshark;
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
|
meta = with lib; {
|
2010-02-14 21:56:35 +00:00
|
|
|
|
description = "SSH client library";
|
2020-03-13 01:14:37 +00:00
|
|
|
|
homepage = "https://libssh.org";
|
2014-12-20 13:35:20 +00:00
|
|
|
|
license = licenses.lgpl2Plus;
|
2017-03-27 17:11:17 +00:00
|
|
|
|
maintainers = with maintainers; [ sander ];
|
2014-12-20 13:35:20 +00:00
|
|
|
|
platforms = platforms.all;
|
2010-02-14 21:56:35 +00:00
|
|
|
|
};
|
|
|
|
|
}
|