summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6bf273a6fe9468b70812261d6fc10471488bafe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Maintainer: Lukas1818 aur at lukas1818 dot de

pkgname=gog-stellaris
pkgver=3.1.1
_pkgtag=$pkgver
pkgrel=1
pkgdesc="A strategy game with space exploration at its core"
arch=('x86_64')
url="https://www.gog.com/game/stellaris"
license=('custom')
groups=('gog' 'games')
makedepends=('unzip' 'findutils' 'lgogdownloader')
optdepends=("gog-stellaris-anniversary-portraits=$pkgver" "gog-stellaris-horizon-signal=$pkgver")
depends=('bash' 'sed' 'glibc' 'libx11' 'libglvnd' 'gcc-libs')
source=("stellaris_${pkgver//./_}.sh::gogdownloader://1508702879/en3installer0"
        "Stellaris.desktop"
        "start-stellaris.sh")
sha512sums=('73691532f7dc40687183e170ecb3ff43e7720ff74f0ab7274a1a35a24a0aa7165baff9e1f6a00f96796ac78a396fbf5d7e3d97a1ce1eb4259281b38c669fe8ed'
            'adb27526719b22f71211cd0398f1323a3821821f12fd6998f592eb5e31c0891234f2505e7eb0b685588116b305aaf33b78670539b26440744befc351b4776827'
            '909ba5ce65d6906f7357ad12f5f9cf3a2c81c15bd6414298b91616236754c1d4bff32f0ab0f83f6449e8c6adda669351ce23fbdd80c1366b6d36c862c6435603')

#lgogdownloader exit always with 141 after a successful download of some games
# || test $? -eq 141 and /usr/bin/bash -c does not work in DLAGENTS, use a script instead
#https://stackoverflow.com/questions/65149855/add-a-makepkg-dlagent-which-accept-a-non-zero-exit-code
DLAGENTS+=("gogdownloader::./catch_gogdownloader_error141.sh %u %o")

prepare()
{
  cd "${srcdir}"
  test -d "${srcdir}/stellaris" && rm -r "${srcdir}/stellaris"
  unzip -q -d stellaris stellaris_${pkgver//./_}.sh || test $? -eq 1
  cd "${srcdir}/stellaris/data/noarch/game"
  rm AutoClientScript.py \
     AutoClientScriptOvernight.py \
     dowser \
     launcher-installer-linux \
     pdx_core_test
}

package()
{
  mkdir -p "${pkgdir}/opt/$pkgname"
  cp -r "${srcdir}/stellaris/data/noarch/game" -T "${pkgdir}/opt/$pkgname"
  chmod -R 644 "${pkgdir}/opt/$pkgname/"
  chmod    755 "${pkgdir}/opt/$pkgname/stellaris"
  find "${pkgdir}/opt/$pkgname" -type d -exec chmod 755 {} \;
  install -Dm 755 "${srcdir}/start-stellaris.sh" "${pkgdir}/usr/bin/stellaris"
  install -Dm 755 "${srcdir}/Stellaris.desktop" "$pkgdir/usr/share/applications/Stellaris.desktop"
  install -Dm 644 "${srcdir}/stellaris/data/noarch/support/icon.png" "${pkgdir}/usr/share/pixmaps/$pkgname.png"
  install -d 644 "${pkgdir}/usr/share/licenses/$pkgname"
  mv "${pkgdir}/opt/$pkgname/licenses" -T "${pkgdir}/usr/share/licenses/$pkgname/"
  install -Dm 644 "${srcdir}/stellaris/data/noarch/docs/End User License Agreement.txt" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
  mv "${pkgdir}/opt/$pkgname/ThirdPartyLicenses.txt" "${pkgdir}/usr/share/licenses/$pkgname"
}