premake5: fix build on darwin

This commit is contained in:
Weijia Wang 2024-05-30 11:26:27 +02:00
parent 3892ca21ff
commit 5927193083

View File

@ -19,7 +19,9 @@ stdenv.mkDerivation rec {
--replace "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'"
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace premake5.lua \
--replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5
--replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5 \
--replace-fail '"-arch arm64"' '""' \
--replace-fail '"-arch x86_64"' '""'
'' + lib.optionalString stdenv.hostPlatform.isStatic ''
substituteInPlace \
binmodules/example/premake5.lua \
@ -34,6 +36,10 @@ stdenv.mkDerivation rec {
make -f Bootstrap.mak linux
'';
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
"-Wno-error=implicit-function-declaration"
]);
installPhase = ''
install -Dm755 bin/release/premake5 $out/bin/premake5
'';
@ -47,6 +53,5 @@ stdenv.mkDerivation rec {
mainProgram = "premake5";
license = lib.licenses.bsd3;
platforms = lib.platforms.darwin ++ lib.platforms.linux;
broken = stdenv.isDarwin && stdenv.isAarch64;
};
}