libssh2: fix shared library build under mingw

This commit is contained in:
Matthias C. M. Troffaes 2015-11-06 15:02:12 +00:00
parent 95396d9dbb
commit d583c16568
1 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{stdenv, fetchurlBoot, openssl, zlib}:
{stdenv, fetchurlBoot, openssl, zlib, windows}:
stdenv.mkDerivation rec {
name = "libssh2-1.6.0";
@ -10,6 +10,21 @@ stdenv.mkDerivation rec {
buildInputs = [ openssl zlib ];
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"
'';
};
meta = {
description = "A client-side C library implementing the SSH2 protocol";
homepage = http://www.libssh2.org;