diff --git a/srcpkgs/OpenJK/files/OpenJK.desktop b/srcpkgs/OpenJK/files/OpenJK.desktop new file mode 100644 index 00000000000000..e5c13c5c85d2cc --- /dev/null +++ b/srcpkgs/OpenJK/files/OpenJK.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=OpenJK Jedi Academy Single Player +Comment="Open Source Implementation of Jedi Knight II and III Engine - Jedi Academy Single Player" +Exec=openjk_sp +Icon=OpenJK +Terminal=false +StartupNotify=false +Categories=Game \ No newline at end of file diff --git a/srcpkgs/OpenJK/files/OpenJKMP.desktop b/srcpkgs/OpenJK/files/OpenJKMP.desktop new file mode 100644 index 00000000000000..04c25842f89eda --- /dev/null +++ b/srcpkgs/OpenJK/files/OpenJKMP.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=OpenJK Multi Player +Comment="Open Source Implementation of Jedi Knight II and III Engine - Multi Player" +Exec=openjk +Icon=OpenJK +Terminal=false +StartupNotify=false +Categories=Game \ No newline at end of file diff --git a/srcpkgs/OpenJK/files/OpenJO.desktop b/srcpkgs/OpenJK/files/OpenJO.desktop new file mode 100644 index 00000000000000..de1076371d3c94 --- /dev/null +++ b/srcpkgs/OpenJK/files/OpenJO.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=OpenJK Jedi Outcast +Comment="Open Source Implementation of Jedi Knight II and III Engine - Jedi Outcast" +Exec=openjo +Icon=OpenJK +Terminal=false +StartupNotify=false +Categories=Game \ No newline at end of file diff --git a/srcpkgs/OpenJK/files/README.voidlinux b/srcpkgs/OpenJK/files/README.voidlinux new file mode 100644 index 00000000000000..01d847cddab7a7 --- /dev/null +++ b/srcpkgs/OpenJK/files/README.voidlinux @@ -0,0 +1,12 @@ +OpenJK requires a copy of Jedi Knight: Jedi Academy. +You can also use this for Jedi Outcast (singleplayer only), which requires a copy as well. +The default folder that the game will search for files is + + Jedi Academy: ~/.local/share/openjk + Jedi Outcast: ~/.local/share/openjo + +You can easily link your game files by doing the following: + + cd ~/.local/share/openjk + mkdir base + ln -s /path/to/game/GameData/base/* base \ No newline at end of file diff --git a/srcpkgs/OpenJK/files/openjk b/srcpkgs/OpenJK/files/openjk new file mode 100644 index 00000000000000..c1ec24d3c55fcf --- /dev/null +++ b/srcpkgs/OpenJK/files/openjk @@ -0,0 +1,9 @@ +#! /bin/sh +OJ_ARCH=$(uname -m) +case "$OJ_ARCH" in + arm*) OJ_ARCH=arm;; + i*86*) OJ_ARCH=i386;; +esac + +cd /usr/lib/OpenJK/JediAcademy +exec ./openjk.${OJ_ARCH} "$@" diff --git a/srcpkgs/OpenJK/files/openjk_sp b/srcpkgs/OpenJK/files/openjk_sp new file mode 100644 index 00000000000000..78f6a756a185eb --- /dev/null +++ b/srcpkgs/OpenJK/files/openjk_sp @@ -0,0 +1,9 @@ +#! /bin/sh +OJ_ARCH=$(uname -m) +case "$OJ_ARCH" in + arm*) OJ_ARCH=arm;; + i*86*) OJ_ARCH=i386;; +esac + +cd /usr/lib/OpenJK/JediAcademy +exec ./openjk_sp.${OJ_ARCH} "$@" diff --git a/srcpkgs/OpenJK/files/openjkded b/srcpkgs/OpenJK/files/openjkded new file mode 100644 index 00000000000000..a9cc159803e7c9 --- /dev/null +++ b/srcpkgs/OpenJK/files/openjkded @@ -0,0 +1,9 @@ +#! /bin/sh +OJ_ARCH=$(uname -m) +case "$OJ_ARCH" in + arm*) OJ_ARCH=arm;; + i*86*) OJ_ARCH=i386;; +esac + +cd /usr/lib/OpenJK/JediAcademy +exec ./openjkded.${OJ_ARCH} "$@" diff --git a/srcpkgs/OpenJK/files/openjo b/srcpkgs/OpenJK/files/openjo new file mode 100644 index 00000000000000..7d831d4701c700 --- /dev/null +++ b/srcpkgs/OpenJK/files/openjo @@ -0,0 +1,9 @@ +#! /bin/sh +OJ_ARCH=$(uname -m) +case "$OJ_ARCH" in + arm*) OJ_ARCH=arm;; + i*86*) OJ_ARCH=i386;; +esac + +cd /usr/lib/OpenJK/JediOutcast +exec ./openjo_sp.${OJ_ARCH} "$@" diff --git a/srcpkgs/OpenJK/patches/fix-sdl2-cross-compile.patch b/srcpkgs/OpenJK/patches/fix-sdl2-cross-compile.patch new file mode 100644 index 00000000000000..2b7a8c387acf0d --- /dev/null +++ b/srcpkgs/OpenJK/patches/fix-sdl2-cross-compile.patch @@ -0,0 +1,34 @@ +--- a/code/CMakeLists.txt 2021-07-31 22:39:10.000000000 +0200 ++++ - 2021-09-26 21:18:25.041345027 +0200 +@@ -90,12 +90,8 @@ + ${OpenJKLibDir}/SDL2/include + ) + else() +- find_package(SDL2 REQUIRED CONFIG) +- if (TARGET SDL2::SDL2) +- set(SDL2_INCLUDE_DIRS "") +- set(SDL2_LIBRARIES SDL2::SDL2) +- endif() +- string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES) ++ include(FindPkgConfig) ++ pkg_search_module(SDL2 REQUIRED sdl2) + set(SPEngineIncludeDirectories ${SPEngineIncludeDirectories} ${SDL2_INCLUDE_DIRS}) + set(SPEngineLibraries ${SPEngineLibraries} ${SDL2_LIBRARIES}) + endif() +--- a/codemp/CMakeLists.txt 2021-07-31 22:39:10.000000000 +0200 ++++ - 2021-09-26 21:24:38.194600747 +0200 +@@ -396,12 +396,8 @@ + ${OpenJKLibDir}/SDL2/include + ) + else() +- find_package(SDL2 REQUIRED CONFIG) +- if (TARGET SDL2::SDL2) +- set(SDL2_INCLUDE_DIRS "") +- set(SDL2_LIBRARIES SDL2::SDL2) +- endif() +- string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES) ++ include(FindPkgConfig) ++ pkg_search_module(SDL2 REQUIRED sdl2) + set(MPEngineIncludeDirectories ${MPEngineIncludeDirectories} ${SDL2_INCLUDE_DIRS}) + set(MPEngineLibraries ${MPEngineLibraries} ${SDL2_LIBRARIES}) + endif() diff --git a/srcpkgs/OpenJK/template b/srcpkgs/OpenJK/template new file mode 100644 index 00000000000000..02175e5dceafd0 --- /dev/null +++ b/srcpkgs/OpenJK/template @@ -0,0 +1,34 @@ +# Template file for 'OpenJK' +pkgname=OpenJK +version=0.0.20210922 +revision=1 +_gitrev=43e9a3da555a487e23081bbd03101e7c926a1e83 +wrksrc="${pkgname}-${_gitrev}" +build_style=cmake +configure_args="-DCMAKE_INSTALL_PREFIX=/usr/lib/${pkgname} -DBuildJK2SPEngine=on + -DBuildJK2SPGame=on -DBuildJK2SPRdVanilla=on" +hostmakedepends="pkg-config" +makedepends="libjpeg-turbo-devel libpng-devel zlib-devel SDL2-devel" +short_desc="Open Source Implementation of Jedi Knight II and III Engine" +maintainer="Kenneth Dodrill " +license="GPL-2.0-only" +homepage="https://github.com/JACoders/OpenJK" +distfiles="https://github.com/JACoders/OpenJK/archive/${_gitrev}.tar.gz" +checksum=efd2e3d96fe449819c4276dfea7ae7d591591ee0e651167844110e073f2edb3c + +post_install() { + vbin "${FILESDIR}/openjk" + vbin "${FILESDIR}/openjk_sp" + vbin "${FILESDIR}/openjkded" + vbin "${FILESDIR}/openjo" + + vinstall "${FILESDIR}/OpenJK.desktop" 644 usr/share/applications + vinstall "${FILESDIR}/OpenJKMP.desktop" 644 usr/share/applications + vinstall "${FILESDIR}/OpenJO.desktop" 644 usr/share/applications + + for size in 16 32 64 128 1024; do + vinstall shared/icons/${pkgname}_Icon_${size}.png 644 usr/share/icons/hicolor/${size}x${size}/apps/ OpenJK.png + done + + vdoc "${FILESDIR}/README.voidlinux" +}