summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6eb308a01f278ec09a7b0c9215ecc43b809da6d8 (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
55
56
57
58
59
60
61
# Maintainer: kyndair <kyndair at gmail dot com>
# Place the gog installation file in the same folder as this PKGBUILD
pkgname=gog-tangledeep
_pkgname=tangledeep
pkgver=1.53a
_pkgver=1_53a
_build=54452
_goggame=1703478259
pkgrel=2
epoch=1
pkgdesc="Trapped in underground villages with no memory of the world at the surface, you must survive an ever-changing labyrinth to discover what lies above."
arch=('i686' 'pentium4' 'x86_64')
url="https://www.gog.com/game/${_pkgname}"
license=('custom')
makedepends=('p7zip')
provides=('tangledeep')
conflicts=('humble-tangledeep')
source=("${_pkgname}_${_pkgver}_${_build}.sh::gog://${_pkgname}_${_pkgver}_${_build}.sh"
        "${_pkgname}.desktop")
# don't download anything via makepkg
DLAGENTS+=("gog::/usr/bin/perl -E print\(\"${RED}\"\ .\ substr\(\"%u\",\ 6\)\ .\ \"\ not\ found.\ \ Check\ the\ PKGBUILD\ for\ further\ information.${ALL_OFF}\\\\n\"\)\;\ exit\ 1")
sha256sums=('0e0584b32d783c55ad5ac20ba2fdec7a9fac2ca19b8431bd38c0a326c4ca24f2'
            'a5d0ecd7d72687445a91822f06b15194c728be37a18df85343340a864ac112c0')
noextract=("${_pkgname}_${_pkgver}_${_build}.sh"
        "${_pkgname}.desktop")

prepare() {
    7z x -tzip -y ${_pkgname}_${_pkgver}_${_build}.sh
}

package() {
    # install launcher
    install -Dm644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
    # install game icon
    install -Dm644 "${srcdir}/data/noarch/support/icon.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
    # install goggame files
    install -Dm644 "${srcdir}/data/noarch/game/goggame-${_goggame}.hashdb" "${pkgdir}/opt/${_pkgname}/goggame-${_goggame}.hashdb"
    install -Dm644 "${srcdir}/data/noarch/game/goggame-${_goggame}.info" "${pkgdir}/opt/${_pkgname}/goggame-${_goggame}.info"
    # set the correct permissions and move the game data into pkg
    find "${srcdir}/data/noarch/game/Tangledeep_Data" -type d -exec chmod 755 {} +
    find "${srcdir}/data/noarch/game/Tangledeep_Data" -type f -exec chmod 644 {} +
    mv "${srcdir}/data/noarch/game/Tangledeep_Data" "${pkgdir}/opt/${_pkgname}"
    # remove unneeded libraries and install correct executable
    if [[ "$CARCH" == "x86_64" ]]; then
        rm -r "${pkgdir}/opt/${_pkgname}/Tangledeep_Data/Mono/x86"
        rm -r "${pkgdir}/opt/${_pkgname}/Tangledeep_Data/MonoBleedingEdge/x86"
        rm -r "${pkgdir}/opt/${_pkgname}/Tangledeep_Data/Plugins/x86"
        install -Dm755 "${srcdir}/data/noarch/game/Tangledeep.x86_64" "${pkgdir}/opt/${_pkgname}/Tangledeep"
    else
        rm -r "${pkgdir}/opt/${_pkgname}/Tangledeep_Data/Mono/x86_64"
        rm -r "${pkgdir}/opt/${_pkgname}/Tangledeep_Data/MonoBleedingEdge/x86_64"
        rm -r "${pkgdir}/opt/${_pkgname}/Tangledeep_Data/Plugins/x86_64"
        install -Dm755 "${srcdir}/data/noarch/game/Tangledeep.x86" "${pkgdir}/opt/${_pkgname}/Tangledeep"
    fi
    # install unity files
    install -Dm755 "${srcdir}/data/noarch/game/UnityPlayer_s.debug" "${pkgdir}/opt/${_pkgname}/UnityPlayer_s.debug"
    install -Dm644 "${srcdir}/data/noarch/game/UnityPlayer.so" "${pkgdir}/opt/${_pkgname}/UnityPlayer.so"
    # link executable in /usr/bin
    mkdir "${pkgdir}/usr/bin"
    ln -s /opt/${_pkgname}/Tangledeep "${pkgdir}/usr/bin/Tangledeep"
}