summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 44feee13057df128aeea2e107cbbf11f4d2523ef (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
# Maintainer: S Stewart <tda@null.net>
# Maintainer: Cranky Supertoon <crankysupertoon@gmail.com>
pkgname="gdlauncher"
pkgver="1.0.6"
pkgrel=1
commitsha="e774ea7edd744ebac2ad99fd89474545bbbc661b"
arch=('x86_64')
pkgdesc="GDLauncher is simple, yet powerful Minecraft custom launcher with a strong focus on the user experience"
url="https://gdevs.io"
license=('GPL3')
makedepends=('gendesk' 'git' 'yarn' 'nodejs' 'rust' 'unzip')
depends=('libnotify' 'libxss' 'libxtst' 'libindicator-gtk3' 'libappindicator-gtk3')
conflicts=('gdlauncher-appimage' 'gdlauncher-git' 'gdlauncher-bin')
source=("gdlauncher::git+https://github.com/gorilla-devs/GDLauncher.git")
md5sums=('SKIP')

prepare() {
    # clone source
    cd "${srcdir}/${pkgname}"
    git checkout origin/master
    git switch master
    git reset --hard ${commitsha}
    
    # generate .desktop
    gendesk -f --pkgname "GDLauncher" --pkgdesc "${pkgdesc}" --icon ${pkgname} --exec "/usr/bin/${pkgname}" -n
    mv "GDLauncher.desktop" "${pkgname}.desktop"

    # put yarn in testing mode
    cd "${srcdir}/${pkgname}"
    echo "RELEASE_TESTING=true" > .env    
}

build() {
    cd "${srcdir}/${pkgname}"
    yarn
    yarn release
}

package() {
    # install the main files.
    install -d -m755 "${pkgdir}/opt/${pkgname}"
    cd "${srcdir}/${pkgname}/deploy"
    mkdir gdlauncher/
    unzip "GDLauncher-linux-setup.zip" -d gdlauncher
    cp -Rr "${srcdir}/${pkgname}/deploy/${pkgname}"* "${pkgdir}/opt/"

    # desktop entry
    install -D -m644 "${srcdir}/${pkgname}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"

    # install the icon
    install -d -m755 "${pkgdir}/usr/share/icons/hicolor"
    cp -Rr "${srcdir}/${pkgname}/public/icon.png" "${pkgdir}/usr/share/icons/"
    
    # fix file permissions - all files as 644 - directories as 755
    find "${pkgdir}/"{opt,usr} -type d -exec chmod 755 {} \;
    find "${pkgdir}/"{opt,usr} -type f -exec chmod 644 {} \;

    # make sure the main binary has the right permissions
    chmod +x "${pkgdir}/opt/${pkgname}/${pkgname}"

    # link the binary
    install -d -m755 "${pkgdir}/usr/bin"
    ln -sr "${pkgdir}/opt/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
}