From d583c165683122fb5fd04e3463c8ca7b23edd98b Mon Sep 17 00:00:00 2001 From: "Matthias C. M. Troffaes" Date: Fri, 6 Nov 2015 15:02:12 +0000 Subject: libssh2: fix shared library build under mingw --- pkgs/development/libraries/libssh2/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'pkgs/development/libraries/libssh2') diff --git a/pkgs/development/libraries/libssh2/default.nix b/pkgs/development/libraries/libssh2/default.nix index 2bd7950751b..5e12ea734c1 100644 --- a/pkgs/development/libraries/libssh2/default.nix +++ b/pkgs/development/libraries/libssh2/default.nix @@ -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; -- cgit 1.4.1