summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c001195840d5bb279755c5ecb6987fa708a4c88 (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
# Maintainer: S Stewart <tda@null.net>
# Maintainer: Cranky Supertoon <crankysupertoon@gmail.com>
# Special thanks to RyanTheAllmighty for making hyper-appimage
pkgname="gdlauncher-bin"
_pkgname="gdlauncher"
pkgver="1.1.13"
pkgrel=1
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' 'imagemagick')
depends=('libnotify' 'libxss' 'libxtst' 'libindicator-gtk3' 'libappindicator-gtk3')
provides=('gdlauncher')
conflicts=('gdlauncher' 'gdlauncher-appimage' 'gdlauncher-git' 'gdlauncher-classic')
source_x86_64=("GDLauncher-${pkgver}.zip::https://github.com/gorilla-devs/GDLauncher/releases/download/v${pkgver}/GDLauncher-linux-setup.zip"
               "https://github.com/gorilla-devs/GDLauncher/raw/master/public/icon.png")
md5sums_x86_64=('c9d2662bd969a9a5f9d56578413e6f5d'
                'af0ce1364e34f49af3793bf8193c5369')
icon_sizes=(48 128 256 1024)

prepare() {
    # Generate .desktop
    gendesk --pkgname "GDLauncher" --pkgdesc "${pkgdesc}" --icon ${_pkgname} --exec "/usr/bin/${_pkgname}" --categories "Application;Game" -n -f
}

package() {
    # install the main files.
    install -d -m755 "${pkgdir}/opt/${pkgname}/"
    cp -r "${srcdir}/"* "${pkgdir}/opt/${pkgname}/"
    rm "${pkgdir}/opt/${pkgname}/"{icon*.png,GDLauncher-${pkgver}.zip,GDLauncher.desktop}  # remove symlinked source files

    # desktop entry
    install -d -m755 "${pkgdir}/usr/share/applications/"
    install -D -m644 "${srcdir}/GDLauncher.desktop" "${pkgdir}/usr/share/applications/GDlauncher.desktop"

    # install the icons
    for size in "${icon_sizes[@]}"; do
        install -d -m755 "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/"
        convert "${srcdir}/icon.png" -resize "${size}x${size}" "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/${_pkgname}.png"
    done

    # 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}"
}