mihomo-party/aur/mihomo-party-git/PKGBUILD

49 lines
1.7 KiB
Bash
Raw Normal View History

2024-08-07 14:00:14 +08:00
pkgname=mihomo-party-git
_pkgname=${pkgname%-git}
pkgver=0.1.3.r5.g5f5d6dd
pkgrel=1
pkgdesc="Another Mihomo GUI."
arch=('x86_64' 'aarch64')
2024-09-13 20:24:52 +08:00
url="https://github.com/mihomo-party-org/mihomo-party"
2024-08-07 14:00:14 +08:00
license=('GPL3')
2024-08-08 10:28:20 +08:00
conflicts=("$_pkgname" "$_pkgname-bin" "$_pkgname-electron" "$_pkgname-electron-bin")
2024-08-08 09:10:23 +08:00
depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'libsecret')
2024-08-07 14:00:14 +08:00
optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).')
makedepends=('nodejs' 'pnpm' 'jq' 'libxcrypt-compat')
install=$_pkgname.install
2024-08-16 14:38:25 +08:00
source=("${_pkgname}.sh" "git+$url.git")
sha256sums=("f8049c1f26d5a92fbcebd7bebbdedbb3eab53422b21cf6127418251ccd061282" "SKIP")
2024-08-07 14:00:14 +08:00
options=('!lto')
pkgver() {
cd $srcdir/${_pkgname}
( set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | tr -d 'v' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
prepare(){
cd $srcdir/${_pkgname}
pnpm install
}
build(){
cd $srcdir/${_pkgname}
pnpm build:linux deb
}
package() {
cd $srcdir/${_pkgname}/dist
bsdtar -xf mihomo-party-linux-$(jq '.version' $srcdir/${_pkgname}/package.json | tr -d 'v"')*.deb
bsdtar -xf data.tar.xz -C "${pkgdir}/"
chmod +x ${pkgdir}/opt/mihomo-party/mihomo-party
chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo
chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo-alpha
cd ${pkgdir}/../..
install -Dm755 "${_pkgname}.sh" "${pkgdir}/usr/bin/${_pkgname}"
sed -i '3s!/opt/mihomo-party/mihomo-party!mihomo-party!' "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
chown -R root:root ${pkgdir}
}