diff options
author | Constantin Nickel | 2017-04-25 19:20:09 +0200 |
---|---|---|
committer | Constantin Nickel | 2017-04-25 19:20:09 +0200 |
commit | 8379f9377d91568b4fa932d6c4c3e7f2155783e7 (patch) | |
tree | 7f8805644e877f9cf434872bcfbd7065d9bee514 | |
download | aur-8379f9377d91568b4fa932d6c4c3e7f2155783e7.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 67 | ||||
-rw-r--r-- | dosbox_windowed.conf | 2 | ||||
-rw-r--r-- | fantasy-general-gog.desktop | 7 | ||||
-rw-r--r-- | fantasy-general-gog.install | 16 | ||||
-rw-r--r-- | fantasy-general-gog.sh | 71 | ||||
-rw-r--r-- | fix-dosbox-mounts.patch | 97 | ||||
-rw-r--r-- | fix-permissions.sh | 15 |
8 files changed, 303 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b06983e860c7 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = fantasy-general-gog + pkgdesc = A turn-based strategy game set in a high fantasy world. + pkgver = 2.0.0.3 + pkgrel = 1 + url = https://www.gog.com/game/fantasy_general + install = fantasy-general-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_fantasy_general_2.0.0.3.exe::gogdownloader://fantasy_general/installer_win_en + source = fantasy-general-gog.desktop + source = fantasy-general-gog.sh + source = dosbox_windowed.conf + source = fix-dosbox-mounts.patch + source = fix-permissions.sh + sha256sums = 8edd78a1ad6d8e0c0a5e2aae387a2945c6d0e85aa500acf6c41a32ec2a801484 + sha256sums = dccc8dd876353e3486db07bbed80e69a7e620374edc5de2dd7c9d91819a0ef03 + sha256sums = 636702307a43418d549aa5d27d0890927858b8977a3ff73fe823b4f423cca545 + sha256sums = 50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578 + sha256sums = 0afb0c1b03c813489025533723f360649d112d771f74034a4bc4ef2866116f63 + sha256sums = ed21a4119450a6648369826e1da44712e92bd629c77726e021dfd7f19515f146 + +pkgname = fantasy-general-gog + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..557d3bc4c825 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,67 @@ +# Maintainer: Constantin Nickel <constantin dot nickel at gmail dot com> + +pkgname=fantasy-general-gog +pkgver=2.0.0.3 +pkgrel=1 +pkgdesc="A turn-based strategy game set in a high fantasy world." +url="https://www.gog.com/game/fantasy_general" +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_fantasy_general_$pkgver.exe"::"gogdownloader://fantasy_general/installer_win_en" + "fantasy-general-gog.desktop" + "fantasy-general-gog.sh" + "dosbox_windowed.conf" + "fix-dosbox-mounts.patch" + "fix-permissions.sh") + +sha256sums=('8edd78a1ad6d8e0c0a5e2aae387a2945c6d0e85aa500acf6c41a32ec2a801484' + 'dccc8dd876353e3486db07bbed80e69a7e620374edc5de2dd7c9d91819a0ef03' + '636702307a43418d549aa5d27d0890927858b8977a3ff73fe823b4f423cca545' + '50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578' + '0afb0c1b03c813489025533723f360649d112d771f74034a4bc4ef2866116f63' + 'ed21a4119450a6648369826e1da44712e92bd629c77726e021dfd7f19515f146') + +# 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_fantasy_general_$pkgver.exe + # convert icon + icotool -x app/goggame-1430136345.ico + # remove bundled dosbox, windows stuff and gog client files + rm -rf app/{dosbox/,*.ico,*.dll,goggame-1430136345.*,*.zip,__support} + # fix mount directory + patch -p1 -i "$srcdir"/fix-dosbox-mounts.patch +} + +package() { + # data + install -d "$pkgdir"/opt/fantasy-general + cp -r app/* "$pkgdir"/opt/fantasy-general + # fix permissions script + install -Dm755 fix-permissions.sh "$pkgdir"/opt/fantasy-general + # additional dosbox configs + install -m644 dosbox_windowed.conf "$pkgdir"/opt/fantasy-general + # 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/fantasy-general/$(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/fantasy-general.desktop + install -Dm755 $pkgname.sh "$pkgdir"/usr/bin/fantasy-general + # icon + install -Dm644 goggame-1430136345_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/fantasy-general.png +} diff --git a/dosbox_windowed.conf b/dosbox_windowed.conf new file mode 100644 index 000000000000..79c944cd3b8f --- /dev/null +++ b/dosbox_windowed.conf @@ -0,0 +1,2 @@ +[sdl] +fullscreen=false
\ No newline at end of file diff --git a/fantasy-general-gog.desktop b/fantasy-general-gog.desktop new file mode 100644 index 000000000000..60be72ddc467 --- /dev/null +++ b/fantasy-general-gog.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Fantasy General +Exec=fantasy-general +Icon=fantasy-general +Categories=Game; +Terminal=false diff --git a/fantasy-general-gog.install b/fantasy-general-gog.install new file mode 100644 index 000000000000..52cff8753060 --- /dev/null +++ b/fantasy-general-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/fantasy-general/fix-permissions.sh [group]" + echo "" + echo "Unionfs:" + echo 'LOWER_DIR=/opt/fantasy-general' + echo 'UPPER_DIR=$HOME/.gog/fantasy-general/config' + echo 'UNION_DIR=$HOME/.gog/fantasy-general/game' +} + +post_upgrade() { + post_install +} diff --git a/fantasy-general-gog.sh b/fantasy-general-gog.sh new file mode 100644 index 000000000000..97972b16f18a --- /dev/null +++ b/fantasy-general-gog.sh @@ -0,0 +1,71 @@ +#!/usr/bin/bash + +_help() { +cat <<EOF + Usage: $script [options] + Options: + -h --help Show this message + --windowed Windowed mode + --settings + Examples: + + $script --windowed + $script --settings +EOF + exit 0 +} + +pushd() { builtin pushd "$@" > /dev/null; } +popd() { builtin popd > /dev/null; } + +INSTALL_DIR=/opt/fantasy-general +HOME_DIR="$HOME"/.gog/fantasy-general + +if which unionfs &> /dev/null; then + USE_UNIONFS=1 +fi + +script=${0##*/} + +TEMP=$(getopt -o h --long help,windowed,settings \ + -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 ;; + --settings) WINDOWED=1; START_SETTINGS=1; shift ;; + --) shift; break ;; + esac +done + +configs=('-conf' 'dosbox_fg.conf') + +if [ "$WINDOWED" ]; then + configs+=('-conf' 'dosbox_windowed.conf') +fi + +if [ "$START_SETTINGS" ] ; then + configs+=('-conf' 'dosbox_fg_settings.conf') +else + configs+=('-conf' 'dosbox_fg_single.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/fix-dosbox-mounts.patch b/fix-dosbox-mounts.patch new file mode 100644 index 000000000000..6e791c932c16 --- /dev/null +++ b/fix-dosbox-mounts.patch @@ -0,0 +1,97 @@ +diff --git a/app/dosbox_fg_settings.conf b/app/dosbox_fg_settings.conf +--- a/app/dosbox_fg_settings.conf ++++ b/app/dosbox_fg_settings.conf +@@ -9,8 +9,8 @@ ipx=false +
+ @echo off
+ cls
+-mount c ".."
+-imgmount d "..\game.ins" -t iso -fs iso
++mount c "."
++imgmount d "game.ins" -t iso -fs iso
+ c:
+ sound.bat
+ exit +\ No newline at end of file +diff --git a/app/dosbox_fg_single.conf b/app/dosbox_fg_single.conf +--- a/app/dosbox_fg_single.conf ++++ b/app/dosbox_fg_single.conf +@@ -9,8 +9,8 @@ ipx=false +
+ @echo off
+ cls
+-mount c ".."
+-imgmount d "..\game.ins" -t iso -fs iso
++mount c "."
++imgmount d "game.ins" -t iso -fs iso
+ c:
+ fg.bat
+ exit +\ No newline at end of file +diff --git a/app/game.ins b/app/game.ins +--- a/app/game.ins ++++ b/app/game.ins +@@ -1,48 +1,48 @@ + FILE "game.gog" BINARY + TRACK 01 MODE2/2352 + INDEX 01 00:00:00 +-FILE "MUSIC\Track02.ogg" MP3 ++FILE "music\track02.ogg" MP3 + TRACK 02 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track03.ogg" MP3 ++FILE "music\track03.ogg" MP3 + TRACK 03 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track04.ogg" MP3 ++FILE "music\track04.ogg" MP3 + TRACK 04 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track05.ogg" MP3 ++FILE "music\track05.ogg" MP3 + TRACK 05 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track06.ogg" MP3 ++FILE "music\track06.ogg" MP3 + TRACK 06 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track07.ogg" MP3 ++FILE "music\track07.ogg" MP3 + TRACK 07 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track08.ogg" MP3 ++FILE "music\track08.ogg" MP3 + TRACK 08 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track09.ogg" MP3 ++FILE "music\track09.ogg" MP3 + TRACK 09 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track10.ogg" MP3 ++FILE "music\track10.ogg" MP3 + TRACK 10 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track11.ogg" MP3 ++FILE "music\track11.ogg" MP3 + TRACK 11 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track12.ogg" MP3 ++FILE "music\track12.ogg" MP3 + TRACK 12 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track13.ogg" MP3 ++FILE "music\track13.ogg" MP3 + TRACK 13 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track14.ogg" MP3 ++FILE "music\track14.ogg" MP3 + TRACK 14 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track15.ogg" MP3 ++FILE "music\track15.ogg" MP3 + TRACK 15 AUDIO + INDEX 01 00:00:00 +-FILE "MUSIC\Track16.ogg" MP3 ++FILE "music\track16.ogg" MP3 + TRACK 16 AUDIO + INDEX 01 00:00:00 diff --git a/fix-permissions.sh b/fix-permissions.sh new file mode 100644 index 000000000000..89af48bc53f3 --- /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/fantasy-general/{dat/prefs.dat,saves} +chmod g+w /opt/fantasy-general/{dat/prefs.dat,saves} |