nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, Foundation, readline }:
2
3with lib;
4
5stdenv.mkDerivation rec {
6 pname = "premake5";
7 version = "5.0.0-alpha12";
8
9 src = fetchFromGitHub {
10 owner = "premake";
11 repo = "premake-core";
12 rev = "v${version}";
13 sha256 = "1h3hr96pdz94njn4bg02ldcz0k5j1x017d8svc7fdyvl2b77nqzf";
14 };
15
16 buildInputs = optionals stdenv.isDarwin [ Foundation readline ];
17
18 patchPhase = optional stdenv.isDarwin ''
19 substituteInPlace premake5.lua \
20 --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5
21 '';
22
23 buildPhase =
24 if stdenv.isDarwin then ''
25 make -f Bootstrap.mak osx
26 '' else ''
27 make -f Bootstrap.mak linux
28 '';
29
30 installPhase = ''
31 install -Dm755 bin/release/premake5 $out/bin/premake5
32 '';
33
34 premake_cmd = "premake5";
35 setupHook = ./setup-hook.sh;
36
37 meta = {
38 homepage = "https://premake.github.io";
39 description = "A simple build configuration and project generation tool using lua";
40 license = lib.licenses.bsd3;
41 platforms = platforms.darwin ++ platforms.linux;
42 };
43}