git.iko.soy/typeable/nixpkgs
on master help sign in
libssh: Revert to old style
commitc47e78bbeccd9b535140ca0a1157b48ca3def2d2 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateTue 2 Jun 2015, 11:55 (12 years ago) parent5b7c6d0
1 file changed+5−53
pkgs/development/libraries/libssh/default.nix+5−53
pkgs/development/libraries/libssh/default.nix+5−53
@@ -1,37 +1,10 @@
1−{ stdenv, fetchurl, pkgconfig, cmake
2−
3−# Optional Dependencies
4−, heimdal ? null, zlib ? null, libsodium ? null
5−
6−# Crypto Dependencies
7−, openssl ? null, libgcrypt ? null
8−}:
9−
10−let
11− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
12−
13− # Prefer openssl
14− cryptoStr = if shouldUsePkg openssl != null then "openssl"
15− else if shouldUsePkg libgcrypt != null then "libgcrypt"
16− else "none";
17− crypto = {
18− openssl = openssl;
19− libgcrypt = libgcrypt;
20− none = null;
21− }.${cryptoStr};
22−
23− optHeimdal = shouldUsePkg heimdal;
24− optZlib = shouldUsePkg zlib;
25− optLibsodium = shouldUsePkg libsodium;
26−in
27−
28−assert crypto != null;
1+{ stdenv, fetchurl, pkgconfig, cmake, zlib, openssl, libsodium }:
292
303stdenv.mkDerivation rec {
314 name = "libssh-0.7.0";
325
336 src = fetchurl {
34− url = "https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.7.0.tar.gz";
7+ url = "https://git.libssh.org/projects/libssh.git/snapshot/${name}.tar.gz";
358 sha256 = "1wfrdqhv97f4ycd9bcpgb6gw47kr7b2iq8cz5knk8a6n9c6870k0";
369 };
3710
@@ -42,35 +15,14 @@ stdenv.mkDerivation rec {
4215 sed -i 's,nacl/,sodium/,g' ./include/libssh/curve25519.h src/curve25519.c
4316 '';
4417
45− cmakeFlags = [
46− "-DWITH_GSSAPI=${if optHeimdal != null then "ON" else "OFF"}"
47− "-DWITH_ZLIB=${if optZlib != null then "ON" else "OFF"}"
48− "-DWITH_SSH1=OFF"
49− "-DWITH_SFTP=ON"
50− "-DWITH_SERVER=ON"
51− "-DWITH_STATIC_LIB=OFF"
52− "-DWITH_DEBUG_CRYPTO=OFF"
53− "-DWITH_DEBUG_CALLTRACE=OFF"
54− "-DWITH_GCRYPT=${if cryptoStr == "libgcrypt" then "ON" else "OFF"}"
55− "-DWITH_PCAP=ON"
56− "-DWITH_INTERNAL_DOC=OFF"
57− "-DWITH_TESTING=OFF"
58− "-DWITH_CLIENT_TESTING=OFF"
59− "-DWITH_BENCHMARKS=OFF"
60− "-DWITH_EXAMPLES=OFF"
61− "-DWITH_NACL=${if optLibsodium != null then "ON" else "OFF"}"
62− ] ++ stdenv.lib.optionals (optLibsodium != null) [
63− "-DNACL_LIBRARY=${optLibsodium}/lib/libsodium.so"
64− "-DNACL_INCLUDE_DIR=${optLibsodium}/include"
65− ];
18+ buildInputs = [ zlib openssl libsodium ];
6619
67− nativeBuildInputs = [ pkgconfig cmake ];
68− buildInputs = [ optHeimdal optZlib optLibsodium crypto ];
20+ nativeBuildInputs = [ cmake pkgconfig ];
6921
7022 meta = with stdenv.lib; {
7123 description = "SSH client library";
7224 license = licenses.lgpl2Plus;
73− maintainers = with maintainers; [ sander urkud wkennington ];
25+ maintainers = with maintainers; [ sander urkud ];
7426 platforms = platforms.all;
7527 };
7628}