Skip to content

Commit

Permalink
Merge pull request #315843 from wegank/premake5-darwin
Browse files Browse the repository at this point in the history
premake5: fix build on darwin
  • Loading branch information
risicle authored May 31, 2024
2 parents 5d06cdb + 5927193 commit 7b1f1fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkgs/development/tools/misc/premake/5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
'';
Expand All @@ -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;
};
}

0 comments on commit 7b1f1fb

Please sign in to comment.