From 812065631397134a96747f7e8af44ad8767ffbf6 Mon Sep 17 00:00:00 2001 From: thfr Date: Thu, 14 Apr 2022 15:16:29 +0000 Subject: [PATCH] Re-add helper scripts libgdx-setup and libgdx-run. They were removed because of the change to multiversion support; with plan to roll out a different setup and launcher solution. However, as this is still not ready for widespread use, the (legacy) helper scripts will at least provide the previous functionality (limited to libgdx 1.9.11 in the scripts). Thanks to brynet@ who updated the scripts for this change. --- games/libgdx/1.9.11/Makefile | 6 ++++- games/libgdx/1.9.11/files/libgdx-run.sh | 11 ++++++++ games/libgdx/1.9.11/files/libgdx-setup.sh | 32 +++++++++++++++++++++++ games/libgdx/1.9.11/pkg/PLIST | 2 ++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 games/libgdx/1.9.11/files/libgdx-run.sh create mode 100644 games/libgdx/1.9.11/files/libgdx-setup.sh diff --git a/games/libgdx/1.9.11/Makefile b/games/libgdx/1.9.11/Makefile index 154e658c94c..0514cf21ad9 100644 --- a/games/libgdx/1.9.11/Makefile +++ b/games/libgdx/1.9.11/Makefile @@ -1,6 +1,10 @@ VERSION = 1.9.11 -REVISION = 4 +REVISION = 5 WANTLIB += ${COMPILER_LIBCXX} X11 m +post-install: + ${INSTALL_SCRIPT} ${FILESDIR}/libgdx-run.sh ${PREFIX}/bin/libgdx-run + ${INSTALL_SCRIPT} ${FILESDIR}/libgdx-setup.sh ${PREFIX}/bin/libgdx-setup + .include diff --git a/games/libgdx/1.9.11/files/libgdx-run.sh b/games/libgdx/1.9.11/files/libgdx-run.sh new file mode 100644 index 00000000000..87a9eb31c79 --- /dev/null +++ b/games/libgdx/1.9.11/files/libgdx-run.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# get mainClass from config.json +mainclass= +mainclass="$(cat config.json | grep mainClass | cut -d\" -f 4)" + +# TODO: get vmArgs from config.json +vmargs="-Xmx2G" + +TRUEPREFIX=/usr/local +JAVA_HOME=${TRUEPREFIX}/jdk-11 PATH=$PATH:$JAVA_HOME/bin java $vmargs $mainclass diff --git a/games/libgdx/1.9.11/files/libgdx-setup.sh b/games/libgdx/1.9.11/files/libgdx-setup.sh new file mode 100644 index 00000000000..7637015f14f --- /dev/null +++ b/games/libgdx/1.9.11/files/libgdx-setup.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +GDXVER=1.9.11 +GDXARCH= +if [ "$(uname -p)" = "amd64" ] ; then + GDXARCH=64 +fi + +TRUEPREFIX=/usr/local +JAVA_HOME=${TRUEPREFIX}/jdk-11 +PATH=$PATH:$JAVA_HOME/bin + +for i in $(ls *.jar); do + jar xvf $i +done + +for i in libgdx${GDXARCH}.so libgdx-controllers-desktop${GDXARCH}.so libgdx-freetype${GDXARCH}.so; do + if [ -f "$i" ] ; then + ln -sf ${TRUEPREFIX}/share/libgdx/${GDXVER}/$i + fi +done + +if [ -f "liblwjgl${GDXARCH}.so" ] ; then + ln -sf ${TRUEPREFIX}/share/lwjgl/liblwjgl${GDXARCH}.so +fi + +if [ -f "libopenal${GDXARCH}.so" ] ; then + ln -sf ${TRUEPREFIX}/lib/libopenal.so* libopenal${GDXARCH}.so # will fail if multiple libopenal.so versions exist +fi + +rm -rf com/badlogic +ln -sf ${TRUEPREFIX}/share/libgdx/${GDXVER}/com/badlogic com/badlogic diff --git a/games/libgdx/1.9.11/pkg/PLIST b/games/libgdx/1.9.11/pkg/PLIST index 39b085c9e45..fed6f986f59 100644 --- a/games/libgdx/1.9.11/pkg/PLIST +++ b/games/libgdx/1.9.11/pkg/PLIST @@ -1,6 +1,8 @@ @option no-default-conflict @option is-branch @pkgpath games/libgdx +bin/libgdx-run +bin/libgdx-setup share/libgdx/ share/libgdx/1.9.11/ share/libgdx/1.9.11/com/