summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 393f2a30cd46102978125e8903310df2b6a3f2e0 (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: Manuel Thalmann <m@nuth.ch>
_pkgname=godot-manager
_desktopEntry="godot-manager-bin.desktop"
_repo="eumario/$_pkgname"
_archive="$_pkgname.zip"
pkgname="$_pkgname-bin"
pkgver="0.2.3"
pkgrel=1
pkgdesc="A Project, Version and Addons/Plugins manager for Godot Game Engine."
arch=(x86_64)
url="https://github.com/$_repo"
license=('MIT')
groups=()
depends=()
makedepends=('curl' 'git' 'jq' 'sed')
provides=("$_pkgname")
conflicts=("$_pkgname")
replaces=()
backup=()
options=(!strip) # prevent godot build from breaking
install=
source=(
    "$_archive::https://github.com/$_repo/releases/download/v$pkgver/godotmanager-linux-v$pkgver.zip"
    "LICENSE::https://raw.githubusercontent.com/$_repo/v$pkgver/LICENSE"
    "$_pkgname.png::https://raw.githubusercontent.com/$_repo/v$pkgver/$_pkgname.png"
    "$_desktopEntry"
)
noextract=("$_archive")
sha256sums=(
    'f1d1100e9537329f0e9b3bf68b4f6692b9390fe5df31662afb3add5f7c5d7bb5'
    'SKIP'
    'SKIP'
    'SKIP'
)

pkgver() {
    curl --silent -L "https://api.github.com/repos/$_repo/releases/latest" | # Get latest release from GitHub api
        jq -r .tag_name | # Get tag name
        sed 's/^v//' # Remove leading `v`
}

package() {
    _installDir="$pkgdir/opt/$_pkgname"
    _binDir="$pkgdir/usr/bin"
    _iconDir="$pkgdir/usr/share/pixmaps"
    _desktopDir="$pkgdir/usr/share/applications"
    install -dm755 "$_binDir" "$_installDir" "$_iconDir" "$_desktopDir"
    unzip "$_archive" -d "$_installDir"
    ln -s "/opt/$_pkgname/GodotManager.${arch[0]}" "$_binDir/$_pkgname"
    install -Dm644 "$srcdir/godot-manager.png" "$_iconDir"
    install -Dm644 "$_desktopEntry" "$_desktopDir"
    install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"    
}