|
| 1 | +# Template file for 'throne' |
| 2 | +pkgname=throne |
| 3 | +version=1.1.1 |
| 4 | +revision=1 |
| 5 | +build_style=cmake |
| 6 | +hostmakedepends="pkg-config cmake qt6-base qt6-declarative-host-tools |
| 7 | + glib-devel protobuf go gendesk" |
| 8 | +makedepends="qt6-wayland-devel qt6-declarative-devel qt6-tools-private-devel" |
| 9 | +short_desc="Cross-platform GUI proxy utility (Empowered by sing-box)" |
| 10 | +maintainer="Nizarjh <chel773@tutamail.com>" |
| 11 | +license="GPL-3.0-or-later" |
| 12 | +homepage="https://github.com/throneproj/Throne" |
| 13 | +distfiles="https://github.com/throneproj/Throne/archive/${version}.tar.gz" |
| 14 | +checksum=31d1af802503d657796774bbb5cb55553cbeafe433efdcbbb209ebd16f8b045d |
| 15 | +nocross=yes |
| 16 | + |
| 17 | +post_fetch() { |
| 18 | + xbps-fetch https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h |
| 19 | +} |
| 20 | + |
| 21 | +post_configure() { |
| 22 | + cd $wrksrc |
| 23 | + mv $XBPS_BUILDDIR/srslist.h $wrksrc/build/ |
| 24 | + gendesk -f -n \ |
| 25 | + --pkgname "${pkgname}" \ |
| 26 | + --pkgdesc "${short_desc}" \ |
| 27 | + --name "${pkgname^}" \ |
| 28 | + --categories 'Network' |
| 29 | + export GOBIN="${wrksrc}/bin" |
| 30 | + export PATH="${PATH}:${GOBIN}" |
| 31 | + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest |
| 32 | + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest |
| 33 | + cd "$wrksrc/core/server/gen" || exit 1 |
| 34 | + protoc -I . --go_out=. --go-grpc_out=. libcore.proto |
| 35 | +} |
| 36 | + |
| 37 | +post_build() { |
| 38 | + cd "$wrksrc/core/server" |
| 39 | + export CGO_CPPFLAGS="${CPPFLAGS}" |
| 40 | + export CGO_CFLAGS="${CFLAGS}" |
| 41 | + export CGO_CXXFLAGS="${CXXFLAGS}" |
| 42 | + export CGO_LDFLAGS="${LDFLAGS}" |
| 43 | + export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" |
| 44 | + VERSION_SINGBOX=$(go list -m -f '{{.Version}}' github.com/sagernet/sing-box) |
| 45 | + go build -o "${wrksrc}/build" \ |
| 46 | + -ldflags="-linkmode=external -w -s -X 'github.com/sagernet/sing-box/constant.Version=${VERSION_SINGBOX}'" \ |
| 47 | + -tags="with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_dhcp,with_tailscale" |
| 48 | +} |
| 49 | + |
| 50 | +do_install() { |
| 51 | + vinstall "build/Throne" 755 /usr/lib/$pkgname |
| 52 | + vinstall "build/ThroneCore" 755 /usr/lib/$pkgname |
| 53 | + vbin "${FILESDIR}/throne" |
| 54 | + vinstall "${pkgname}.desktop" 644 /usr/share/applications |
| 55 | + vinstall res/public/Throne.png 644 /usr/share/pixmaps throne.png |
| 56 | +} |
0 commit comments