3
0
Fork 0
forked from mirrors/nixpkgs

tinycc: avoid replacing VERSION when it would cause errors

Still doesn't fix the general build of tinycc on darwin
This commit is contained in:
06kellyjac 2022-08-31 12:35:42 +01:00
parent de52d13612
commit 4e427c9df0

View file

@ -8,6 +8,10 @@
, which , 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 { stdenv.mkDerivation rec {
pname = "tcc"; pname = "tcc";
version = "unstable-2022-07-15"; version = "unstable-2022-07-15";
@ -62,7 +66,11 @@ stdenv.mkDerivation rec {
]; ];
preConfigure = '' 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)") configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)")
''; '';