From b7480c8674b437d80719046360be668084cfeddf Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 17 Jan 2022 13:16:53 -0500 Subject: pkgsStatic.openssh: fix build Remove reference to libredirect for cross builds, as for those the tests are disabled: https://github.com/NixOS/nixpkgs/blob/4818f809a92b2ef8d8c002c10a29f1080106ee81/pkgs/stdenv/generic/make-derivation.nix#L103 --- pkgs/tools/networking/openssh/common.nix | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'pkgs/tools/networking/openssh') diff --git a/pkgs/tools/networking/openssh/common.nix b/pkgs/tools/networking/openssh/common.nix index 229edd37eeef9..bd127b9092ccd 100644 --- a/pkgs/tools/networking/openssh/common.nix +++ b/pkgs/tools/networking/openssh/common.nix @@ -63,22 +63,6 @@ stdenv.mkDerivation rec { # Setting LD causes `configure' and `make' to disagree about which linker # to use: `configure' wants `gcc', but `make' wants `ld'. unset LD - '' - # Upstream build system does not support static build, so we fall back - # on fragile patching of configure script. - # - # libedit is found by pkg-config, but without --static flag, required - # to get also transitive dependencies for static linkage, hence sed - # expression. - # - # Kerberos can be found either by krb5-config or by fall-back shell - # code in openssh's configure.ac. Neither of them support static - # build, but patching code for krb5-config is simpler, so to get it - # into PATH, libkrb5.dev is added into buildInputs. - + optionalString stdenv.hostPlatform.isStatic '' - sed -i "s,PKGCONFIG --libs,PKGCONFIG --libs --static,g" configure - sed -i 's#KRB5CONF --libs`#KRB5CONF --libs` -lkrb5support -lkeyutils#g' configure - sed -i 's#KRB5CONF --libs gssapi`#KRB5CONF --libs gssapi` -lkrb5support -lkeyutils#g' configure ''; # I set --disable-strip because later we strip anyway. And it fails to strip @@ -98,6 +82,8 @@ stdenv.mkDerivation rec { ++ optional (!linkOpenssl) "--without-openssl" ++ extraConfigureFlags; + ${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null}= [ "-laudit" ] ++ lib.optionals withKerberos [ "-lkeyutils" ]; + buildFlags = [ "SSH_KEYSIGN=ssh-keysign" ]; enableParallelBuilding = true; @@ -107,7 +93,7 @@ stdenv.mkDerivation rec { doCheck = true; enableParallelChecking = false; checkInputs = optional (!stdenv.isDarwin) hostname; - preCheck = '' + preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' # construct a dummy HOME export HOME=$(realpath ../dummy-home) mkdir -p ~/.ssh -- cgit 1.4.1