summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aa6722ab7a1a03c37bf554e09ab31b10dd7019c7 (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: Wasabi <wasabithumbs@gmail.com>
pkgname=open-goal-launcher
pkgver="2.4.4"
pkgrel=1
pkgdesc="A launcher for the OpenGOAL Project to simplify usage and installation"
arch=(any)
url='https://github.com/open-goal/launcher'
license=('ISC')
depends=('gtk3' 'webkit2gtk' 'openssl' 'appmenu-gtk-module' 'libappindicator-gtk3' 'librsvg' 'libvips' 'base-devel')
makedepends=('curl' 'wget' 'file' 'cargo' 'nodejs>=18.18.0' 'yarn')
conflicts=('open-goal-launcher-bin')
_tarball="v${pkgver}.tar.gz"
source=("https://github.com/open-goal/launcher/archive/refs/tags/${_tarball}" "${pkgname}.desktop")
md5sums=("60cab7e4d0083d7b396ce8b517b4df2b" "SKIP")
options=(!strip)

prepare() {
    cd $srcdir
    tar -xf "${_tarball}"
    chmod +rw "launcher-${pkgver}"
    cd "launcher-${pkgver}"
    yarn install
    cd src-tauri
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
    cd $srcdir
    sed -i '/^Comment=/d' "${pkgname}.desktop"
	sed -i '/^Version=/d' "${pkgname}.desktop"
	echo "Comment=${pkgdesc}" >> "${pkgname}.desktop"
	echo "Version=${pkgver}" >> "${pkgname}.desktop"

    cd "launcher-${pkgver}"
    yarn tauri build -b none
}

package() {
    _src="${srcdir}/launcher-${pkgver}/src-tauri"

	install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"

	install -dm755 "${pkgdir}/usr/share/icons/hicolor"
	mkdir -p "${pkgdir}/usr/share/icons/hicolor/32x32/apps"
	cp "${_src}/icons/32x32.png" "${pkgdir}/usr/share/icons/hicolor/32x32/apps/${pkgname}.png"
	mkdir -p "${pkgdir}/usr/share/icons/hicolor/128x128/apps"
	cp "${_src}/icons/128x128.png" "${pkgdir}/usr/share/icons/hicolor/128x128/apps/${pkgname}.png"
	mkdir -p "${pkgdir}/usr/share/icons/hicolor/256x256/apps"
	cp "${_src}/icons/128x128@2x.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname}.png"

	install -Dm755 "${_src}/target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
}