···6363 # Setting LD causes `configure' and `make' to disagree about which linker
6464 # to use: `configure' wants `gcc', but `make' wants `ld'.
6565 unset LD
6666- ''
6767- # Upstream build system does not support static build, so we fall back
6868- # on fragile patching of configure script.
6969- #
7070- # libedit is found by pkg-config, but without --static flag, required
7171- # to get also transitive dependencies for static linkage, hence sed
7272- # expression.
7373- #
7474- # Kerberos can be found either by krb5-config or by fall-back shell
7575- # code in openssh's configure.ac. Neither of them support static
7676- # build, but patching code for krb5-config is simpler, so to get it
7777- # into PATH, libkrb5.dev is added into buildInputs.
7878- + optionalString stdenv.hostPlatform.isStatic ''
7979- sed -i "s,PKGCONFIG --libs,PKGCONFIG --libs --static,g" configure
8080- sed -i 's#KRB5CONF --libs`#KRB5CONF --libs` -lkrb5support -lkeyutils#g' configure
8181- sed -i 's#KRB5CONF --libs gssapi`#KRB5CONF --libs gssapi` -lkrb5support -lkeyutils#g' configure
8266 '';
83678468 # I set --disable-strip because later we strip anyway. And it fails to strip
···9882 ++ optional (!linkOpenssl) "--without-openssl"
9983 ++ extraConfigureFlags;
100848585+ ${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null}= [ "-laudit" ] ++ lib.optionals withKerberos [ "-lkeyutils" ];
8686+10187 buildFlags = [ "SSH_KEYSIGN=ssh-keysign" ];
1028810389 enableParallelBuilding = true;
···10793 doCheck = true;
10894 enableParallelChecking = false;
10995 checkInputs = optional (!stdenv.isDarwin) hostname;
110110- preCheck = ''
9696+ preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
11197 # construct a dummy HOME
11298 export HOME=$(realpath ../dummy-home)
11399 mkdir -p ~/.ssh