summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1af5437e889f88d6e9c7f28b730e4c7b25728375 (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
# Maintainers: kobe-koto <admin[at]koto[dot]cc>, Ketal_Q_ray <k[at]ketal[dot]icu>, Kevin_Liu <we123445[at]outlook[dot]com>
pkgname="liteloader-qqnt-bin"
_pkgname="LiteLoaderQQNT"
pkgver=1.2.2
pkgrel=2
pkgdesc="轻量, 简洁, 开源的 QQNT 插件加载器"
arch=('any')
url="https://github.com/LiteLoaderQQNT/LiteLoaderQQNT"
license=('MIT')
depends=("linuxqq")
conflicts=("linuxqq-appimage" "liteloader-qqnt")
provides=("liteloader-qqnt")
source=("LiteLoaderQQNT-${pkgver}.zip::${url}/releases/download/${pkgver}/${_pkgname}.zip"
	"liteloader-qqnt-patcher.sh"
	"liteloader-qqnt-depatch.hook"
	"liteloader-qqnt-patch.hook"
	)

sha256sums=(
	'SKIP'
	'71f645653e7ed404e70027bab159571636a2311b633246836028ddb9c730b530'
	'5f963c6ec64e93332f9a965d0ab85cf989df3607759c88162593baf31a0bd66f'
	'8daf3d1b8846f1fd8221b33c05a4e9224677654e66194961ce545ab95c35a77f'
	)

build() {
	# Generate LiteLoaderQQNT.js
	echo "require(String.raw\`/opt/LiteLoaderQQNT\`)" > "${srcdir}/LiteLoaderQQNT.js"
}

package() {
	# Copy LiteLoaderQQNT files
	mkdir -p "${pkgdir}/opt/LiteLoaderQQNT"
	cp -rf "${srcdir}"/* "${pkgdir}/opt/LiteLoaderQQNT/"

	# Install LiteLoaderQQNT's loading script
	mkdir -p "${pkgdir}/opt/QQ/resources/app/app_launcher"
	install -Dm644 "${srcdir}/LiteLoaderQQNT.js" "${pkgdir}/opt/QQ/resources/app/app_launcher/LiteLoaderQQNT.js"

	# Clean up in target dir
	rm -f "${pkgdir}/opt/LiteLoaderQQNT/LiteLoaderQQNT-${pkgver}.zip"
	rm -f "${pkgdir}/opt/LiteLoaderQQNT/liteloader-qqnt-patcher.sh"
	rm -f "${pkgdir}/opt/LiteLoaderQQNT/liteloader-qqnt-patch.hook"
	rm -f "${pkgdir}/opt/LiteLoaderQQNT/liteloader-qqnt-depatch.hook"
	rm -f "${pkgdir}/opt/LiteLoaderQQNT/LiteLoaderQQNT.js"

	# Install patcher script
	mkdir -p "${pkgdir}/opt/LiteLoaderQQNT/patching"
	install -Dm755 "${srcdir}/liteloader-qqnt-patcher.sh" "${pkgdir}/opt/LiteLoaderQQNT/patching/liteloader-qqnt-patcher.sh"

	# Install pacman hooks
	install -Dm644 "${srcdir}/liteloader-qqnt-patch.hook" "${pkgdir}/etc/pacman.d/hooks/liteloader-qqnt-patch.hook"
	install -Dm644 "${srcdir}/liteloader-qqnt-depatch.hook" "${pkgdir}/etc/pacman.d/hooks/liteloader-qqnt-depatch.hook"
}