summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b4d70366efcc77c8be1237b5ec31c888e6ee6493 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Maintainer: Cain Atkinson <yellowsink@protonmail.com>

_pkgname="discordrichpresencepresets"
pkgname="${_pkgname}-git"
pkgver=avalonia.v0.1.beta.r17.3045abe
pkgrel=1
pkgdesc="A GUI tool to set and switch between Discord Rich Presences"
arch=('x86_64')
url="https://github.com/cainy-a/DiscordRichPresencePresets"
license=('BSD')
groups=()
depends=('dotnet-runtime-bin>=5.0.0')
makedepends=('git' 'dotnet-sdk-bin>=5.0.0')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
backup=("usr/share/${_pkgname}/data")
source=("${_pkgname}-source::git+${url}#commit=3045abeabdc7c2875037a594766759b2896afeeb")
md5sums=('SKIP')

# Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for
# a description of each element in the source array.

pkgver() {
	cd "${_pkgname}-source"

# Git, tags available
	git describe --long --tags | sed 's/^avalonia-v-//;s/\([^-]*-\)g/r\1/;s/-/./g'
}

prepare() {
	cd "${_pkgname}-source"

	# make a launch script
	tee 'launch.sh' << END
#!/bin/sh
cd /usr/lib/${_pkgname}
exec ./DiscordRichPresencePresets.Avalonia
END

	# make a desktop entry
	tee 'launch.desktop' << END
[Desktop Entry]
Name=Discord RP Presets
Version=${pkgver}
GenericName=Rich Presence Preset Manager
Exec=/usr/bin/${_pkgname}
Icon=
Type=Application
Categories=;
Keywords=;
Terminal=false
StartupNotify=false
Comment=A GUI tool to set and switch between Discord Rich Presences
END

	# fix perms
	chmod +x launch.desktop
}

build() {
	cd "${_pkgname}-source"

	# build with dotnet
	cd DiscordRichPresencePresets.Avalonia
	dotnet publish --self-contained false -r linux-x64
}

#check() {
#	cd "$srcdir/${pkgname%-VCS}"
#	make -k check
#}

package() {
	cd "${_pkgname}-source"

	# install license
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE"

	# move to build output
	#cd "DiscordRichPresencePresets.Avalonia/bin/Debug/net5.0/linux-x64/publish"
	# copy publish folder
	mkdir -p "${pkgdir}/usr/lib/${_pkgname}/"
	cp -r --preserve=mode "DiscordRichPresencePresets.Avalonia/bin/Debug/net5.0/linux-x64/publish/"* "${pkgdir}/usr/lib/${_pkgname}/"
	# install desktop entry
	install -Dm 644 "launch.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
	# install launch script
	install -Dm 755 "launch.sh" "${pkgdir}/usr/bin/${_pkgname}"
}