new package: throne-1.1.1#59753
Conversation
cd16f40 to
25f0bfd
Compare
|
i really can't build this with cross |
10c3bc1 to
ac813c4
Compare
|
Throne 1.1.2 has several issues and is currently not stable enough to be included in the repository. At minimum, it does not build on musl without applying patches to variables. |
| nocross=yes | ||
|
|
||
| post_fetch() { | ||
| xbps-fetch https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h |
There was a problem hiding this comment.
This needs to be in distfiles and needs a checksum.
There was a problem hiding this comment.
I can't add it to distfiles because it's a file that gets generated every day. It's generated directly in the repository itself. Basically, someone trying to build this manually might get a SHA mismatch error.
https://github.com/throneproj/routeprofiles/tree/rule-set
And it's generated by a binary that is stored directly in the repository itself. I already opened an issue asking them to disclose the source code of that binary.
throneproj/routeprofiles#2
There was a problem hiding this comment.
Including unverified sources in builds is a no go.
| export GOBIN="${wrksrc}/bin" | ||
| export PATH="${PATH}:${GOBIN}" | ||
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest |
There was a problem hiding this comment.
I don't think using go install and especially just a random version of programs at build time is acceptable. Those binaries should be packaged.
| export CGO_CPPFLAGS="${CPPFLAGS}" | ||
| export CGO_CFLAGS="${CFLAGS}" | ||
| export CGO_CXXFLAGS="${CXXFLAGS}" | ||
| export CGO_LDFLAGS="${LDFLAGS}" |
There was a problem hiding this comment.
all those environment variables are already set by build_style=go.
| VERSION_SINGBOX=$(go list -m -f '{{.Version}}' github.com/sagernet/sing-box) | ||
| go build -o "${wrksrc}/build" \ | ||
| -ldflags="-linkmode=external -w -s -X 'github.com/sagernet/sing-box/constant.Version=${VERSION_SINGBOX}'" \ | ||
| -tags="with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_dhcp,with_tailscale" |
There was a problem hiding this comment.
I have no idea what this does, what is the use, why is it using the version and building something that is already packaged?
| homepage="https://github.com/throneproj/Throne" | ||
| distfiles="https://github.com/throneproj/Throne/archive/${version}.tar.gz" | ||
| checksum=31d1af802503d657796774bbb5cb55553cbeafe433efdcbbb209ebd16f8b045d | ||
| nocross=yes |
There was a problem hiding this comment.
I would like to see why its nocross.
|
Here is how to fix the crossbuild and distfiles issues. However, the template below will not be accepted, as Duncaen noted. You will need to handle the remaining problems, including creating the protoc‑gen‑go and protoc‑gen‑go‑grpc packages, etc. # Template file for 'throne'
pkgname=throne
version=1.1.2
revision=1
_srclist_commit=d66c7371e644b89adef491f569a81ae35fd1384f
build_style=cmake
build_helper=qemu
hostmakedepends="gendesk go protobuf qt6-base qt6-tools"
makedepends="qt6-base-devel"
short_desc="Cross-platform GUI proxy utility (Empowered by sing-box)"
maintainer="Nizarjh <chel773@tutamail.com>"
license="GPL-3.0-or-later"
homepage="https://github.com/throneproj/Throne"
distfiles="https://github.com/throneproj/Throne/archive/${version}.tar.gz
https://raw.githubusercontent.com/throneproj/routeprofiles/${_srclist_commit}/srslist.h
"
checksum="39bc041266033909b5d91f0d6b2db7af853c3de53564fd2905187f7e1aecbca4
0e63c608e0256a1b247f20b46093459586e7ce4b7b695b76449ddb5142340299"
skip_extraction=srslist.h
. $XBPS_COMMONDIR/environment/build-style/go.sh
post_configure() {
vsrccopy srslist.h build
gendesk -f -n \
--pkgname "${pkgname}" \
--pkgdesc "${short_desc}" \
--name "${pkgname^}" \
--categories 'Network'
export GOBIN="${wrksrc}/bin"
export PATH="${PATH}:${GOBIN}"
GOARCH= go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
GOARCH= go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
cd "$wrksrc/core/server/gen" || exit 1
protoc -I . --go_out=. --go-grpc_out=. libcore.proto
}
post_build() {
cd "$wrksrc/core/server"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
VERSION_SINGBOX=$(go list -m -f '{{.Version}}' github.com/sagernet/sing-box)
go build -o "${wrksrc}/build" \
-ldflags="-linkmode=external -w -s -X 'github.com/sagernet/sing-box/constant.Version=${VERSION_SINGBOX}'" \
-tags="with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_dhcp,with_tailscale"
}
do_install() {
vinstall "build/Throne" 755 /usr/lib/throne
vinstall "build/ThroneCore" 755 /usr/lib/throne
vbin "${FILESDIR}/throne"
vinstall "throne.desktop" 644 /usr/share/applications
vinstall res/public/Throne.png 644 \
usr/share/icons/hicolor/512x512/apps throne.png
}cross.patch --- a/3rdparty/simple-protobuf/cmake/spb_protobuf.cmake
+++ b/3rdparty/simple-protobuf/cmake/spb_protobuf.cmake
@@ -129,7 +129,7 @@ function(spb_protobuf_generate)
else()
add_custom_command(
OUTPUT ${_generated_srcs}
- COMMAND $<TARGET_FILE:spb-protoc> ARGS ${spb_PROTOC_OPTIONS} --cpp_out ${spb_PROTOC_OUT_DIR} ${_protobuf_include_path} ${_abs_file}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:spb-protoc> ARGS ${spb_PROTOC_OPTIONS} --cpp_out ${spb_PROTOC_OUT_DIR} ${_protobuf_include_path} ${_abs_file}
DEPENDS ${_abs_file} spb-protoc ${spb_DEPENDENCIES}
COMMENT ${_comment}
VERBATIM ) |
Testing the changes
New package
Local build testing
closes #56762