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