at 17.09-beta 38 lines 999 B view raw
1{ stdenv, fetchurlBoot, openssl, zlib, windows 2, hostPlatform 3}: 4 5stdenv.mkDerivation rec { 6 name = "libssh2-1.8.0"; 7 8 src = fetchurlBoot { 9 url = "${meta.homepage}/download/${name}.tar.gz"; 10 sha256 = "1m3n8spv79qhjq4yi0wgly5s5rc8783jb1pyra9bkx1md0plxwrr"; 11 }; 12 13 outputs = [ "out" "dev" "devdoc" ]; 14 15 buildInputs = [ openssl zlib ]; 16 17 crossAttrs = { 18 # link against cross-built libraries 19 configureFlags = [ 20 "--with-openssl" 21 "--with-libssl-prefix=${openssl.crossDrv}" 22 "--with-libz" 23 "--with-libz-prefix=${zlib.crossDrv}" 24 ]; 25 } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { 26 # mingw needs import library of ws2_32 to build the shared library 27 preConfigure = '' 28 export LDFLAGS="-L${windows.mingw_w64}/lib $LDFLAGS" 29 ''; 30 }; 31 32 meta = { 33 description = "A client-side C library implementing the SSH2 protocol"; 34 homepage = http://www.libssh2.org; 35 platforms = stdenv.lib.platforms.all; 36 maintainers = [ ]; 37 }; 38}