summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5b5123bb04f7693e0111a999ef849b6d56c9873d (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
# Maintainer: Sascha Loishandl <sascha.loishandl@gmail.com>
groups=('modified')

pkgname=mangoverlay
_app_id="io.github.loissascha.$pkgname"
pkgver=0.3.6
pkgrel=2
pkgdesc="GUI app for managing your MangoHud configuration."
arch=('x86_64')
url="https://github.com/loissascha/MangOverlay"
license=('MIT')
depends=(
  'gtk3'
  'mangohud'
  'vulkan-tools'
  'webkit2gtk-4.1'
) 
makedepends=(
  'go'
  'wails'
) 
source=("MangOverlay-$pkgver.tar.gz::https://github.com/loissascha/MangOverlay/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('1109b5f826800c355c851999f9d3fe52c13d351030ee4f71beed003358fa7350')

prepare() {
  cd "MangOverlay-$pkgver"

  # Set StartupWMClass
  desktop-file-edit --set-key=StartupWMClass --set-value="$pkgname" \
    "build/${_app_id}.desktop"
}

build() {
	cd "MangOverlay-$pkgver"
	export GOPATH="$srcdir/gopath"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
	wails build -tags webkit2_41

	# Clean module cache for makepkg -C
	go clean -modcache
}

package() {
	cd "MangOverlay-$pkgver"
	install -Dm755 "build/bin/$pkgname" -t "$pkgdir/usr/bin/"
	install -Dm644 "build/${_app_id}.desktop" -t "$pkgdir/usr/share/applications/"
	install -Dm644 "build/${_app_id}.metainfo.xml" -t "$pkgdir/usr/share/metainfo/"
	install -Dm644 "build/$pkgname.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/${_app_id}.png"
	install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}