From 2607aae93fc9db7b05541d8338a7e6bb9871d057 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 9 Mar 2020 00:43:44 -0400 Subject: [PATCH] fetchsvn: Fix for cross Just use `nativeBuildInputs` at build time. --- pkgs/build-support/fetchsvn/builder.sh | 4 ---- pkgs/build-support/fetchsvn/default.nix | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pkgs/build-support/fetchsvn/builder.sh b/pkgs/build-support/fetchsvn/builder.sh index c386a3f3489f..ed3e65f07695 100644 --- a/pkgs/build-support/fetchsvn/builder.sh +++ b/pkgs/build-support/fetchsvn/builder.sh @@ -2,10 +2,6 @@ source $stdenv/setup header "exporting $url (r$rev) into $out" -if test "$sshSupport"; then - export SVN_SSH="$openssh/bin/ssh" -fi - if test -n "$http_proxy"; then # Configure proxy mkdir .subversion diff --git a/pkgs/build-support/fetchsvn/default.nix b/pkgs/build-support/fetchsvn/default.nix index 68433d1471d6..06f0ea0a3d1f 100644 --- a/pkgs/build-support/fetchsvn/default.nix +++ b/pkgs/build-support/fetchsvn/default.nix @@ -1,7 +1,13 @@ -{stdenvNoCC, subversion, glibcLocales, sshSupport ? true, openssh ? null}: -{url, rev ? "HEAD", md5 ? "", sha256 ? "" +{ stdenvNoCC, buildPackages +, subversion, glibcLocales, sshSupport ? true, openssh ? null +}: + +{ url, rev ? "HEAD", md5 ? "", sha256 ? "" , ignoreExternals ? false, ignoreKeywords ? false, name ? null -, preferLocalBuild ? true }: +, preferLocalBuild ? true +}: + +assert sshSupport -> openssh != null; let repoName = with stdenvNoCC.lib; @@ -32,13 +38,16 @@ else stdenvNoCC.mkDerivation { name = name_; builder = ./builder.sh; - nativeBuildInputs = [ subversion glibcLocales ]; + nativeBuildInputs = [ subversion glibcLocales ] + ++ stdenvNoCC.lib.optional sshSupport openssh; + + SVN_SSH = if sshSupport then "${buildPackages.openssh}/bin/ssh" else null; outputHashAlgo = "sha256"; outputHashMode = "recursive"; outputHash = sha256; - inherit url rev sshSupport openssh ignoreExternals ignoreKeywords; + inherit url rev ignoreExternals ignoreKeywords; impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars; inherit preferLocalBuild;