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