summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartynas Januškauskas2023-12-10 08:30:26 +0200
committerMartynas Januškauskas2023-12-10 09:12:15 +0200
commitbd936d3c3defd10c6ae461a41661f7966a034a9e (patch)
treed0ab874ac08aa456391ae90a1ad40a7e60aedca8
parente2f47ba328eb52d8aab20d24afb1a50b076b611d (diff)
downloadaur-bd936d3c3defd10c6ae461a41661f7966a034a9e.tar.gz
Fixed build error with a patch. Added desktop and icon files
-rw-r--r--PKGBUILD32
-rw-r--r--compile_errors_fix.patch26
-rw-r--r--fallout1-ce.desktop10
-rw-r--r--fallout1-ce.pngbin0 -> 1462 bytes
4 files changed, 62 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 6f9e4b269a9f..61ec85d61a23 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,44 @@
pkgname=fallout1-ce-game
_gitname=fallout1-ce
pkgver=1.0.0
-pkgrel=1
+pkgrel=2
pkgdesc="Fallout for modern operating systems"
arch=('x86_64')
url="https://github.com/alexbatalov/fallout1-ce"
license=('custom:SUL')
depends=('sdl2')
-source=("${_gitname}-${pkgver}.tar.gz::https://github.com/alexbatalov/${_gitname}/archive/refs/tags/v${pkgver}.tar.gz")
-sha256sums=('6005e36d160e2686ca42df613dadd3311b025b3dea062458e99e214cc2cc5ee1')
-
+source=("${_gitname}-${pkgver}.tar.gz::https://github.com/alexbatalov/${_gitname}/archive/refs/tags/v${pkgver}.tar.gz"
+ 'compile_errors_fix.patch'
+ 'fallout1-ce.png'
+ 'fallout1-ce.desktop')
+sha256sums=('6005e36d160e2686ca42df613dadd3311b025b3dea062458e99e214cc2cc5ee1'
+ 'b5b8ca0245875280d3257e610db9589bf8564ecb134dd1d7ee1727dd635f8ac4'
+ '821b17c6bf8d1dfce01b902257238ae64fa541fe37fcb21b2beff14430278ae2'
+ '6b3abc73a937f8165af5ca8606358a4bfbd203f2205d4405bb839baa044df13d')
build() {
cd "${_gitname}-${pkgver}"
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ./
+
+ echo $pkgdir
+
+ patch -p1 < ../compile_errors_fix.patch
+ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ./
make
}
package() {
cd "${_gitname}-${pkgver}"
DESTDIR="$pkgdir" cmake -P cmake_install.cmake --install build
-}
+ install -Dm 644 "$srcdir/fallout1-ce.png" "$pkgdir/usr/share/pixmaps/fallout1-ce.png"
+ install -Dm 644 "$srcdir/fallout1-ce.desktop" "$pkgdir/usr/share/applications/fallout1-ce1-ce.desktop"
+ install -Dm 755 "fallout-ce" "$pkgdir/var/games/fallout1-ce/fallout-ce"
+
+ echo
+ echo '==================================================================================='
+ echo 'Next, copy game data files to /var/games/fallout1-ce/'
+ echo 'WARNING: make sure CRITTER.DAT and MASTER.DAT files are in the same upper or lower case as they are in the fallout.cfg file. Otherwise you get an error indicating that files are not found'
+ echo 'See: https://github.com/alexbatalov/fallout1-ce#configuration'
+ echo '==================================================================================='
+ echo
+}
diff --git a/compile_errors_fix.patch b/compile_errors_fix.patch
new file mode 100644
index 000000000000..e34ee4f78258
--- /dev/null
+++ b/compile_errors_fix.patch
@@ -0,0 +1,26 @@
+diff --git a/src/game/protinst.cc b/src/game/protinst.cc
+index cdc6afc..09a2c48 100644
+--- a/src/game/protinst.cc
++++ b/src/game/protinst.cc
+@@ -959,7 +959,7 @@ static int protinst_default_use_item(Object* a1, Object* a2, Object* item)
+
+ messageListItem.num = 582;
+ if (message_search(&proto_main_msg_file, &messageListItem)) {
+- snprintf(formattedText, sizeof(formattedText), messageListItem.text);
++ strncpy(formattedText, messageListItem.text, sizeof(formattedText));
+ display_print(formattedText);
+ }
+ return -1;
+diff --git a/src/int/audio.cc b/src/int/audio.cc
+index f98eb2c..55d81a3 100644
+--- a/src/int/audio.cc
++++ b/src/int/audio.cc
+@@ -60,7 +60,7 @@ static int decodeRead(void* stream, void* buffer, unsigned int size)
+ int audioOpen(const char* fname, int flags)
+ {
+ char path[80];
+- snprintf(path, sizeof(path), fname);
++ strncpy(path, fname, sizeof(path));
+
+ int compression;
+ if (queryCompressedFunc(path)) {
diff --git a/fallout1-ce.desktop b/fallout1-ce.desktop
new file mode 100644
index 000000000000..fa05b6a4d12e
--- /dev/null
+++ b/fallout1-ce.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Categories=Game;RolePlaying;
+Encoding=UTF-8
+Name=Fallout 1 Community Edition
+Comment=
+Exec=/var/games/fallout1-ce/fallout-ce
+Path=/var/games/fallout1-ce
+Icon=fallout1-ce.png
+Terminal=False
diff --git a/fallout1-ce.png b/fallout1-ce.png
new file mode 100644
index 000000000000..f76572db9b12
--- /dev/null
+++ b/fallout1-ce.png
Binary files differ