lol

Merge pull request #155399 from veprbl/pr/openssh_static_fix

pkgsStatic.openssh: fix build

authored by

Maximilian Bosch and committed by
GitHub
1c772b47 925e446c

+3 -17
+3 -17
pkgs/tools/networking/openssh/common.nix
··· 63 63 # Setting LD causes `configure' and `make' to disagree about which linker 64 64 # to use: `configure' wants `gcc', but `make' wants `ld'. 65 65 unset LD 66 - '' 67 - # Upstream build system does not support static build, so we fall back 68 - # on fragile patching of configure script. 69 - # 70 - # libedit is found by pkg-config, but without --static flag, required 71 - # to get also transitive dependencies for static linkage, hence sed 72 - # expression. 73 - # 74 - # Kerberos can be found either by krb5-config or by fall-back shell 75 - # code in openssh's configure.ac. Neither of them support static 76 - # build, but patching code for krb5-config is simpler, so to get it 77 - # into PATH, libkrb5.dev is added into buildInputs. 78 - + optionalString stdenv.hostPlatform.isStatic '' 79 - sed -i "s,PKGCONFIG --libs,PKGCONFIG --libs --static,g" configure 80 - sed -i 's#KRB5CONF --libs`#KRB5CONF --libs` -lkrb5support -lkeyutils#g' configure 81 - sed -i 's#KRB5CONF --libs gssapi`#KRB5CONF --libs gssapi` -lkrb5support -lkeyutils#g' configure 82 66 ''; 83 67 84 68 # I set --disable-strip because later we strip anyway. And it fails to strip ··· 98 82 ++ optional (!linkOpenssl) "--without-openssl" 99 83 ++ extraConfigureFlags; 100 84 85 + ${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null}= [ "-laudit" ] ++ lib.optionals withKerberos [ "-lkeyutils" ]; 86 + 101 87 buildFlags = [ "SSH_KEYSIGN=ssh-keysign" ]; 102 88 103 89 enableParallelBuilding = true; ··· 107 93 doCheck = true; 108 94 enableParallelChecking = false; 109 95 checkInputs = optional (!stdenv.isDarwin) hostname; 110 - preCheck = '' 96 + preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' 111 97 # construct a dummy HOME 112 98 export HOME=$(realpath ../dummy-home) 113 99 mkdir -p ~/.ssh