summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudia2017-10-08 21:26:29 +0200
committerClaudia Pellegrino2017-10-08 21:27:44 +0200
commitd6e20c0185835219e910bf60e7d0e57300544514 (patch)
tree1a050bd12c94157ff475a63021b0d47a35fe3d30
downloadaur-d6e20c0185835219e910bf60e7d0e57300544514.tar.gz
Initial commit
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD56
-rw-r--r--gog-cuphead.install30
-rwxr-xr-xlaunch_gog-cuphead.bash74
4 files changed, 185 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..4dd16296e156
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = gog-cuphead
+ pkgdesc = Contra-esque action game with retro cartoon visuals. GOG version, uses Wine.
+ pkgver = 20170929.15295
+ pkgrel = 1
+ url = https://www.gog.com/game/cuphead
+ install = gog-cuphead.install
+ arch = x86_64
+ license = custom
+ makedepends = innoextract
+ makedepends = lgogdownloader
+ depends = wine
+ depends = wine-mono
+ depends = wine_gecko
+ options = libtool
+ options = staticlibs
+ options = !strip
+ source = setup_cuphead_20170929_(15295).exe::gogdownloader://cuphead/en1installer1
+ source = setup_cuphead_20170929_(15295)-1.bin::gogdownloader://cuphead/en1installer2
+ source = launch_gog-cuphead.bash
+ sha512sums = e4f7f068b1a62d3854e1f7cba83b46efb9eb1020e93f3638caa745c0241e6699e6a801fb8fe80b690545113428839a84fa385c9533eeeab2a0ea3a7ee78907b5
+ sha512sums = c9fc8aa7d3287181f63ebc5e087eff132a513f5612821e1def992498e7b16723aaa25a2bb016ccb6a282e89c27f854ee496cbf6f065d4df2d8944c180fc23e4b
+ sha512sums = 5d929d62e2e9105252cdbf6d4d31b2b342844250a42abb35dccddf5fc900b251f60d4bec30488d5f811cb3bd85eda95cbf40109d72d951a678344107b5794c91
+
+pkgname = gog-cuphead
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f05f09264b9d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,56 @@
+# Maintainer: Claudia Pellegrino <aur ät cpellegrino.de>
+# Contributor:
+
+pkgname=gog-cuphead
+pkgver=20170929.15295
+pkgrel=1
+pkgdesc='Contra-esque action game with retro cartoon visuals. GOG version, uses Wine.'
+arch=('x86_64')
+url='https://www.gog.com/game/cuphead'
+license=('custom')
+depends=('wine' 'wine-mono' 'wine_gecko')
+makedepends=('innoextract' 'lgogdownloader')
+options=('libtool' 'staticlibs' '!strip')
+install="${pkgname}.install"
+source=(
+ "setup_cuphead_${pkgver%.*}_(${pkgver#*.}).exe`
+ `::gogdownloader://${pkgname#gog-}/en1installer1"
+ "setup_cuphead_${pkgver%.*}_(${pkgver#*.})-1.bin`
+ `::gogdownloader://${pkgname#gog-}/en1installer2"
+ 'launch_gog-cuphead.bash'
+)
+sha512sums=(
+ 'e4f7f068b1a62d3854e1f7cba83b46efb9eb1020e93f3638caa745c0241e6699e6a801fb8fe80b690545113428839a84fa385c9533eeeab2a0ea3a7ee78907b5'
+ 'c9fc8aa7d3287181f63ebc5e087eff132a513f5612821e1def992498e7b16723aaa25a2bb016ccb6a282e89c27f854ee496cbf6f065d4df2d8944c180fc23e4b'
+ '5d929d62e2e9105252cdbf6d4d31b2b342844250a42abb35dccddf5fc900b251f60d4bec30488d5f811cb3bd85eda95cbf40109d72d951a678344107b5794c91'
+)
+DLAGENTS+=('gogdownloader::/usr/bin/lgogdownloader --download-file=%u -o %o')
+PKGEXT=.pkg.tar
+
+prepare() {
+ cd "${srcdir}"
+ innoextract -c -m --progress=1 \
+ "setup_cuphead_${pkgver%.*}_(${pkgver#*.}).exe"
+}
+
+package() {
+ msg2 'Querying GOG ID'
+ _gog_id="$(
+ innoextract -s --gog-game-id \
+ "${srcdir}/setup_cuphead_${pkgver%.*}_(${pkgver#*.}).exe"
+ )"
+
+ msg2 'Packaging game icon'
+ install -D -m 644 -T \
+ "${srcdir}/app/goggame-"${_gog_id?}".ico" \
+ "${pkgdir}/usr/share/pixmaps/${pkgname}.ico"
+
+ msg2 'Packaging game data'
+ mkdir -p "${pkgdir}/opt/${pkgname}"
+ mv -t "${pkgdir}/opt/${pkgname}" "${srcdir}/app"
+
+ msg2 'Packaging launcher'
+ install -D -m 755 -T \
+ "${srcdir}/launch_${pkgname}.bash" \
+ "${pkgdir}/usr/bin/${pkgname#gog-}"
+}
diff --git a/gog-cuphead.install b/gog-cuphead.install
new file mode 100644
index 000000000000..f38cd8f15f4d
--- /dev/null
+++ b/gog-cuphead.install
@@ -0,0 +1,30 @@
+post_install() {
+ cat >&2 << 'EOF'
+
+ ## ##
+ ## Wine will be used to run this Windows game; ##
+ ## therefore, not everything may work properly. ##
+ ## ##
+ ## Please see: ##
+
+> https://appdb.winehq.org/objectManager.php?sClass=version&iId=35835
+
+ ## for details and known limitations. ##
+ ## ##
+
+EOF
+}
+
+post_remove() {
+ cat >&2 << 'EOF'
+
+ ## ##
+ ## To completely remove user game data, delete ##
+ ## the following directories: ##
+ ## ##
+ ## ~/.config/gog-cuphead ##
+ ## ~/.local/share/gog-cuphead ##
+ ## ##
+
+EOF
+}
diff --git a/launch_gog-cuphead.bash b/launch_gog-cuphead.bash
new file mode 100755
index 000000000000..037f9ec2ea0f
--- /dev/null
+++ b/launch_gog-cuphead.bash
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+set -eu
+
+PKGNAME='gog-cuphead'
+APPNAME_UPSTREAM='Cuphead'
+EXE="C:/GOG Games/${APPNAME_UPSTREAM}/Cuphead.exe"
+
+echo >&2 "Initializing"
+
+export WINEARCH='win64'
+export WINEPREFIX=~/".local/share/${PKGNAME}/wine"
+
+APPDIR_SOURCE="/opt/${PKGNAME}/app"
+APPDIR_PARENT="${WINEPREFIX}/drive_c/GOG Games"
+
+USER_APPDATADIR_SOURCE=~/".config/${PKGNAME}/userappdata"
+USER_APPDATADIR_TARGET="${WINEPREFIX}/drive_c/users/$(whoami)`
+ `/Application Data"
+USER_LOGDIR=~/".local/share/${PKGNAME}/log"
+
+USER_LOGFILE_STDOUT="${USER_LOGDIR}/${PKGNAME}_out.log"
+USER_LOGFILE_STDERR="${USER_LOGDIR}/${PKGNAME}_err.log"
+
+mkdir -p "${USER_LOGDIR}"
+: > "${USER_LOGFILE_STDOUT}"
+: > "${USER_LOGFILE_STDERR}"
+
+echo >&2 "Logging stdout to: ${USER_LOGFILE_STDOUT}"
+echo >&2 "Logging stderr to: ${USER_LOGFILE_STDERR}"
+echo >&2 "Checking for Wine prefix"
+
+if ! [ -d "${WINEPREFIX}" ]; then
+ echo >&2 "==> Bootstrapping Wine prefix"
+ (
+ mkdir -pv "${WINEPREFIX}"
+ wineboot -i
+ rm -fv "${WINEPREFIX}/dosdevices/z:"
+ ) >> "${USER_LOGFILE_STDOUT}" 2>> "${USER_LOGFILE_STDERR}"
+ echo >&2 "==> Done"
+fi
+
+mkdir -p "${USER_APPDATADIR_SOURCE}/${APPNAME_UPSTREAM}"
+
+echo >&2 "Checking user data directory"
+
+if ! [ -h "${USER_APPDATADIR_TARGET}/${APPNAME_UPSTREAM}" ]; then
+ echo >&2 "==> Creating symlink to user data directory"
+ (
+ mkdir -pv "${USER_APPDATADIR_TARGET}"
+ cd "${USER_APPDATADIR_TARGET}"
+ ln -fnsv ../../../../../../../..`
+ `/".config/${PKGNAME}/userappdata/${APPNAME_UPSTREAM}"
+ ) >> "${USER_LOGFILE_STDOUT}" 2>> "${USER_LOGFILE_STDERR}"
+ echo >&2 "==> Done"
+fi
+
+echo >&2 "Checking app directory"
+
+if ! [ -d "${APPDIR_PARENT}/${APPNAME_UPSTREAM}" ]; then
+ echo >&2 "==> Creating symlink to app directory"
+ (
+ mkdir -pv "${APPDIR_PARENT}"
+ ln -fnsv "${APPDIR_SOURCE}" \
+ "${APPDIR_PARENT}/${APPNAME_UPSTREAM}"
+ ) >> "${USER_LOGFILE_STDOUT}" 2>> "${USER_LOGFILE_STDERR}"
+ echo >&2 "==> Done"
+fi
+
+echo >&2 "Launching ${APPNAME_UPSTREAM} via Wine"
+
+wine "${EXE}" \
+ >> "${USER_LOGFILE_STDOUT}" 2>> "${USER_LOGFILE_STDERR}"
+
+echo >&2 "==> Finished"