summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Nickel2016-11-20 15:33:48 +0100
committerConstantin Nickel2016-11-20 17:26:19 +0100
commit311e1324484d5d58af26a183a5b30221e9eed9d9 (patch)
tree8eb24b14c438768abd54cb204d2eb26d67083cfb
downloadaur-311e1324484d5d58af26a183a5b30221e9eed9d9.tar.gz
initial commit
-rw-r--r--.SRCINFO34
-rw-r--r--PKGBUILD88
-rw-r--r--battle-isle-gog.desktop7
-rw-r--r--battle-isle-gog.install16
-rw-r--r--battle-isle-gog.sh88
-rw-r--r--dosbox_windowed.conf2
-rw-r--r--dosboxbi1_desert.conf9
-rw-r--r--dosboxbi1_main.conf9
-rw-r--r--dosboxbi1_moon.conf9
-rw-r--r--fix-console-output.patch11
-rw-r--r--fix-dosbox-mounts.patch30
-rw-r--r--fix-permissions.sh15
12 files changed, 318 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..3db574c64fe
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = battle-isle-gog
+ pkgdesc = A turn-based tactics game which tells the story about the wars on the fictional planet, Chromos.
+ pkgver = 2.2.0.21
+ pkgrel = 1
+ url = https://www.gog.com/game/battle_isle_platinum
+ install = battle-isle-gog.install
+ arch = any
+ groups = games
+ license = custom:eula
+ makedepends = innoextract
+ makedepends = icoutils
+ depends = dosbox
+ optdepends = unionfs-fuse: mounting game folder to home for savegames and settings
+ source = setup_battle_isle_2.2.0.21.exe::gogdownloader://battle_isle/installer_win_en
+ source = battle-isle-gog.desktop
+ source = battle-isle-gog.sh
+ source = dosboxbi1_main.conf
+ source = dosboxbi1_desert.conf
+ source = dosboxbi1_moon.conf
+ source = dosbox_windowed.conf
+ source = fix-dosbox-mounts.patch
+ source = fix-permissions.sh
+ sha256sums = f3886b2700bfa47c8f5d9bb4a888509c3bfc1df688b711a92e12c5a76354e711
+ sha256sums = 4b8d7b31fafefed19524cfd0fdf8a4f5a2761b1f173d6174859beab4e158003e
+ sha256sums = b6868126d238ab28c8a84f9a2c4591dc204b0aba1f6e7499e46523861b539399
+ sha256sums = 2d558ff949d959525a568089d08595b673cc5241bfa1ae130a423ce3b1b6ca36
+ sha256sums = a6cf2153a01f11ff2de01210db2739d36d4e6a4f93841b227df1d023ed953382
+ sha256sums = 7145cbfea303b682e415cfe020da23021ac5b04693a17fff74352c59556d40b1
+ sha256sums = 50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578
+ sha256sums = 33a8aaef4ac39dc93b1a4b28488c8c7531efde344570ae2e7691b530b9b83d9e
+ sha256sums = 7e54dbe4aa0c5050afb7459e0faa1e3cf5c8a3c6747cca834d3acd00941add54
+
+pkgname = battle-isle-gog
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..b6106b2d984
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,88 @@
+# Maintainer: Constantin Nickel <constantin dot nickel at gmail dot com>
+
+pkgname=battle-isle-gog
+pkgver=2.2.0.21
+pkgrel=1
+pkgdesc="A turn-based tactics game which tells the story about the wars on the fictional planet, Chromos."
+url="https://www.gog.com/game/battle_isle_platinum"
+license=('custom:eula')
+groups=('games')
+arch=('any')
+makedepends=('innoextract' 'icoutils')
+depends=('dosbox')
+optdepends=('unionfs-fuse: mounting game folder to home for savegames and settings')
+install=$pkgname.install
+
+source=("setup_battle_isle_$pkgver.exe"::"gogdownloader://battle_isle/installer_win_en"
+ "battle-isle-gog.desktop"
+ "battle-isle-gog.sh"
+ "dosboxbi1_main.conf"
+ "dosboxbi1_desert.conf"
+ "dosboxbi1_moon.conf"
+ "dosbox_windowed.conf"
+ "fix-console-output.patch"
+ "fix-dosbox-mounts.patch"
+ "fix-permissions.sh")
+
+sha256sums=('f3886b2700bfa47c8f5d9bb4a888509c3bfc1df688b711a92e12c5a76354e711'
+ '4b8d7b31fafefed19524cfd0fdf8a4f5a2761b1f173d6174859beab4e158003e'
+ 'b6868126d238ab28c8a84f9a2c4591dc204b0aba1f6e7499e46523861b539399'
+ '2d558ff949d959525a568089d08595b673cc5241bfa1ae130a423ce3b1b6ca36'
+ 'a6cf2153a01f11ff2de01210db2739d36d4e6a4f93841b227df1d023ed953382'
+ '7145cbfea303b682e415cfe020da23021ac5b04693a17fff74352c59556d40b1'
+ '50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578'
+ '1a11e5ecfdd602ce3412633bac3cfc6160a9b6039af407446d98000d34744ef6'
+ '557c175620829a0b63d8bd4933ed114d88d6d00f83cda9791332bf1e0e68ed0a'
+ '7e54dbe4aa0c5050afb7459e0faa1e3cf5c8a3c6747cca834d3acd00941add54')
+
+# You need to download the gog.com installer file to this directory ($PWD),
+# either manually or with lgogdownloader. You can also configure DLAGENTS in
+# makepkg.conf to auto-download.
+#
+# The following is just a fallback to the above to notify the user:
+DLAGENTS+=('gogdownloader::/usr/bin/awk BEGIN{print"Please\ download\ the\ file\ \\""\ substr("%o",1,length("%o")-5)\ "\\"\ manually\\nor\ setup\ a\ gogdownloader://\ DLAGENT\ in\ makepkg.conf!\ Read\ this\ PKGBUILD\ for\ more\ information.";exit\ 1}')
+
+prepare() {
+ # extract installer (convert files to lowercase, as DOS does not care)
+ innoextract -e -L -d "$srcdir" setup_battle_isle_$pkgver.exe
+ # convert icon
+ icotool -x app/goggame-1207660993.ico
+ # create launchers
+ sed "s|Exec=battle-isle|& --desert|;s|Name=Battle Isle|&: The Desert|" \
+ $pkgname.desktop > battle-isle-desert.desktop
+ sed "s|Exec=battle-isle|& --moon|;s|Name=Battle Isle|&: The Moon of Chromos|" \
+ $pkgname.desktop > battle-isle-moon.desktop
+ # remove bundled dosbox, windows stuff and gog client files
+ rm -rf app/{dosbox/,*.ico,*.dll,goggame-1207660993.*,*.zip,__support}
+ # fix broken console output
+ patch -p1 -i "$srcdir"/fix-console-output.patch
+ # fix mount directory
+ patch -p1 -i "$srcdir"/fix-dosbox-mounts.patch
+}
+
+package() {
+ # data
+ install -d "$pkgdir"/opt/battle-isle
+ cp -r app/* "$pkgdir"/opt/battle-isle
+ # fix permissions script
+ install -Dm755 fix-permissions.sh "$pkgdir"/opt/battle-isle
+ # additional dosbox configs
+ install -m644 dosbox_windowed.conf "$pkgdir"/opt/battle-isle
+ install -m644 dosboxbi1_main.conf "$pkgdir"/opt/battle-isle
+ install -m644 dosboxbi1_desert.conf "$pkgdir"/opt/battle-isle
+ install -m644 dosboxbi1_moon.conf "$pkgdir"/opt/battle-isle
+ # doc + licenses
+ install -d "$pkgdir"/usr/share/{doc,licenses}/$pkgname
+ for _f in app/*.pdf; do
+ ln -s -t "$pkgdir"/usr/share/doc/$pkgname "/opt/battle-isle/$(basename "$_f")"
+ done
+ install -m644 tmp/{gog_,}eula.txt "$pkgdir"/usr/share/licenses/$pkgname
+ # .desktop files and launchers
+ install -Dm644 $pkgname.desktop "$pkgdir"/usr/share/applications/battle-isle.desktop
+ install -Dm755 $pkgname.sh "$pkgdir"/usr/bin/battle-isle
+ for _m in desert moon; do
+ install -m644 battle-isle-$_m.desktop "$pkgdir"/usr/share/applications
+ done
+ # icon
+ install -Dm644 goggame-1207660993_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/battle-isle.png
+}
diff --git a/battle-isle-gog.desktop b/battle-isle-gog.desktop
new file mode 100644
index 00000000000..c14263c0793
--- /dev/null
+++ b/battle-isle-gog.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Battle Isle
+Exec=battle-isle
+Icon=battle-isle
+Categories=Game;
+Terminal=false
diff --git a/battle-isle-gog.install b/battle-isle-gog.install
new file mode 100644
index 00000000000..6ac45dda20b
--- /dev/null
+++ b/battle-isle-gog.install
@@ -0,0 +1,16 @@
+post_install() {
+ echo "In order to save or change settings you have to use the fix-permissions.sh"
+ echo "script or install 'unionfs-fuse' to get the game folder mounted in your home dir."
+ echo ""
+ echo "Fix permissions: The default group is 'games'"
+ echo "/opt/battle-isle/fix-permissions.sh [group]"
+ echo ""
+ echo "Unionfs:"
+ echo 'LOWER_DIR=/opt/battle-isle'
+ echo 'UPPER_DIR=$HOME/.gog/battle-isle/config'
+ echo 'UNION_DIR=$HOME/.gog/battle-isle/game'
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/battle-isle-gog.sh b/battle-isle-gog.sh
new file mode 100644
index 00000000000..e5cb881c451
--- /dev/null
+++ b/battle-isle-gog.sh
@@ -0,0 +1,88 @@
+#!/usr/bin/bash
+
+_help() {
+cat <<EOF
+ Usage: $script [options]
+ Options:
+ -h --help Show this message
+ --windowed Windowed mode
+ --single
+ --addon [desert|moon] Start addon The Desert or The Moon of Chromos
+ --desert Start Battle Isle: The Desert
+ --moon Start Battle Isle: The Moon of Chromos
+ Examples:
+
+ $script --windowed
+ $script --addon moon
+ $script --windowed --desert
+EOF
+ exit 0
+}
+
+pushd() { builtin pushd "$@" > /dev/null; }
+popd() { builtin popd > /dev/null; }
+
+INSTALL_DIR=/opt/battle-isle
+HOME_DIR="$HOME"/.gog/battle-isle
+
+if which unionfs &> /dev/null; then
+ USE_UNIONFS=1
+fi
+
+script=${0##*/}
+
+TEMP=$(getopt -o h --long help,windowed,single,addon:,moon,desert \
+ -n "$script" -- "$@")
+
+if [ $? != 0 ] ; then exit 1 ; fi
+
+eval set -- "$TEMP"
+
+while true; do
+ case "$1" in
+ -h|--help) _help; shift ;;
+ --windowed) WINDOWED=1; shift ;;
+ --single) START_SINGLE=1; shift ;;
+ --addon)
+ case "$2" in
+ desert) START_DESERT=1 ;;
+ moon) START_MOON=1 ;;
+ *) echo "Invalid value '$2' for $1. Valid values [desert,moon]"; exit 1;;
+ esac
+ shift 2 ;;
+ --desert) START_DESERT=1; shift ;;
+ --moon) START_MOON=1; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+configs=('-conf' 'dosboxbi1.conf')
+
+if [ "$WINDOWED" ]; then
+ configs+=('-conf' 'dosbox_windowed.conf')
+fi
+
+if [ "$START_SINGLE" ] ; then
+ configs+=('-conf' 'dosboxbi1_single.conf')
+elif [ "$START_DESERT" ] ; then
+ configs+=('-conf' 'dosboxbi1_desert.conf')
+elif [ "$START_MOON" ] ; then
+ configs+=('-conf' 'dosboxbi1_moon.conf')
+else
+ configs+=('-conf' 'dosboxbi1_main.conf')
+fi
+
+if [ "$USE_UNIONFS" ]; then
+ LOWER_DIR="$INSTALL_DIR"
+ UPPER_DIR="$HOME_DIR/config"
+ UNION_DIR="$HOME_DIR/game"
+ mkdir -p "$HOME_DIR"/{game,config}
+
+ unionfs -o cow,relaxed_permissions "$UPPER_DIR=RW:$LOWER_DIR=RO" "$UNION_DIR"
+ echo "Launching game within $UNION_DIR"
+ pushd "$UNION_DIR" && dosbox "${configs[@]}"
+ popd && fusermount -u "$UNION_DIR"
+else
+ echo "Launching game within $INSTALL_DIR"
+ cd $INSTALL_DIR && dosbox "${configs[@]}"
+fi
diff --git a/dosbox_windowed.conf b/dosbox_windowed.conf
new file mode 100644
index 00000000000..79c944cd3b8
--- /dev/null
+++ b/dosbox_windowed.conf
@@ -0,0 +1,2 @@
+[sdl]
+fullscreen=false \ No newline at end of file
diff --git a/dosboxbi1_desert.conf b/dosboxbi1_desert.conf
new file mode 100644
index 00000000000..4497d7fd872
--- /dev/null
+++ b/dosboxbi1_desert.conf
@@ -0,0 +1,9 @@
+[IPX]
+ipx=false
+
+[autoexec]
+mount c "desert"
+c:
+cls
+desert.exe
+exit
diff --git a/dosboxbi1_main.conf b/dosboxbi1_main.conf
new file mode 100644
index 00000000000..0b356771279
--- /dev/null
+++ b/dosboxbi1_main.conf
@@ -0,0 +1,9 @@
+[IPX]
+ipx=false
+
+[autoexec]
+mount c "isle"
+c:
+cls
+bi.exe
+exit
diff --git a/dosboxbi1_moon.conf b/dosboxbi1_moon.conf
new file mode 100644
index 00000000000..fd08a99dddb
--- /dev/null
+++ b/dosboxbi1_moon.conf
@@ -0,0 +1,9 @@
+[IPX]
+ipx=false
+
+[autoexec]
+mount c "moon"
+c:
+cls
+moon.exe
+exit
diff --git a/fix-console-output.patch b/fix-console-output.patch
new file mode 100644
index 00000000000..a95d22c28cf
--- /dev/null
+++ b/fix-console-output.patch
@@ -0,0 +1,11 @@
+diff --git a/app/dosboxbi1_single.conf b/app/dosboxbi1_single.conf
+--- a/app/dosboxbi1_single.conf
++++ b/app/dosboxbi1_single.conf
+@@ -3,6 +3,7 @@ ipx=false
+
+ [autoexec]
+ # Lines in this section will be run at startup.
++@echo off
+ cls
+ ECHO ษออออออออออออออออออออออออออออออออออออออออออออออออออออป
+ ECHO บ -------------------------------------------------- บ
diff --git a/fix-dosbox-mounts.patch b/fix-dosbox-mounts.patch
new file mode 100644
index 00000000000..8df305c4d9b
--- /dev/null
+++ b/fix-dosbox-mounts.patch
@@ -0,0 +1,30 @@
+diff --git a/app/dosboxbi1_single.conf b/app/dosboxbi1_single.conf
+--- a/app/dosboxbi1_single.conf
++++ b/app/dosboxbi1_single.conf
+@@ -25,7 +25,7 @@ if errorlevel 1 goto isle
+
+ :isle
+ cls
+-mount C "..\ISLE"
++mount C "isle"
+ c:
+ cls
+ bi.exe
+@@ -33,7 +33,7 @@ exit
+
+ :desert
+ cls
+-mount C "..\DESERT"
++mount C "desert"
+ c:
+ cls
+ DESERT.EXE
+@@ -41,7 +41,7 @@ exit
+
+ :moon
+ cls
+-mount C "..\MOON"
++mount C "moon"
+ c:
+ cls
+ MOON.EXE
diff --git a/fix-permissions.sh b/fix-permissions.sh
new file mode 100644
index 00000000000..92de5ead3f3
--- /dev/null
+++ b/fix-permissions.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/sh
+
+_group="${1:-games}"
+
+getent group $_group &> /dev/null
+
+if [ $? != 0 ]; then
+ echo "group '$_group' not found";
+ echo "${0##/} [group] default: games"
+ exit 1
+fi
+
+# fix permissions
+chgrp $_group /opt/battle-isle/{isle,desert,moon}
+chmod g+w /opt/battle-isle/{isle,desert,moon}