1{
2 lib,
3 stdenv,
4 fetchurl,
5 openssl,
6 zlib,
7 windows,
8
9 # for passthru.tests
10 aria2,
11 curl,
12 libgit2,
13 mc,
14 vlc,
15}:
16
17stdenv.mkDerivation rec {
18 pname = "libssh2";
19 version = "1.11.1";
20
21 src = fetchurl {
22 url = "https://www.libssh2.org/download/libssh2-${version}.tar.gz";
23 hash = "sha256-2ex2y+NNuY7sNTn+LImdJrDIN8s+tGalaw8QnKv2WPc=";
24 };
25
26 # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion
27 # necessary for FreeBSD code path in configure
28 postPatch = ''
29 substituteInPlace ./config.guess --replace-fail /usr/bin/uname uname
30 '';
31
32 outputs = [
33 "out"
34 "dev"
35 "devdoc"
36 ];
37
38 propagatedBuildInputs = [ openssl ]; # see Libs: in libssh2.pc
39 buildInputs = [ zlib ] ++ lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
40
41 passthru.tests = {
42 inherit
43 aria2
44 libgit2
45 mc
46 vlc
47 ;
48 curl = (curl.override { scpSupport = true; }).tests.withCheck;
49 };
50
51 meta = with lib; {
52 description = "Client-side C library implementing the SSH2 protocol";
53 homepage = "https://www.libssh2.org";
54 platforms = platforms.all;
55 license = with licenses; [ bsd3 ];
56 maintainers = with maintainers; [ SuperSandro2000 ];
57 };
58}