about summary refs log tree commit diff
path: root/pkgs/development/tools/misc/premake/setup-hook.sh
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-11-26 18:00:08 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2018-11-28 20:14:29 -0600
commitfd78464de91d5d64dda217397586996e0b7ff37f (patch)
treee92b770ec2159c039a294674fe1cbb69b5e1c65b /pkgs/development/tools/misc/premake/setup-hook.sh
parent2d2f85876ae4b4c794e07ccaa00cba4425c47449 (diff)
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).
Diffstat (limited to 'pkgs/development/tools/misc/premake/setup-hook.sh')
-rw-r--r--pkgs/development/tools/misc/premake/setup-hook.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/development/tools/misc/premake/setup-hook.sh b/pkgs/development/tools/misc/premake/setup-hook.sh
new file mode 100644
index 0000000000000..ba06ea2c76179
--- /dev/null
+++ b/pkgs/development/tools/misc/premake/setup-hook.sh
@@ -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