premake: add setup-hook
Adds a configure phase for packages using premake. premakeConfigurePhase runs the correct premake version for the premake you are using (see premake_cmd).
This commit is contained in:
parent
2d2f85876a
commit
fd78464de9
@ -18,6 +18,9 @@ stdenv.mkDerivation {
|
|||||||
install -Dm755 bin/premake $out/bin/premake
|
install -Dm755 bin/premake $out/bin/premake
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
premake_cmd = "premake3";
|
||||||
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://industriousone.com/premake;
|
homepage = http://industriousone.com/premake;
|
||||||
description = "A simple build configuration and project generation tool using lua";
|
description = "A simple build configuration and project generation tool using lua";
|
||||||
|
@ -31,6 +31,9 @@ stdenv.mkDerivation rec {
|
|||||||
install -Dm755 bin/release/premake5 $out/bin/premake5
|
install -Dm755 bin/release/premake5 $out/bin/premake5
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
premake_cmd = "premake5";
|
||||||
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = https://premake.github.io;
|
homepage = https://premake.github.io;
|
||||||
description = "A simple build configuration and project generation tool using lua";
|
description = "A simple build configuration and project generation tool using lua";
|
||||||
|
@ -12,7 +12,7 @@ stdenv.mkDerivation {
|
|||||||
sha256 = "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn";
|
sha256 = "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ unzip ];
|
nativeBuildInputs = [ unzip ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
make -C build/gmake.unix/
|
make -C build/gmake.unix/
|
||||||
@ -22,11 +22,14 @@ stdenv.mkDerivation {
|
|||||||
install -Dm755 bin/release/premake4 $out/bin/premake4
|
install -Dm755 bin/release/premake4 $out/bin/premake4
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
premake_cmd = "premake4";
|
||||||
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://industriousone.com/premake;
|
homepage = http://industriousone.com/premake;
|
||||||
description = "A simple build configuration and project generation tool using lua";
|
description = "A simple build configuration and project generation tool using lua";
|
||||||
license = stdenv.lib.licenses.bsd3;
|
license = stdenv.lib.licenses.bsd3;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.unix;
|
||||||
maintainers = [ maintainers.bjornfor ];
|
maintainers = [ maintainers.bjornfor ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
19
pkgs/development/tools/misc/premake/setup-hook.sh
Normal file
19
pkgs/development/tools/misc/premake/setup-hook.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
premakeConfigurePhase() {
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
local flagsArray=(
|
||||||
|
${premakefile:+--file=$premakefile}
|
||||||
|
$premakeFlags ${premakeFlagsArray[@]}
|
||||||
|
${premakeBackend:-gmake}
|
||||||
|
)
|
||||||
|
|
||||||
|
echoCmd 'configure flags' "${flagsArray[@]}"
|
||||||
|
|
||||||
|
@premake_cmd@ "${flagsArray[@]}"
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "$configurePhase" ]; then
|
||||||
|
configurePhase=premakeConfigurePhase
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user