1 { lib, stdenv, fetchFromGitHub, libuuid, cacert, Foundation, readline }:
3 stdenv.mkDerivation rec {
5 version = "5.0.0-beta2";
7 src = fetchFromGitHub {
11 sha256 = "sha256-2R5gq4jaQsp8Ny1oGuIYkef0kn2UG9jMf20vq0714oY=";
14 buildInputs = [ libuuid ] ++ lib.optionals stdenv.isDarwin [ Foundation readline ];
16 patches = [ ./no-curl-ca.patch ];
18 substituteInPlace contrib/curl/premake5.lua \
19 --replace "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'"
20 '' + lib.optionalString stdenv.isDarwin ''
21 substituteInPlace premake5.lua \
22 --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5
23 '' + lib.optionalString stdenv.hostPlatform.isStatic ''
25 binmodules/example/premake5.lua \
26 binmodules/luasocket/premake5.lua \
27 --replace SharedLib StaticLib
31 if stdenv.isDarwin then ''
32 make -f Bootstrap.mak osx
34 make -f Bootstrap.mak linux
38 install -Dm755 bin/release/premake5 $out/bin/premake5
41 premake_cmd = "premake5";
42 setupHook = ./setup-hook.sh;
45 homepage = "https://premake.github.io";
46 description = "A simple build configuration and project generation tool using lua";
47 mainProgram = "premake5";
48 license = lib.licenses.bsd3;
49 platforms = lib.platforms.darwin ++ lib.platforms.linux;
50 broken = stdenv.isDarwin && stdenv.isAarch64;