@@ -13,10 +13,9 @@ let
1313 url = mirror://sourceforge/hpnssh/openssh-6.6p1-hpnssh14v5.diff.gz;
1414 sha256 = "682b4a6880d224ee0b7447241b684330b731018585f1ba519f46660c10d63950";
1515 };
16− optionalString = stdenv.lib.optionalString;
1716
1817in
19−
18+with stdenv.lib;
2019stdenv.mkDerivation rec {
2120 name = "openssh-6.8p1";
2221
@@ -25,7 +24,7 @@ stdenv.mkDerivation rec {
2524 sha256 = "03hnrqvjq6ghg1mp3gkarfxh6g3x1n1vjrzpbc5lh9717vklrxiz";
2625 };
2726
28− prePatch = stdenv.lib.optionalString hpnSupport
27+ prePatch = optionalString hpnSupport
2928 ''
3029 gunzip -c ${hpnSrc} | patch -p1
3130 export NIX_LDFLAGS="$NIX_LDFLAGS -lgcc_s"
@@ -34,43 +33,39 @@ stdenv.mkDerivation rec {
3433 patches = [ ./locale_archive.patch ];
3534
3635 buildInputs = [ zlib openssl libedit pkgconfig pam ]
37− ++ stdenv.lib.optional withKerberos [ kerberos ];
36+ ++ optional withKerberos [ kerberos ];
3837
3938 # I set --disable-strip because later we strip anyway. And it fails to strip
4039 # properly when cross building.
41− configureFlags =
42− ''
43− --with-mantype=man
44− --with-libedit=yes
45− --disable-strip
46− ${if pam != null then "--with-pam" else "--without-pam"}
47− ${optionalString (etcDir != null) "--sysconfdir=${etcDir}"}
48− ${optionalString withKerberos "--with-kerberos5=${kerberos}"}
49− ${optionalString stdenv.isDarwin "--disable-libutil"}
50− '';
51−
52− preConfigure =
53− ''
54− configureFlags="$configureFlags --with-privsep-path=$out/empty"
55− mkdir -p $out/empty
56− '';
40+ configureFlags = [
41+ "--localstatedir=/var"
42+ "--with-mantype=man"
43+ "--with-libedit=yes"
44+ "--disable-strip"
45+ (if pam != null then "--with-pam" else "--without-pam")
46+ ] ++ optional (etcDir != null) "--sysconfdir=${etcDir}"
47+ ++ optional withKerberos "--with-kerberos5=${kerberos}"
48+ ++ optional stdenv.isDarwin "--disable-libutil";
49+
50+ preConfigure = ''
51+ configureFlagsArray+=("--with-privsep-path=$out/empty")
52+ mkdir -p $out/empty
53+ '';
5754
5855 enableParallelBuilding = true;
5956
60− postInstall =
61− ''
62− # Install ssh-copy-id, it's very useful.
63− cp contrib/ssh-copy-id $out/bin/
64− chmod +x $out/bin/ssh-copy-id
65− cp contrib/ssh-copy-id.1 $out/share/man/man1/
66−
67− mkdir -p $out/etc/ssh
68− cp moduli $out/etc/ssh/
69− '';
57+ postInstall = ''
58+ # Install ssh-copy-id, it's very useful.
59+ cp contrib/ssh-copy-id $out/bin/
60+ chmod +x $out/bin/ssh-copy-id
61+ cp contrib/ssh-copy-id.1 $out/share/man/man1/
62+ '';
7063
71− installTargets = "install-nosysconf";
64+ installFlags = [
65+ "sysconfdir=\${out}/etc/ssh"
66+ ];
7267
73− meta = with stdenv.lib; {
68+ meta = {
7469 homepage = "http://www.openssh.org/";
7570 description = "An implementation of the SSH protocol";
7671 license = stdenv.lib.licenses.bsd2;