2024-09-19 14:19:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, openssl
|
|
|
|
, zlib
|
|
|
|
, windows
|
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
, aria2
|
|
|
|
, curl
|
|
|
|
, libgit2
|
|
|
|
, mc
|
|
|
|
, vlc
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libssh2";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.11.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-09-26 12:46:18 +00:00
|
|
|
url = "https://www.libssh2.org/download/libssh2-${version}.tar.gz";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-NzYWHkHiaTMk3rOMJs/cPv5iCdY0ukJY2xzs/2pa1GE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
patches = [
|
|
|
|
# fetchpatch cannot be used due to infinite recursion
|
|
|
|
# https://github.com/libssh2/libssh2/commit/d34d9258b8420b19ec3f97b4cc5bf7aa7d98e35a
|
|
|
|
./CVE-2023-48795.patch
|
|
|
|
];
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
# this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion
|
|
|
|
# necessary for FreeBSD code path in configure
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ./config.guess --replace-fail /usr/bin/uname uname
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
propagatedBuildInputs = [ openssl ]; # see Libs: in libssh2.pc
|
|
|
|
buildInputs = [ zlib ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit aria2 libgit2 mc vlc;
|
|
|
|
curl = (curl.override { scpSupport = true; }).tests.withCheck;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Client-side C library implementing the SSH2 protocol";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.libssh2.org";
|
|
|
|
platforms = platforms.all;
|
2024-09-19 14:19:46 +00:00
|
|
|
license = with licenses; [ bsd3 ];
|
2021-09-26 12:46:18 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|