2023-01-11 07:51:40 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libuuid, cacert, Foundation, readline }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "premake5";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "5.0.0-beta2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "premake";
|
|
|
|
repo = "premake-core";
|
|
|
|
rev = "v${version}";
|
2023-01-11 07:51:40 +00:00
|
|
|
sha256 = "sha256-2R5gq4jaQsp8Ny1oGuIYkef0kn2UG9jMf20vq0714oY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = [ libuuid ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation readline ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [ ./no-curl-ca.patch ];
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
2023-01-11 07:51:40 +00:00
|
|
|
substituteInPlace contrib/curl/premake5.lua \
|
|
|
|
--replace "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'"
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace premake5.lua \
|
2024-06-05 15:53:02 +00:00
|
|
|
--replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5 \
|
|
|
|
--replace-fail '"-arch arm64"' '""' \
|
|
|
|
--replace-fail '"-arch x86_64"' '""'
|
2023-10-09 19:29:22 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isStatic ''
|
|
|
|
substituteInPlace \
|
|
|
|
binmodules/example/premake5.lua \
|
|
|
|
binmodules/luasocket/premake5.lua \
|
|
|
|
--replace SharedLib StaticLib
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase =
|
2024-09-26 11:04:55 +00:00
|
|
|
if stdenv.hostPlatform.isDarwin then ''
|
2020-04-24 23:36:52 +00:00
|
|
|
make -f Bootstrap.mak osx
|
|
|
|
'' else ''
|
|
|
|
make -f Bootstrap.mak linux
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
|
|
|
|
"-Wno-error=implicit-function-declaration"
|
|
|
|
]);
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 bin/release/premake5 $out/bin/premake5
|
|
|
|
'';
|
|
|
|
|
|
|
|
premake_cmd = "premake5";
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://premake.github.io";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Simple build configuration and project generation tool using lua";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "premake5";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.bsd3;
|
2023-02-02 18:25:31 +00:00
|
|
|
platforms = lib.platforms.darwin ++ lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|