summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Beste2017-01-29 22:29:11 -0600
committerDan Beste2017-01-29 22:36:23 -0600
commitb7273547d6a984590aa935705ab8aa32d484aae4 (patch)
tree645c0a13cc70c13e2fa5b9b466c9963ef07645ca
parent661a9773157beee1fd9cef340aea621ba2673b71 (diff)
downloadaur-b7273547d6a984590aa935705ab8aa32d484aae4.tar.gz
Initial cleanup
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD128
-rw-r--r--configurator5
-rw-r--r--gog-the-witcher-2-assassins-of-kings26
-rw-r--r--gog-the-witcher-2-assassins-of-kings.desktop10
-rw-r--r--gog-the-witcher-2-configurator.desktop9
6 files changed, 145 insertions, 65 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 775a3874217..df7dedac96a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,28 @@
pkgbase = gog-the-witcher-2-assassins-of-kings
- pkgdesc = The second installment in the RPG saga about the Witcher, Geralt of Rivia. GOG version (Linux installer).
- pkgver = 1.2.0.7
+ pkgdesc = Enjoy a captivating story, dynamic combat system and beautiful graphics in the second installment in the RPG saga about the Witcher, Geralt of Rivia.
+ pkgver = 2.2.0.8
pkgrel = 1
- url = http://www.gog.com/game/the_witcher_2
+ url = http://thewitcher.com/en/witcher2
arch = i686
arch = x86_64
groups = games
+ groups = gog
license = custom
- depends = lib32-sdl2
- depends = lib32-freetype2
- depends = lib32-sdl2_image
- depends = lib32-gtk2
- source = local://gog_the_witcher_2_assassins_of_kings_1.2.0.7.tar.gz
+ depends = freetype2
+ depends = gtk2
+ depends = sdl2
+ depends = sdl2_image
+ noextract = gog_the_witcher_2_assassins_of_kings_enhanced_edition_2.2.0.8.sh
+ source = gog://gog_the_witcher_2_assassins_of_kings_enhanced_edition_2.2.0.8.sh
source = gog-the-witcher-2-assassins-of-kings
- source = gog-the-witcher-2-configurator.desktop
- source = configurator
- sha256sums = 9139bae265de692b5b3bbe9466ca7eff3b006f7a51e2df13cf2d86b2b247fadf
- sha256sums = ece02677bb029e69f8248018873fbfec34f9f6eb43f42966842f4f9ac80e83f0
- sha256sums = 52344cc8e6dfdef1034658412ba4cdc3fd56064762675f2a39403d21276851b7
- sha256sums = 31d9f5e327f18eadb1a2a6825e2c773de22b2d6594451649edb95c5c968bf26e
+ source = gog-the-witcher-2-assassins-of-kings.desktop
+ sha256sums = 6d6f519db92fe38219b9bb62a6d2dfff0a93e5c24f73cf69ba7d05071361f586
+ sha256sums = 32fd021d75ad3ed9e55e97b34d5ee08c2bde469028ddee410f933290d2998731
+ sha256sums = 9f56e0b94fcd60a179a158dac27051c526f0f27b2ebe4224ca68d6ecafee7d47
+ depends_i686 = lib32-freetype2
+ depends_i686 = lib32-gtk2
+ depends_i686 = lib32-sdl2
+ depends_i686 = lib32-sdl2_image
pkgname = gog-the-witcher-2-assassins-of-kings
diff --git a/PKGBUILD b/PKGBUILD
index 43e04d4fba1..c5bc748a371 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,40 +1,100 @@
+# Maintainer: Dan Beste <dan.ray.beste@gmail.com>
+
+# Previous maintainers:
# Maintainer : André Fettouhi <a.fettouhi@gmail.com>
# Contributor: mirandir <mirandir[at)orange(dot]com>
+# TODO
+# 1. Get the game working.
+# The game is currently unplayable. The launcher will boot, however the
+# game crashes when attempting to launch the game. I don't have too much
+# time to look into this _yet_, but some stracing may go a long way...
+
pkgname=gog-the-witcher-2-assassins-of-kings
-pkgver=1.2.0.7
+pkgver=2.2.0.8
pkgrel=1
-pkgdesc="The second installment in the RPG saga about the Witcher, Geralt of Rivia. GOG version (Linux installer)."
-arch=("i686" "x86_64")
-
-if [[ $CARCH == i686 ]]; then
- depends=(sdl2 freetype2 sdl2_image gtk2)
-else
- depends=(lib32-sdl2 lib32-freetype2 lib32-sdl2_image lib32-gtk2)
-fi
-
-url="http://www.gog.com/game/the_witcher_2"
-license=("custom")
-groups=("games")
-source=("local://gog_the_witcher_2_assassins_of_kings_${pkgver}.tar.gz" "gog-the-witcher-2-assassins-of-kings" "gog-the-witcher-2-configurator.desktop" "configurator")
-sha256sums=('9139bae265de692b5b3bbe9466ca7eff3b006f7a51e2df13cf2d86b2b247fadf'
- 'ece02677bb029e69f8248018873fbfec34f9f6eb43f42966842f4f9ac80e83f0'
- '52344cc8e6dfdef1034658412ba4cdc3fd56064762675f2a39403d21276851b7'
- '31d9f5e327f18eadb1a2a6825e2c773de22b2d6594451649edb95c5c968bf26e')
-PKGEXT=.pkg.tar
-
-package() {
- mkdir -p "${pkgdir}"/opt/gog/the-witcher-2-assassins-of-kings/
-
- mv "${srcdir}"/The\ Witcher\ 2\ Assassins\ Of\ Kings/* "${pkgdir}"/opt/gog/the-witcher-2-assassins-of-kings/
-
- install -Dm644 "${pkgdir}"/opt/gog/the-witcher-2-assassins-of-kings/support/gog-the-witcher-2-assassins-of-kings-primary.desktop "${pkgdir}"/usr/share/applications/gog-the-witcher-2-assassins-of-kings.desktop
- install -Dm644 "${pkgdir}"/opt/gog/the-witcher-2-assassins-of-kings/support/gog-the-witcher-2-assassins-of-kings.png "${pkgdir}"/usr/share/pixmaps/gog-the-witcher-2-assassins-of-kings.png
- # install .desktop file for the configurator
- install -Dm644 "${srcdir}"/gog-the-witcher-2-configurator.desktop "${pkgdir}"/usr/share/applications/gog-the-witcher-2-configurator.desktop
-
- install -Dm644 "${pkgdir}"/opt/gog/the-witcher-2-assassins-of-kings/docs/End\ User\ License\ Agreement.txt "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
-
- install -Dm755 "${srcdir}/gog-the-witcher-2-assassins-of-kings" "${pkgdir}/usr/bin/gog-the-witcher-2-assassins-of-kings"
- install -Dm755 "${srcdir}/configurator" "${pkgdir}/usr/bin/gog-the-witcher-2-configurator"
+pkgdesc='Enjoy a captivating story, dynamic combat system and beautiful graphics in the second installment in the RPG saga about the Witcher, Geralt of Rivia.'
+arch=(
+ 'i686'
+ 'x86_64'
+)
+depends_x86_64=(
+ 'freetype2'
+ 'gtk2'
+ 'sdl2'
+ 'sdl2_image'
+)
+depends_i686=(
+ 'lib32-freetype2'
+ 'lib32-gtk2'
+ 'lib32-sdl2'
+ 'lib32-sdl2_image'
+)
+url='http://thewitcher.com/en/witcher2'
+license=(
+ 'custom'
+)
+groups=(
+ 'games'
+ 'gog'
+)
+source=(
+ "gog://${pkgname//-/_}_enhanced_edition_${pkgver}.sh"
+ "${pkgname}"
+ "${pkgname}.desktop"
+)
+DLAGENTS=(
+ "gog::/usr/bin/echo %u Download the GOG file to $PWD or set up a gog:// DLAGENT."
+)
+noextract=(
+ "gog_the_witcher_2_assassins_of_kings_enhanced_edition_${pkgver}.sh"
+)
+sha256sums=(
+ '6d6f519db92fe38219b9bb62a6d2dfff0a93e5c24f73cf69ba7d05071361f586'
+ '32fd021d75ad3ed9e55e97b34d5ee08c2bde469028ddee410f933290d2998731'
+ '9f56e0b94fcd60a179a158dac27051c526f0f27b2ebe4224ca68d6ecafee7d47'
+)
+
+prepare() {
+ cd "${srcdir}" || exit 1
+ # "The ~20GB workaround"
+ #
+ # prepare() may need some changes upstream... Unzip extracts file.sh fine.
+ # Due to some "garbage" (shell script) at the beginning of file.sh, unzip
+ # will exit with a reutn code of 1, causing prepare() to fail.
+ #
+ #The "sane" solution is to repackage file.sh into a "fixed" zip file:
+ zip -FFv "../${source[0]}" --out "${pkgname}.zip"
+ # Then unzip the result:
+ unzip "${pkgname}.zip"
+ # Then cleanup after ourselves:
+ rm "${pkgname}.zip"
+ # Fun...
+}
+
+package() {
+ cd "${srcdir}"
+
+ # Install game
+ install -d "${pkgdir}/opt/${pkgname}/"
+ install -d "${pkgdir}/opt/${pkgname}/support"
+ install -d "${pkgdir}/usr/bin/"
+ cp -r "data/noarch/game/" "${pkgdir}/opt/${pkgname}/"
+
+
+ find "${pkgdir}/opt/${pkgname}" -type d -exec chmod 755 {} \;
+ install -Dm755 "data/noarch/start.sh" \
+ "${pkgdir}/opt/${pkgname}/"
+ install -Dm755 data/noarch/support/*.{sh,shlib} -t \
+ "${pkgdir}/opt/${pkgname}/support"
+
+ # Desktop integration
+ install -Dm 644 "data/noarch/support/icon.png" \
+ "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
+ install -Dm644 "data/noarch/docs/End User License Agreement.txt" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm 644 "${srcdir}/${pkgname}.desktop" \
+ "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ install -Dm755 "${srcdir}/${pkgname}" \
+ "${pkgdir}/usr/bin/${pkgname}"
}
diff --git a/configurator b/configurator
deleted file mode 100644
index bed82b7611b..00000000000
--- a/configurator
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/bash
-gogdir="/opt/gog/the-witcher-2-assassins-of-kings"
-
-cd "$gogdir"/game/
-./configurator
diff --git a/gog-the-witcher-2-assassins-of-kings b/gog-the-witcher-2-assassins-of-kings
index d4696e4c8c2..18ed60a1110 100644
--- a/gog-the-witcher-2-assassins-of-kings
+++ b/gog-the-witcher-2-assassins-of-kings
@@ -1,4 +1,24 @@
-#!/usr/bin/bash
-gogdir="/opt/gog/the-witcher-2-assassins-of-kings"
+#! /bin/bash
-"$gogdir"/start.sh
+pkgname="gog-the-witcher-2-assassins-of-kings"
+pkgdir="/opt/${pkgname}/"
+run="${pkgdir}/start.sh"
+
+if hash firejail; then
+ echo "Firejail detected; attempting to enforce a sandbox..."
+ if [[ -f "${XDG_CONFIG_HOME}/firejail/${pkgname}.profile" ]]; then
+ echo "Firejail profile for ${pkgname} found in ${XDG_CONFIG_HOME}/firejail/"
+ echo "Enforcing a sandbox!"
+ firejail "${run}"
+ elif [[ -f "/etc/firejail/${pkgname}.profile" ]]; then
+ echo "Firejail profile for ${pkgname} found in /etc/firejail/"
+ echo "Enforcing a sandbox!"
+ firejail "${run}"
+ else
+ echo "No Firejail profile detected!"
+ echo "Skipping Firejail sandbox..."
+ "${run}"
+ fi
+else
+ "${run}"
+fi
diff --git a/gog-the-witcher-2-assassins-of-kings.desktop b/gog-the-witcher-2-assassins-of-kings.desktop
new file mode 100644
index 00000000000..dc9e2de90a3
--- /dev/null
+++ b/gog-the-witcher-2-assassins-of-kings.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=The Witcher 2 Assassins of Kings
+Comment=Enjoy a captivating story, dynamic combat system and beautiful graphics in the second installment in the RPG saga about the Witcher, Geralt of Rivia.
+Exec=gog-the-witcher-2-assassins-of-kings
+Icon=gog-the-witcher-2-assassins-of-kings
+Type=Application
+Terminal=false
+StartupNotify=true
+Categories=Game;AudioVideo;
+Encoding=UTF-8
diff --git a/gog-the-witcher-2-configurator.desktop b/gog-the-witcher-2-configurator.desktop
deleted file mode 100644
index 6f8ec9729d9..00000000000
--- a/gog-the-witcher-2-configurator.desktop
+++ /dev/null
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Name=The Witcher 2 Assassins Of Kings - Configurator
-Comment=The Witcher 2 Assassins Of Kings - Configurator (GOG.com)
-Exec=gog-the-witcher-2-configurator
-Icon=/opt/gog/the-witcher-2-assassins-of-kings/game/linux/icons/witcher2-configurator.png
-Terminal=false
-Type=Application
-Categories=Game;