summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD27
-rw-r--r--get_asset_path.patch38
3 files changed, 55 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6338577a3765..f8bd2fbe475a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,18 @@
pkgbase = openglad-git
pkgdesc = SDL port of the hack-n-slash DOS game Gladiator
- pkgver = r924.1080efb
+ pkgver = r935.e39b7ef
pkgrel = 1
- url = http://www.openglad.org
+ url = https://github.com/openglad/openglad
arch = i686
arch = x86_64
license = GPL
- makedepends = premake4
+ makedepends = premake
depends = sdl2
depends = sdl2_mixer
depends = libpng
source = openglad-git::git+https://github.com/openglad/openglad.git
- sha256sums = SKIP
+ source = get_asset_path.patch
+ sha512sums = SKIP
+ sha512sums = f7622ccd389ad9ad4c57967ac7d9e3fc758e3291ee1d38ea3cebc4d857a6e7b71fbab28a97488b8e2a7da7047f50b1fb949e0536046ad155cf62c52ea948b320
pkgname = openglad-git
-
diff --git a/PKGBUILD b/PKGBUILD
index e403b3cb1400..325eb5fb843f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,16 +1,16 @@
# Maintainer: Maxwell Anselm <silverhammermba+aur@gmail.com>
pkgname=openglad-git
-pkgver=r924.1080efb
+pkgver=r935.e39b7ef
pkgrel=1
pkgdesc="SDL port of the hack-n-slash DOS game Gladiator"
arch=('i686' 'x86_64')
-url="http://www.openglad.org"
+url="https://github.com/openglad/openglad"
license=('GPL')
depends=('sdl2' 'sdl2_mixer' 'libpng')
-makedepends=('premake4')
-source=("$pkgname::git+https://github.com/openglad/openglad.git")
-sha256sums=('SKIP')
+makedepends=('premake')
+source=("$pkgname::git+https://github.com/openglad/openglad.git" 'get_asset_path.patch')
+sha512sums=('SKIP' 'f7622ccd389ad9ad4c57967ac7d9e3fc758e3291ee1d38ea3cebc4d857a6e7b71fbab28a97488b8e2a7da7047f50b1fb949e0536046ad155cf62c52ea948b320')
pkgver() {
cd "$pkgname"
@@ -20,28 +20,23 @@ pkgver() {
prepare() {
cd "$srcdir/$pkgname"
+ # hard-code /usr/share/openglad as asset path
+ patch --strip=1 --input=../get_asset_path.patch
+
# remove SDL2main lib
sed -i -- 's/"SDL2main", //g' premake4.lua
-
- # fix conflicting filenames
- mv src/parser.cpp src/oparser.cpp
- mv src/parser.h src/oparser.h
- mv src/loader.cpp src/oloader.cpp
- mv src/loader.h src/oloader.h
- find src -maxdepth 1 -type f -exec sed -i -- 's/"parser.h"/"oparser.h"/g' {} \;
- find src -maxdepth 1 -type f -exec sed -i -- 's/"loader.h"/"oloader.h"/g' {} \;
}
build() {
cd "$srcdir/$pkgname"
- premake4 --includedirs=/usr/include/SDL2 gmake
- make
+ premake5 --includedirs=/usr/include/SDL2 gmake
+ make config=release
}
package() {
cd "$srcdir/$pkgname"
- install -Dm755 openglad "$pkgdir/usr/bin/openglad"
+ install -Dm755 bin/Release/openglad "$pkgdir/usr/bin/openglad"
install -d "$pkgdir/usr/share/openglad"
cp -dr --no-preserve=ownership {pix,sound,cfg,builtin} "$pkgdir/usr/share/openglad"
diff --git a/get_asset_path.patch b/get_asset_path.patch
new file mode 100644
index 000000000000..8900b28eb0c8
--- /dev/null
+++ b/get_asset_path.patch
@@ -0,0 +1,38 @@
+diff --unified --recursive --text openglad-git/src/io.cpp openglad-git.new/src/io.cpp
+--- openglad-git/src/io.cpp 2023-12-09 13:04:23.217310511 -0500
++++ openglad-git.new/src/io.cpp 2023-12-09 13:05:39.431303642 -0500
+@@ -108,33 +108,7 @@
+
+ std::string get_asset_path()
+ {
+-#ifdef ANDROID
+- // RWops will look in the app's assets directory for this path
+- return "";
+-#elif defined(__IPHONEOS__)
+- // Assuming the cwd is set to the program's installation directory
+- return "";
+-#elif defined(WIN32)
+- // Assuming the cwd is set to the program's installation directory
+- return "";
+-#else
+- // Assumes UNIX with /proc
+- char path[512];
+- int maxPathSize = 512;
+- memset(path, 0, maxPathSize);
+- readlink("/proc/self/exe", path, maxPathSize);
+- path[maxPathSize-1] = '\0';
+- std::string s = path;
+- size_t slash = s.find_last_of('/');
+- if(slash != std::string::npos)
+- {
+- s = s.substr(0, slash);
+- }
+- s += '/';
+-
+- printf("get_asset_path: %s\n", s.c_str());
+- return s;
+-#endif
++ return "/usr/share/openglad/";
+ }
+
+ SDL_RWops* open_read_file(const char* file, bool debug)