1{ lib, stdenv, fetchurl, openssl, zlib, windows }:
2
3stdenv.mkDerivation rec {
4 pname = "libssh2";
5 version = "1.11.0";
6
7 src = fetchurl {
8 url = "https://www.libssh2.org/download/libssh2-${version}.tar.gz";
9 sha256 = "sha256-NzYWHkHiaTMk3rOMJs/cPv5iCdY0ukJY2xzs/2pa1GE=";
10 };
11
12 patches = [
13 # fetchpatch cannot be used due to infinite recursion
14 # https://github.com/libssh2/libssh2/commit/d34d9258b8420b19ec3f97b4cc5bf7aa7d98e35a
15 ./CVE-2023-48795.patch
16 ];
17
18 outputs = [ "out" "dev" "devdoc" ];
19
20 propagatedBuildInputs = [ openssl ]; # see Libs: in libssh2.pc
21 buildInputs = [ zlib ]
22 ++ lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
23
24 meta = with lib; {
25 description = "A client-side C library implementing the SSH2 protocol";
26 homepage = "https://www.libssh2.org";
27 platforms = platforms.all;
28 license = with licenses; [ bsd3 libssh2 ];
29 maintainers = with maintainers; [ SuperSandro2000 ];
30 };
31}