Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, libuuid, cacert, Foundation, readline }:
2
3stdenv.mkDerivation rec {
4 pname = "premake5";
5 version = "5.0.0-beta2";
6
7 src = fetchFromGitHub {
8 owner = "premake";
9 repo = "premake-core";
10 rev = "v${version}";
11 sha256 = "sha256-2R5gq4jaQsp8Ny1oGuIYkef0kn2UG9jMf20vq0714oY=";
12 };
13
14 buildInputs = [ libuuid ] ++ lib.optionals stdenv.isDarwin [ Foundation readline ];
15
16 patches = [ ./no-curl-ca.patch ];
17 patchPhase = ''
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 '';
24
25 buildPhase =
26 if stdenv.isDarwin then ''
27 make -f Bootstrap.mak osx
28 '' else ''
29 make -f Bootstrap.mak linux
30 '';
31
32 installPhase = ''
33 install -Dm755 bin/release/premake5 $out/bin/premake5
34 '';
35
36 premake_cmd = "premake5";
37 setupHook = ./setup-hook.sh;
38
39 meta = {
40 homepage = "https://premake.github.io";
41 description = "A simple build configuration and project generation tool using lua";
42 license = lib.licenses.bsd3;
43 platforms = lib.platforms.darwin ++ lib.platforms.linux;
44 broken = stdenv.isDarwin && stdenv.isAarch64;
45 };
46}