diff options
author | oysstu | 2017-12-16 21:57:32 +0100 |
---|---|---|
committer | oysstu | 2017-12-16 21:57:32 +0100 |
commit | 3ef33acc1861702b5792798bf9474baedd85a537 (patch) | |
tree | 536523e8135ff5e2db380708c485456e226d257c | |
download | aur-3ef33acc1861702b5792798bf9474baedd85a537.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 61 | ||||
-rw-r--r-- | jazz-jackrabbit-2-secret-files.bash | 115 | ||||
-rw-r--r-- | jazz-jackrabbit-2-secret-files.desktop | 9 |
4 files changed, 203 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f93595ad6ac6 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = gog-jazz-jackrabbit-2-secret-files + pkgdesc = Jazz Jackrabbit 2 Collection. GOG version (Wine). + pkgver = 1.24hf_16886 + pkgrel = 1 + url = https://www.gog.com/game/jazz_jackrabbit_2_collection + arch = x86_64 + license = custom + makedepends = lgogdownloader>=2.25 + depends = wine + source = setup_jazz_jackrabbit_2_1.24hf_(16886).exe::gogdownloader://jazz_jackrabbit_2_secret_files/en1installer0 + source = jazz-jackrabbit-2-secret-files.bash + source = jazz-jackrabbit-2-secret-files.desktop + sha512sums = df6fc47abf24aaa1895df5f897f698b53865fdc499e2454e07b273eddc8fcdeeebe8fc2992292fb27e077da252d3d5728823ce6a2e83412c150fb8742a52116f + sha512sums = 6ebd8a384fde18daaa6fc2ae30e61ea64ad788aa5e99fc69c24e8a14d8222981dcd2ab61da223d9c9576eca897c14ddd6e78990fdcce83119623edc4e9749f1e + sha512sums = fe00e70800986a37b2b02bb175fe6589dd1f00f216b3c5c858d669f901b12b4022eda64e5c618d99767d01b16de9c70c77c17fc7c474dd52ff98e85d5726e13c + +pkgname = gog-jazz-jackrabbit-2-secret-files + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..052a5af850b4 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Oystein Sture <oysstu ät gmail dõt cóm> +# Contributor: + +pkgname=gog-jazz-jackrabbit-2-secret-files +gogver=1.24hf +gogrel=16886 + +pkgver=${gogver}_${gogrel} +pkgrel=1 +pkgbase=${pkgname} +pkgdesc='Jazz Jackrabbit 2 Collection. GOG version (Wine).' +arch=('x86_64') +url='https://www.gog.com/game/jazz_jackrabbit_2_collection' +license=('custom') + +_gamename=${pkgname#gog-} +_gamename=${_gamename//-/_} + +depends=('wine') +makedepends=('lgogdownloader>=2.25') +source=( + "setup_jazz_jackrabbit_2_${gogver}_(${gogrel}).exe::gogdownloader://${_gamename}/en1installer0" + "${pkgname#gog-}.bash" + "${pkgname#gog-}.desktop" +) +sha512sums=( + 'df6fc47abf24aaa1895df5f897f698b53865fdc499e2454e07b273eddc8fcdeeebe8fc2992292fb27e077da252d3d5728823ce6a2e83412c150fb8742a52116f' + '6ebd8a384fde18daaa6fc2ae30e61ea64ad788aa5e99fc69c24e8a14d8222981dcd2ab61da223d9c9576eca897c14ddd6e78990fdcce83119623edc4e9749f1e' + 'fe00e70800986a37b2b02bb175fe6589dd1f00f216b3c5c858d669f901b12b4022eda64e5c618d99767d01b16de9c70c77c17fc7c474dd52ff98e85d5726e13c' +) + +DLAGENTS+=('gogdownloader::/usr/bin/lgogdownloader --download-file=%u -o %o') + +# Prevent compressing final package +PKGEXT='.pkg.tar' + +prepare() { + cd "${srcdir}" + innoextract -c -m --progress=1 "setup_jazz_jackrabbit_2_${gogver}_(${gogrel}).exe" +} + +package() { + msg2 'Querying GOG ID' + _gog_id="$( innoextract -s --gog-game-id "setup_jazz_jackrabbit_2_${gogver}_(${gogrel}).exe")" + + msg2 'Packaging game icon' + install -Dm644 -T "${srcdir}/app/goggame-"${_gog_id?}".ico" "${pkgdir}/usr/share/pixmaps/${pkgname}.ico" + + msg2 'Packaging license' + install -Dm644 "${srcdir}/app/License.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + msg2 'Packaging game data' + mkdir -p "${pkgdir}/opt/${pkgname}" + mv -T "${srcdir}/app/" "${pkgdir}/opt/${pkgname}" + + msg2 'Packaging launcher' + install -Dm755 -T "${srcdir}/${pkgname#gog-}.bash" "${pkgdir}/usr/bin/${pkgname#gog-}" + + msg2 'Packaging desktop shortcut' + install -Dm644 "${srcdir}/${pkgname#gog-}.desktop" "${pkgdir}/usr/share/applications/${pkgname#gog-}.desktop" +} diff --git a/jazz-jackrabbit-2-secret-files.bash b/jazz-jackrabbit-2-secret-files.bash new file mode 100644 index 000000000000..ad8aaa43382c --- /dev/null +++ b/jazz-jackrabbit-2-secret-files.bash @@ -0,0 +1,115 @@ +#!/usr/bin/env bash +set -eu + +PKGNAME='gog-jazz-jackrabbit-2-secret-files' +APPNAME='Jazz Jackrabbit 2' +EXE="C:/GOG Games/${APPNAME}/Jazz2.exe" + +## +## Argument parsing (argbash.io) +## + +# Default arguments +_arg_fullscreen=off +_arg_resolution="1280x960" + +die() +{ + local _ret=$2 + test -n "$_ret" || _ret=1 + test "$_PRINT_HELP" = yes && print_help >&2 + echo "$1" >&2 + exit ${_ret} +} + +print_help () +{ + printf "%s\n" "The general script's help msg" + printf 'Usage: %s [--(no-)fullscreen] [-r|--resolution <arg>] [-h|--help]\n' "$0" + printf "\t%s\n" "--fullscreen,--no-fullscreen: Launch as fullscreen (off by default)" + printf "\t%s\n" "-r,--resolution: set the resolution (default: '"1280x960"')" + printf "\t%s\n" "-h,--help: Prints help" +} + +parse_commandline () +{ + while test $# -gt 0 + do + _key="$1" + case "$_key" in + --no-fullscreen|--fullscreen) + _arg_fullscreen="on" + test "${1:0:5}" = "--no-" && _arg_fullscreen="off" + ;; + -r|--resolution) + test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1 + _arg_resolution="$2" + shift + ;; + --resolution=*) + _arg_resolution="${_key##--resolution=}" + ;; + -r*) + _arg_resolution="${_key##-r}" + ;; + -h|--help) + print_help + exit 0 + ;; + -h*) + print_help + exit 0 + ;; + *) + _PRINT_HELP=yes die "FATAL ERROR: Got an unexpected argument '$1'" 1 + ;; + esac + shift + done +} + +parse_commandline "$@" + +## +## Setup wine and launch game +## +export WINEARCH='win32' +export WINEPREFIX=$HOME/.local/share/$PKGNAME/wine +export WINEDLLOVERRIDES="mscoree,mshtml=" # Skip mono, gecko +APPDIR_INSTALL=/opt/$PKGNAME +APPDIR_PARENT="${WINEPREFIX}/drive_c/GOG Games" +APPDIR_USER=$HOME/.local/share/$PKGNAME/user + +# Symlink install dir to user dir (to give write access) +if ! [ -d $APPDIR_USER ]; then + mkdir -p $APPDIR_USER + cp -as -T $APPDIR_INSTALL $APPDIR_USER +fi + + +echo >&2 "Setting up wine prefix" +if ! [ -d "${WINEPREFIX}" ]; then + ( + mkdir -pv "${WINEPREFIX}" + wineboot -i + rm -fv "${WINEPREFIX}/dosdevices/z:" + ) +fi + +echo >&2 "Setting up wine game directory" +if ! [ -d "${APPDIR_PARENT}/${APPNAME}" ]; then + ( + mkdir -pv "${APPDIR_PARENT}" + ln -fnsv "${APPDIR_USER}" "${APPDIR_PARENT}/${APPNAME}" + ) +fi + +if [ $_arg_fullscreen = "on" ]; then + echo >&2 "Launching ${APPNAME} via wine (fullscreen)" + wine "${EXE}" +else + echo >&2 "Launching ${APPNAME} via wine (windowed)" + wine explorer /desktop="JJ2",$_arg_resolution "${EXE}" /Windowed +fi + +echo >&2 "Finished" diff --git a/jazz-jackrabbit-2-secret-files.desktop b/jazz-jackrabbit-2-secret-files.desktop new file mode 100644 index 000000000000..c6fb03c8bb1a --- /dev/null +++ b/jazz-jackrabbit-2-secret-files.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Jazz Jackrabbit 2: The Secret Files +Version=1.24hf +Comment=Jazz Jackrabbit 2: The Secret Files (GOG.com, Wine) +Exec=/usr/bin/jazz-jackrabbit-2-secret-files +Icon=/usr/share/pixmaps/jazz-jackrabbit-2-secret-files.ico +Type=Application +StartupNotify=false +Categories=Game; |