summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
author06kellyjac <dev@j-k.io>2022-08-31 12:35:42 +0100
committer06kellyjac <dev@j-k.io>2022-09-02 12:47:36 +0100
commit4e427c9df0f1d021a8d7dc0437f73d9582b21c67 (patch)
tree92d8c01cee57697b5b8464865a3fccd2bd9ee174 /pkgs
parentde52d13612ccb7dd36c578e94e68f5e5d876b238 (diff)
tinycc: avoid replacing VERSION when it would cause errors
Still doesn't fix the general build of tinycc on darwin
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/tinycc/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix
index 97a86a3fa783..21eb497a116a 100644
--- a/pkgs/development/compilers/tinycc/default.nix
+++ b/pkgs/development/compilers/tinycc/default.nix
@@ -8,6 +8,10 @@
, which
}:
+let
+ # avoid "malformed 32-bit x.y.z" error on mac when using clang
+ isCleanVer = version: builtins.match "^[0-9]\\.+[0-9]+\\.[0-9]+" version != null;
+in
stdenv.mkDerivation rec {
pname = "tcc";
version = "unstable-2022-07-15";
@@ -62,7 +66,11 @@ stdenv.mkDerivation rec {
];
preConfigure = ''
- echo ${version} > VERSION
+ ${
+ if stdenv.isDarwin && ! isCleanVer version
+ then "echo 'not overwriting VERSION since it would upset ld'"
+ else "echo ${version} > VERSION"
+ }
configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)")
'';