2017-06-28 22:22:12 +02:00
|
|
|
{ stdenv, fetchurlBoot, openssl, zlib, windows
|
|
|
|
, hostPlatform
|
|
|
|
}:
|
2010-08-05 22:24:32 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-12-21 04:58:45 +01:00
|
|
|
name = "libssh2-1.8.0";
|
2010-08-05 22:24:32 +02:00
|
|
|
|
2015-06-02 11:43:15 +02:00
|
|
|
src = fetchurlBoot {
|
2010-08-05 22:24:32 +02:00
|
|
|
url = "${meta.homepage}/download/${name}.tar.gz";
|
2016-12-21 04:58:45 +01:00
|
|
|
sha256 = "1m3n8spv79qhjq4yi0wgly5s5rc8783jb1pyra9bkx1md0plxwrr";
|
2010-08-05 22:24:32 +02:00
|
|
|
};
|
|
|
|
|
2016-09-01 11:07:23 +02:00
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
2015-10-06 14:52:57 +02:00
|
|
|
|
2015-06-02 11:43:15 +02:00
|
|
|
buildInputs = [ openssl zlib ];
|
2010-08-05 22:24:32 +02:00
|
|
|
|
2015-11-06 16:02:12 +01:00
|
|
|
crossAttrs = {
|
|
|
|
# link against cross-built libraries
|
|
|
|
configureFlags = [
|
|
|
|
"--with-openssl"
|
|
|
|
"--with-libssl-prefix=${openssl.crossDrv}"
|
|
|
|
"--with-libz"
|
|
|
|
"--with-libz-prefix=${zlib.crossDrv}"
|
|
|
|
];
|
2017-06-28 22:22:12 +02:00
|
|
|
} // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") {
|
2015-11-06 16:02:12 +01:00
|
|
|
# mingw needs import library of ws2_32 to build the shared library
|
|
|
|
preConfigure = ''
|
|
|
|
export LDFLAGS="-L${windows.mingw_w64}/lib $LDFLAGS"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2010-08-05 22:24:32 +02:00
|
|
|
meta = {
|
|
|
|
description = "A client-side C library implementing the SSH2 protocol";
|
|
|
|
homepage = http://www.libssh2.org;
|
2015-06-02 11:43:15 +02:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2017-03-27 19:11:17 +02:00
|
|
|
maintainers = [ ];
|
2010-08-05 22:24:32 +02:00
|
|
|
};
|
|
|
|
}
|