diff options
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 63 | ||||
-rw-r--r-- | gog-terraria.desktop | 10 |
3 files changed, 89 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..428e84f4e360 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = gog-terraria + pkgdesc = The very world is at your fingertips as you fight for survival, fortune, and glory. + pkgver = 2.0.0.3 + pkgrel = 1 + url = http://terraria.org/ + arch = i686 + arch = x86_64 + license = custom + depends = sdl2 + source = gog://gog_terraria_2.0.0.3.sh + source = gog-terraria.desktop + sha256sums = b2e895c6b60242f98455fefc243683d4e61b758e27469409210df3ecabe7c8e7 + sha256sums = 815bf359c2828cdefee1e33a978a84a2ebb538450197a5792b62e382ae3e3093 + +pkgname = gog-terraria + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e699973acdbd --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,63 @@ +# Maintainer: Ainola + +pkgname=gog-terraria +pkgver=2.0.0.3 +pkgrel=1 +pkgdesc="The very world is at your fingertips as you fight for survival, fortune, and glory." +url="http://terraria.org/" +license=('custom') +arch=('i686' 'x86_64') +depends=('sdl2') +source=("gog://${pkgname//-/_}_${pkgver}.sh" + "${pkgname}.desktop") +sha256sums=('b2e895c6b60242f98455fefc243683d4e61b758e27469409210df3ecabe7c8e7' + '815bf359c2828cdefee1e33a978a84a2ebb538450197a5792b62e382ae3e3093') + +# You need to download the gog.com installer file manually or with lgogdownloader. +DLAGENTS+=("gog::/usr/bin/echo %u - This is is not a real URL, you need to download the GOG file manually to \"$PWD\" or setup a gog:// DLAGENT. Read this PKGBUILD for more information.") + +# Prevent compressing final package +PKGEXT='.pkg.tar' + +prepare(){ + # Unzip will produce an error code because it is unable to unzip the Installer. + # Therefore, a conditional into a no-op command will keep the PKGBUILD from failing + # Of course, if you have any real problems unzipping the PKGBUILD will not abort. + unzip -d "${srcdir}/terraria" "${pkgname//-/_}_${pkgver}.sh" || : + cd "${srcdir}/terraria/data/noarch" + + # We must `cd` to the install dir before launching since the /usr/bin/ + # launcher is merely a link. It expects a certain folder structure. +# sed -r -i \ +# 's/(declare -r CURRENT_DIR="\$\( cd "\$\( dirname )'` +# `'"\$\{BASH_SOURCE\[0\]\}"(.*$)'` +# `'/\1$( readlink -nf "${BASH_SOURCE[0]}" )\2/' \ +# "start.sh" + sed -r -i \ + 's/(CURRENT_DIR="\$\( cd "\$\( dirname )'` + `'"\$\{BASH_SOURCE\[0\]\}"(.*$)'` + `'/\1$( readlink -nf "${BASH_SOURCE[0]}" )\2/' \ + "start.sh" +} + +package(){ + cd "${srcdir}/terraria/data/noarch" + # Install game + install -d "${pkgdir}/opt/${pkgname}/" + install -d "${pkgdir}/opt/${pkgname}/support" + install -d "${pkgdir}/usr/bin/" + cp -r "game/" "${pkgdir}/opt/${pkgname}/" + install -Dm755 "start.sh" \ + "${pkgdir}/opt/${pkgname}/" + install -Dm755 support/*.{sh,shlib} -t \ + "${pkgdir}/opt/${pkgname}/support" + + # Desktop integration + install -Dm 644 "support/icon.png" \ + "${pkgdir}/usr/share/pixmaps/${pkgname}.png" + install -Dm644 "docs/End User License Agreement.txt" \ + "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm 644 "${srcdir}/${pkgname}.desktop" \ + "${pkgdir}/usr/share/applications/${pkgname}.desktop" + ln -s "/opt/${pkgname}/start.sh" "${pkgdir}/usr/bin/${pkgname}" +} diff --git a/gog-terraria.desktop b/gog-terraria.desktop new file mode 100644 index 000000000000..29ec23c28596 --- /dev/null +++ b/gog-terraria.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Terraria +Comment=Dig, Fight, Build! +Exec=gog-terraria +Icon=gog-terraria +StartupNotify=true +Terminal=false +Type=Application +Categories=Application;Game;AudioVideo; |