Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package: nekoray 3.26 #48831

Closed
wants to merge 3 commits into from
Closed

New package: nekoray 3.26 #48831

wants to merge 3 commits into from

Conversation

nuckle
Copy link
Contributor

@nuckle nuckle commented Feb 19, 2024

Testing the changes

  • I tested the changes in this PR: briefly

New package

Local build testing

  • I built this PR locally for my native architecture, (x86_64-glibc)

@nuckle nuckle changed the title Nekoray New package: nekoray 3.26 Feb 19, 2024
@slymattz
Copy link
Contributor

As far as I know, you should insert distfiles before checksum and remove do_fetch (from what I've learned git clone in do_fetch is not the right way to do it in Void):
distfiles="https://github.com/MatsuriDayo/nekoray/archive/refs/tags/${version}.tar.gz"

Oh, and remember to update the sha256sum checksum.

@nuckle
Copy link
Contributor Author

nuckle commented Feb 19, 2024

As far as I know, you should insert distfiles before checksum and remove do_fetch (from what I've learned git clone in do_fetch is not the right way to do it in Void): distfiles="https://github.com/MatsuriDayo/nekoray/archive/refs/tags/${version}.tar.gz"

Oh, and remember to update the sha256sum checksum.

Yes, I checked the order with xlint. I tried to create this template without dealing with do_fetch, but the issue is that .tar doesn't contain any files for 3rd party dependencies and there's no git repository inside of it. You can't compile nekoray without those submodules, so you have to use something like this

git clone https://github.com/MatsuriDayo/nekoray.git --recursive

or this

git clone \
 --branch ${version} \
 https://github.com/MatsuriDayo/${pkgname}.git ${wrksrc}/${pkgname}
cd ${wrksrc}/${pkgname}
git submodule init
git submodule update

to get them. Also there's an issue with database packages. I tried to use build_style=go, but looks like the binary is useless and the only way to make use of it is to run it directly with go run -v ., but I don't really know how to do it properly in Void's template format, so it's kind of a mess too

@slymattz
Copy link
Contributor

slymattz commented Feb 19, 2024

In this case, maybe somebody more knowledgeable than myself will inspect your code and be able to help you with this multi-faceted problem.

@chrysos349
Copy link
Contributor

# Template file for 'nekoray'
pkgname=nekoray
version=3.26
revision=1
build_style=cmake
archs="aarch64* x86_64*"
configure_args="-DNKR_PACKAGE=ON -DQT_VERSION_MAJOR=6"
hostmakedepends="git go protobuf qt6-base qt6-tools"
makedepends="protobuf-devel qt6-svg-devel yaml-cpp-devel zxing-cpp-devel"
short_desc="GUI proxy configuration manager (backend: v2ray / sing-box)"
maintainer="chrysos349 <chrysostom349@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://matsuridayo.github.io"
changelog="https://github.com/MatsuriDayo/nekoray/releases"
_qho_commit=52e25acf221e5ac86ce648f6922620fb2d6a7121
_qjs_commit=3fb0770c9ee5ab031a56072520641d4577b694e3
distfiles="https://github.com/MatsuriDayo/nekoray/archive/${version}.tar.gz
 https://github.com/Skycoder42/QHotkey/archive/${_qho_commit}.tar.gz
 https://github.com/MatsuriDayo/qjs/archive/${_qjs_commit}.tar.gz"
checksum="21977bc7f8e732b5e171a0f4e099050228815a3ca49582056060bff5023e5a20
 e1d69ed7b718770be9b58de674ba59362a3227437071cf575f0481d921c414b5
 1cc5262c624d42644c2c0cce0fae9ea6fd258d37f2ac6a5096ab55f814ea2faa"

. $XBPS_COMMONDIR/environment/build-style/go.sh
export GOOS=linux

post_extract() {
	mv nekoray-*/* .
	mv QHotkey-*/* 3rdparty/QHotkey
	mv qjs-*/* 3rdparty/qjs
}

post_build() {
	./libs/get_source.sh
	./libs/build_go.sh
}

do_install() {
	vinstall build/nekoray 755 usr/lib/nekoray
	vcopy deployment/linux*/neko* usr/lib/nekoray

	vmkdir usr/share/pixmaps
	vcopy res/public/neko* usr/share/pixmaps

	vinstall ${FILESDIR}/nekoray.desktop 644 usr/share/applications

	vmkdir usr/bin
	ln -s /usr/lib/nekoray/nekoray ${DESTDIR}/usr/bin
}

@chrysos349
Copy link
Contributor

you could also add 32-bit archs support via the patch below. i didn't encounter any cross-compilation errors. i can't guarantee there won't be any runtime errors, though. if you decide to use the patch, remove archs= in the template.

add-32bit-archs.patch

--- a/libs/build_go.sh
+++ b/libs/build_go.sh
@@ -5,7 +5,9 @@ source libs/env_deploy.sh
 [ "$GOOS" == "windows" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/windows64 || true
 [ "$GOOS" == "windows" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/windows-arm64 || true
 [ "$GOOS" == "linux" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/linux64 || true
+[ "$GOOS" == "linux" ] && [ "$GOARCH" == "386" ] && DEST=$DEPLOYMENT/linux32 || true
 [ "$GOOS" == "linux" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/linux-arm64 || true
+[ "$GOOS" == "linux" ] && [ "$GOARCH" == "arm" ] && DEST=$DEPLOYMENT/linux-arm || true
 [ "$GOOS" == "darwin" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/macos-amd64 || true
 [ "$GOOS" == "darwin" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/macos-arm64 || true
 if [ -z $DEST ]; then

@nuckle
Copy link
Contributor Author

nuckle commented Feb 19, 2024

# Template file for 'nekoray'
pkgname=nekoray
version=3.26
revision=1
build_style=cmake
archs="aarch64* x86_64*"
configure_args="-DNKR_PACKAGE=ON -DQT_VERSION_MAJOR=6"
hostmakedepends="git go protobuf qt6-base qt6-tools"
makedepends="protobuf-devel qt6-svg-devel yaml-cpp-devel zxing-cpp-devel"
short_desc="GUI proxy configuration manager (backend: v2ray / sing-box)"
maintainer="chrysos349 <chrysostom349@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://matsuridayo.github.io"
changelog="https://github.com/MatsuriDayo/nekoray/releases"
_qho_commit=52e25acf221e5ac86ce648f6922620fb2d6a7121
_qjs_commit=3fb0770c9ee5ab031a56072520641d4577b694e3
distfiles="https://github.com/MatsuriDayo/nekoray/archive/${version}.tar.gz
 https://github.com/Skycoder42/QHotkey/archive/${_qho_commit}.tar.gz
 https://github.com/MatsuriDayo/qjs/archive/${_qjs_commit}.tar.gz"
checksum="21977bc7f8e732b5e171a0f4e099050228815a3ca49582056060bff5023e5a20
 e1d69ed7b718770be9b58de674ba59362a3227437071cf575f0481d921c414b5
 1cc5262c624d42644c2c0cce0fae9ea6fd258d37f2ac6a5096ab55f814ea2faa"

. $XBPS_COMMONDIR/environment/build-style/go.sh
export GOOS=linux

post_extract() {
	mv nekoray-*/* .
	mv QHotkey-*/* 3rdparty/QHotkey
	mv qjs-*/* 3rdparty/qjs
}

post_build() {
	./libs/get_source.sh
	./libs/build_go.sh
}

do_install() {
	vinstall build/nekoray 755 usr/lib/nekoray
	vcopy deployment/linux*/neko* usr/lib/nekoray

	vmkdir usr/share/pixmaps
	vcopy res/public/neko* usr/share/pixmaps

	vinstall ${FILESDIR}/nekoray.desktop 644 usr/share/applications

	vmkdir usr/bin
	ln -s /usr/lib/nekoray/nekoray ${DESTDIR}/usr/bin
}

Looks great and compiles without errors. The only remain part is .db files. As for 32 bits patch, I don't know if it'll work or not, since the maintainer clearly doesn't support it (at least oficially), but maybe someone who uses i386 could try this patch

MatsuriDayo/nekoray#8

@classabbyamp classabbyamp added the new-package This PR adds a new package label Feb 19, 2024
@nuckle nuckle force-pushed the nekoray branch 5 times, most recently from 3473112 to 01c5e11 Compare February 20, 2024 07:08
makedepends="protobuf-devel qt6-svg-devel yaml-cpp-devel zxing-cpp-devel"
depends="sing-geoip sing-geosite"
short_desc="GUI proxy configuration manager (backend: v2ray / sing-box)"
maintainer="chrysos349 <chrysostom349@gmail.com>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put yourself as a maintainer of the template.

@nuckle nuckle force-pushed the nekoray branch 3 times, most recently from 9e9ab12 to f865c8a Compare February 20, 2024 08:19
@nuckle nuckle force-pushed the nekoray branch 2 times, most recently from 1ad168f to 99f9b64 Compare February 28, 2024 20:04
Copy link

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

@github-actions github-actions bot added the Stale label May 29, 2024
@github-actions github-actions bot closed this Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-package This PR adds a new package Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants