summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2021-11-13 11:18:25 +0000
committerGitHub <noreply@github.com>2021-11-13 11:18:25 +0000
commita33e09d1d2558bbf2e829d576fd76de6d43575e3 (patch)
tree53ba47f24c73c84202b004b51c7c3cda751bcbad /pkgs
parentaf3d60191951c0a8564e7081f941903f521c8325 (diff)
parent7111193ee69553c4ba3011b148926fb6f23d5a10 (diff)
Merge pull request #145704 from uri-canva/darwin-writers
writers: fix writeRust on darwin
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/build-support/writers/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix
index 216e41f6d7ec..4b4d4bb203e0 100644
--- a/pkgs/build-support/writers/default.nix
+++ b/pkgs/build-support/writers/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, buildPackages, lib, gawk, gnused, gixy }:
+{ pkgs, buildPackages, lib, stdenv, libiconv, gawk, gnused, gixy }:
with lib;
rec {
@@ -150,10 +150,13 @@ rec {
rustcArgs ? [],
strip ? true
}:
+ let
+ darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ];
+ in
makeBinWriter {
compileScript = ''
cp "$contentPath" tmp.rs
- PATH=${makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} -o "$out" tmp.rs
+ PATH=${makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs
'';
inherit strip;
} name;