git.iko.soy/typeable/nixpkgs
on master help sign in
Revert "libssh2: Modernize Build"

This reverts commit e9ee5f99615d0980538e60b1079c8438f8d8135c.

commite3356b396d308264ab04cb3e997edc048af2fea2 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateTue 2 Jun 2015, 11:43 (12 years ago) parent487736d
2 files changed+6−62
pkgs/development/libraries/libssh2/default.nix+5−59 pkgs/top-level/all-packages.nix+1−3
pkgs/development/libraries/libssh2/default.nix+5−59
@@ -1,73 +1,19 @@
1−{ stdenv, fetchurl
1+{stdenv, fetchurlBoot, openssl, zlib}:
22
3−# Optional Dependencies
4−, zlib ? null
5−
6−# Crypto Dependencies
7−, openssl ? null, libgcrypt ? null
8−}:
9−
10−let
11− mkFlag = trueStr: falseStr: cond: name: val:
12− if cond == null then null else
13− "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
14− mkEnable = mkFlag "enable-" "disable-";
15− mkWith = mkFlag "with-" "without-";
16− mkOther = mkFlag "" "" true;
17−
18− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
19−
20− # Prefer openssl
21− cryptoStr = if shouldUsePkg openssl != null then "openssl"
22− else if shouldUsePkg libgcrypt != null then "libgcrypt"
23− else "none";
24− crypto = {
25− openssl = openssl;
26− libgcrypt = libgcrypt;
27− none = null;
28− }.${cryptoStr};
29−
30− optZlib = shouldUsePkg zlib;
31−in
32−
33−assert crypto != null;
34−
35−with stdenv.lib;
363stdenv.mkDerivation rec {
374 name = "libssh2-1.5.0";
385
39− src = fetchurl {
6+ src = fetchurlBoot {
407 url = "${meta.homepage}/download/${name}.tar.gz";
418 sha256 = "1z6hfgak00yz0azx6lk6n688mywhdxx03j6sdf95p3w6ssnnn6c3";
429 };
4310
44− buildInputs = [ crypto optZlib ];
45−
46− configureFlags = [
47− (mkWith (cryptoStr == "openssl") "openssl" null)
48− (mkWith (cryptoStr == "libgcrypt") "libgcrypt" null)
49− (mkWith false "wicng" null)
50− (mkWith optZlib "libz" null)
51− (mkEnable false "crypt-none" null)
52− (mkEnable false "mac-none" null)
53− (mkEnable true "gex-new" null)
54− (mkEnable false "debug" null)
55− (mkEnable false "examples-build" null)
56− ];
57−
58− postInstall = optionalString (optZlib != null) ''
59− sed -i 's,\(-lz\),-L${optZlib}/lib \1,' $out/lib/libssh2.la
60− '' + optionalString (cryptoStr == "openssl") ''
61− sed -i 's,\(-lssl\|-lcrypto\),-L${openssl}/lib \1,' $out/lib/libssh2.la
62− '' + optionalString (cryptoStr == "libgcrypt") ''
63− sed -i 's,\(-lgcrypt\),-L${libgcrypt}/lib \1,' $out/lib/libssh2.la
64− '';
11+ buildInputs = [ openssl zlib ];
6512
6613 meta = {
6714 description = "A client-side C library implementing the SSH2 protocol";
6815 homepage = http://www.libssh2.org;
69− license = licenses.gpl2;
70− platforms = platforms.all;
71− maintainers = with maintainers; [ urkud wkennington ];
16+ platforms = stdenv.lib.platforms.all;
17+ maintainers = [ stdenv.lib.maintainers.urkud ];
7218 };
7319}
pkgs/top-level/all-packages.nix+1−3
@@ -7115,9 +7115,7 @@ let
71157115
71167116 libssh = callPackage ../development/libraries/libssh { };
71177117
7118− libssh2 = callPackage ../development/libraries/libssh2 {
7119− fetchurl = fetchurlBoot;
7120− };
7118+ libssh2 = callPackage ../development/libraries/libssh2 { };
71217119
71227120 libstartup_notification = callPackage ../development/libraries/startup-notification { };
71237121