Last active
April 8, 2018 18:05
-
-
Save oysstu/829900742a4eae9fec2f532749df9327 to your computer and use it in GitHub Desktop.
gog-mini-metro aur pkgbuild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: James Zhu <james.zhu.engineer at gmail.com> | |
pkgname=gog-mini-metro | |
pkgver=201712140945_gamma34 | |
pkgrel=1 | |
_gogrel=17216 | |
_gamename=${pkgname#gog-} | |
_gamename=${_gamename//-/_} | |
pkgdesc='Minimalistic subway layout game' | |
url="https://www.gog.com/game/mini_metro" | |
license=('custom:None') | |
arch=('i686' 'x86_64') | |
depends=('libgl' 'libx11' 'glu' 'desktop-file-utils' 'gtk-update-icon-cache') | |
makedepnds=('imagemagick') | |
source=("setup_${_gamename}_${pkgver}_${_gogrel}.sh::gogdownloader://${_gamename}/en3installer0" | |
"${pkgname}.desktop") | |
sha256sums=('1b4d168101b5a250ef725aa0b5f86190a40dae4156f008c54e57dd549d7c2cd2' | |
'85d3b80eacde486736e94c999d15a34b1d0d8581df5bf0a209a32c6bccf5b6ef') | |
# Optionally, use lgogdownloader - can also be added to makepkg.conf | |
#DLAGENTS+=("gogdownloader::/usr/bin/lgogdownloader --download-file=%u -o %o") | |
DLAGENTS+=("gogdownloader::/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(){ | |
case $CARCH in | |
i686) _notarch=x86_64 ;; | |
x86_64) _notarch=x86 ;; | |
esac | |
find -name "*$_notarch" -exec rm -r {} + | |
cd "${srcdir}" | |
echo $PWD | |
cd "${srcdir}/data/noarch" | |
sed -r -i \ | |
's/(CURRENT_DIR="\$\( cd "\$\( dirname )'` | |
`'"\$\{BASH_SOURCE\[0\]\}"(.*$)'` | |
`'/\1$( readlink -nf "${BASH_SOURCE[0]}" )\2/' \ | |
"start.sh" | |
} | |
package(){ | |
cd "${srcdir}/data/noarch" | |
destdir="$pkgdir/opt/$pkgname" | |
install -dm 755 "$destdir" | |
# 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" "gameinfo" "${pkgdir}/opt/${pkgname}/" | |
install -Dm755 support/*.{sh,shlib} "${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}" | |
install -dm 755 "$pkgdir/usr/{bin,share/{applications,icons/hicolor/{scalable,256x256,64x64}/apps}}" "$destdir" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment