summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 45b05241b04be69cd724027bf03a1d3be3c31390 (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
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: Ivan Gabaldon <aur[at]inetol.net>
# Contributor: S Stewart <tda@null.net>
# Contributor: Cranky Supertoon <crankysupertoon@gmail.com>

pkgname=gdlauncher-bin
pkgver=2.0.20
pkgrel=4
pkgdesc='A simple, yet powerful Minecraft custom launcher with a strong focus on the user experience (binary release)'
arch=('x86_64')
url=https://gdlauncher.com
license=('BUSL-1.1')
_electron=electron32
provides=("${pkgname//-bin}")
conflicts=("${pkgname//-bin}")
source=("$pkgname-$pkgver.AppImage::https://cdn-raw.gdl.gg/launcher/GDLauncher__${pkgver}__linux__x64.AppImage"
        "${pkgname//-bin}.sh"
        "LICENSE::https://raw.githubusercontent.com/gorilla-devs/GDLauncher-Carbon/develop/LICENSE")
b2sums=('773af34aeeb2f7a36ee4356661529b218d10ded1e37ffc9907f274e06d9e99446f1417b0becc3d1ef140728824896e291cbb83f63f5c35db685c97f55c059755'
        '98f4cb1253a1c8b076042bec96ccde6253107491790d79eca04b667358b79b4bf34f698fb7e9790e1924c52cbe317783269700e1268d3039803adcdf2ee2f5bd'
        '93aed8a6736b73bc8ce08847d9dc895c0e14310125811ea43fbfe9977faa186c4d8f8ffcf88a2a17ab8ae34ab82e1ffbe84e1c590456d4bef46e552b5f80cee7')

prepare() {
    sed -i "s|@ELECTRON@|$_electron|" "${pkgname//-bin}.sh"

    chmod +x "$pkgname-$pkgver.AppImage"
    "./$pkgname-$pkgver.AppImage" --appimage-extract

    # Convert
    cd squashfs-root/

    mkdir -p resources/resources/
    cp -rlf resources/{binaries/,app.asar} resources/resources/
    rm -rf resources/{binaries/,app.asar,app-update.yml}

    cat ../LICENSE > resources/LICENSE

    cat "../${pkgname//-bin}.sh" > "resources/${pkgname//-bin}"

    mv "@gddesktop.desktop" "resources/${pkgname//-bin}.desktop"
    sed -i -e "s|Exec=.*|Exec=/usr/bin/${pkgname//-bin} %U|" -e "s|Icon=.*|Icon=${pkgname//-bin}|" -e '/X-AppImage-Version=.*/d' "resources/${pkgname//-bin}.desktop"

    mv usr/share/icons/hicolor/0x0/apps/@gddesktop.png "resources/${pkgname//-bin}.png"

    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;
    chmod 755 resources/resources/{binaries/core_module,app.asar}
}

package() {
    depends=("$_electron"
             'gcc-libs'
             'glibc'
             'libxcb')

    optdepends=('libappindicator-gtk3: Systray indicator support')

    install -d "$pkgdir/opt/${pkgname//-bin}/"
    cp -a squashfs-root/resources/. "$pkgdir/opt/${pkgname//-bin}/"

    chmod 755 "$pkgdir/opt/${pkgname//-bin}/${pkgname//-bin}"

    install -d "$pkgdir/usr/bin/"
    ln -s "/opt/${pkgname//-bin}/${pkgname//-bin}" "$pkgdir/usr/bin/${pkgname//-bin}"

    install -d "$pkgdir/usr/share/applications/"
    ln -s "/opt/${pkgname//-bin}/${pkgname//-bin}.desktop" "$pkgdir/usr/share/applications/${pkgname//-bin}.desktop"

    install -d "$pkgdir/usr/share/icons/"
    ln -s "/opt/${pkgname//-bin}/${pkgname//-bin}.png" "$pkgdir/usr/share/icons/${pkgname//-bin}.png"

    install -d "$pkgdir/usr/share/licenses/${pkgname//-bin}/"
    ln -s "/opt/${pkgname//-bin}/LICENSE" "$pkgdir/usr/share/licenses/${pkgname//-bin}/LICENSE"
}