summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Bereknyei <tom@dds.mil>2019-03-31 13:20:02 -0400
committertv <tv@krebsco.de>2019-04-02 20:03:15 +0200
commita0470b456a26e903c28ccaa89d12b68c7287b0bc (patch)
tree8aaeb66cce718d05e8789659c6c44af3a998d6db
parentd856f05daff9cd726d1e798f1bb9a18eecbe2f50 (diff)
writeC: use clang for OSX compatibility
-rw-r--r--pkgs/default.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 21b837c..9ae5098 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -200,12 +200,12 @@ pkgs: oldpkgs: {
PATH=${makeBinPath [
pkgs.binutils-unwrapped
pkgs.coreutils
- pkgs.gcc
pkgs.pkgconfig
+ pkgs.stdenv.cc
]}
exe=$out${destination}
mkdir -p "$(dirname "$exe")"
- gcc \
+ cc \
${optionalString (libraries != [])
/* sh */ "$(pkg-config --cflags --libs ${
concatMapStringsSep " " escapeShellArg (attrNames libraries)
@@ -216,7 +216,9 @@ pkgs: oldpkgs: {
-Wall \
-x c \
"$textPath"
- strip --strip-unneeded "$exe"
+ ${optionalString (!pkgs.stdenv.hostPlatform.isDarwin) /* sh */ ''
+ strip --strip-unneeded "$exe"
+ ''}
'';
# Like writeScript but the first line is a shebang to dash