From 778bdc1f8ebdbc95b1c8c0218030d4a86fe55159 Mon Sep 17 00:00:00 2001 From: Nuckle Date: Mon, 19 Feb 2024 13:24:44 +0300 Subject: [PATCH 1/2] New package: nekoray-3.26 --- srcpkgs/nekoray/files/nekoray.desktop | 9 ++++ srcpkgs/nekoray/patches/protobuf.patch | 11 +++++ srcpkgs/nekoray/template | 65 ++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 srcpkgs/nekoray/files/nekoray.desktop create mode 100644 srcpkgs/nekoray/patches/protobuf.patch create mode 100644 srcpkgs/nekoray/template diff --git a/srcpkgs/nekoray/files/nekoray.desktop b/srcpkgs/nekoray/files/nekoray.desktop new file mode 100644 index 0000000000000..19414f8bc825a --- /dev/null +++ b/srcpkgs/nekoray/files/nekoray.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=NekoRay +Comment=NekoRay +Exec=nekoray +Icon=nekoray +Terminal=false +StartupWMClass=NekoRay,nekoray,Nekoray,nekoRay +Type=Application +Categories=Network diff --git a/srcpkgs/nekoray/patches/protobuf.patch b/srcpkgs/nekoray/patches/protobuf.patch new file mode 100644 index 0000000000000..ec68cd6537f7c --- /dev/null +++ b/srcpkgs/nekoray/patches/protobuf.patch @@ -0,0 +1,11 @@ +Makes cmake compatible with Void's version of Protobuf +--- a/nekoray/cmake/myproto.cmake ++++ b/nekoray/cmake/myproto.cmake +@@ -1,4 +1,6 @@ +-find_package(Protobuf CONFIG REQUIRED) ++include(FindProtobuf) ++find_package(Protobuf REQUIRED) ++INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) + + set(PROTO_FILES + go/grpc_server/gen/libcore.proto diff --git a/srcpkgs/nekoray/template b/srcpkgs/nekoray/template new file mode 100644 index 0000000000000..1f00f32e36829 --- /dev/null +++ b/srcpkgs/nekoray/template @@ -0,0 +1,65 @@ +# Template file for 'nekoray' +pkgname=nekoray +version=3.26 +revision=1 +archs="x86_64 aarch64" +build_style=cmake +configure_args="-DQT_VERSION_MAJOR=6 -DNKR_PACKAGE=ON" +hostmakedepends="cmake ninja go git protobuf" +makedepends="qt6-tools qt6-base-devel qt6-svg-devel + protobuf-devel yaml-cpp-devel zxing-cpp-devel" +depends="sing-geoip sing-geosite" +short_desc="Qt based cross-platform GUI proxy configuration manager (v2ray/sing-box)" +maintainer="Nuckle " +license="GPL-3.0-or-later, LGPL-3.0-or-later" +homepage="https://matsuridayo.github.io" +changelog="https://github.com/MatsuriDayo/nekoray/releases" +checksum=21977bc7f8e732b5e171a0f4e099050228815a3ca49582056060bff5023e5a20 +build_wrksrc="${pkgname}" + +do_fetch() { + git clone \ + --branch ${version} \ + https://github.com/MatsuriDayo/${pkgname}.git ${wrksrc}/${pkgname} + ls -l + cd ${wrksrc}/${pkgname} + git submodule init + git submodule update +} + +do_extract() { + : # submodule not in tarball +} + +do_build() { + case "$XBPS_TARGET_MACHINE" in + x86_64) ARCH='amd64' ;; + aarch64) ARCH='arm64' ;; + esac + + cd ${wrksrc}/${pkgname} + bash libs/get_source.sh + cd build + cmake -GNinja ${configure_args} .. + ninja + cd ${wrksrc}/${pkgname} + GOOS=linux GOARCH=${ARCH} ./libs/build_go.sh +} + +do_clean() { + go clean -modcache +} + +do_install() { + vmkdir usr/lib/nekoray + vcopy ${wrksrc}/${pkgname}/deployment/linux*/nekobox_core usr/lib/nekoray + vcopy ${wrksrc}/${pkgname}/deployment/linux*/nekoray_core usr/lib/nekoray + + vmkdir usr/bin + vcopy ${wrksrc}/${pkgname}/build/nekoray usr/lib/nekoray + ln -sf /usr/lib/nekoray/nekoray ${DESTDIR}/usr/bin/ + + vinstall ${wrksrc}/${pkgname}/res/public/nekoray.png 644 usr/share/pixmaps + vinstall ${wrksrc}/${pkgname}/res/public/nekobox.png 644 usr/share/pixmaps + vinstall ${FILESDIR}/nekoray.desktop 644 usr/share/applications +} From f3f42ddaabb32177d44cbdad7f887d7c5dced0b0 Mon Sep 17 00:00:00 2001 From: Nuckle Date: Mon, 19 Feb 2024 13:25:27 +0300 Subject: [PATCH 2/2] New package: sing-geoip-20240212 Update template --- srcpkgs/nekoray/patches/add-32bit-archs.patch | 12 +++ srcpkgs/nekoray/patches/protobuf.patch | 4 +- srcpkgs/nekoray/template | 83 ++++++++----------- srcpkgs/sing-geoip/template | 26 ++++++ 4 files changed, 74 insertions(+), 51 deletions(-) create mode 100644 srcpkgs/nekoray/patches/add-32bit-archs.patch create mode 100644 srcpkgs/sing-geoip/template diff --git a/srcpkgs/nekoray/patches/add-32bit-archs.patch b/srcpkgs/nekoray/patches/add-32bit-archs.patch new file mode 100644 index 0000000000000..630df0fdbfcd7 --- /dev/null +++ b/srcpkgs/nekoray/patches/add-32bit-archs.patch @@ -0,0 +1,12 @@ +--- 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 diff --git a/srcpkgs/nekoray/patches/protobuf.patch b/srcpkgs/nekoray/patches/protobuf.patch index ec68cd6537f7c..b00f0d3b3ee21 100644 --- a/srcpkgs/nekoray/patches/protobuf.patch +++ b/srcpkgs/nekoray/patches/protobuf.patch @@ -1,6 +1,6 @@ Makes cmake compatible with Void's version of Protobuf ---- a/nekoray/cmake/myproto.cmake -+++ b/nekoray/cmake/myproto.cmake +--- a/cmake/myproto.cmake ++++ b/cmake/myproto.cmake @@ -1,4 +1,6 @@ -find_package(Protobuf CONFIG REQUIRED) +include(FindProtobuf) diff --git a/srcpkgs/nekoray/template b/srcpkgs/nekoray/template index 1f00f32e36829..6ad933ffe22c1 100644 --- a/srcpkgs/nekoray/template +++ b/srcpkgs/nekoray/template @@ -2,64 +2,49 @@ pkgname=nekoray version=3.26 revision=1 -archs="x86_64 aarch64" +# archs="aarch64* x86_64*" build_style=cmake -configure_args="-DQT_VERSION_MAJOR=6 -DNKR_PACKAGE=ON" -hostmakedepends="cmake ninja go git protobuf" -makedepends="qt6-tools qt6-base-devel qt6-svg-devel - protobuf-devel yaml-cpp-devel zxing-cpp-devel" -depends="sing-geoip sing-geosite" -short_desc="Qt based cross-platform GUI proxy configuration manager (v2ray/sing-box)" -maintainer="Nuckle " -license="GPL-3.0-or-later, LGPL-3.0-or-later" +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" +# depends="sing-geoip sing-geosite" +short_desc="GUI proxy configuration manager (backend: v2ray / sing-box)" +maintainer="chrysos349 " +license="GPL-3.0-or-later" homepage="https://matsuridayo.github.io" changelog="https://github.com/MatsuriDayo/nekoray/releases" -checksum=21977bc7f8e732b5e171a0f4e099050228815a3ca49582056060bff5023e5a20 -build_wrksrc="${pkgname}" - -do_fetch() { - git clone \ - --branch ${version} \ - https://github.com/MatsuriDayo/${pkgname}.git ${wrksrc}/${pkgname} - ls -l - cd ${wrksrc}/${pkgname} - git submodule init - git submodule update +_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 } -do_extract() { - : # submodule not in tarball -} - -do_build() { - case "$XBPS_TARGET_MACHINE" in - x86_64) ARCH='amd64' ;; - aarch64) ARCH='arm64' ;; - esac - - cd ${wrksrc}/${pkgname} - bash libs/get_source.sh - cd build - cmake -GNinja ${configure_args} .. - ninja - cd ${wrksrc}/${pkgname} - GOOS=linux GOARCH=${ARCH} ./libs/build_go.sh -} - -do_clean() { - go clean -modcache +post_build() { + ./libs/get_source.sh + ./libs/build_go.sh } do_install() { - vmkdir usr/lib/nekoray - vcopy ${wrksrc}/${pkgname}/deployment/linux*/nekobox_core usr/lib/nekoray - vcopy ${wrksrc}/${pkgname}/deployment/linux*/nekoray_core usr/lib/nekoray + vinstall build/nekoray 755 usr/lib/nekoray + vcopy deployment/linux*/neko* usr/lib/nekoray - vmkdir usr/bin - vcopy ${wrksrc}/${pkgname}/build/nekoray usr/lib/nekoray - ln -sf /usr/lib/nekoray/nekoray ${DESTDIR}/usr/bin/ + vmkdir usr/share/pixmaps + vcopy res/public/neko* usr/share/pixmaps - vinstall ${wrksrc}/${pkgname}/res/public/nekoray.png 644 usr/share/pixmaps - vinstall ${wrksrc}/${pkgname}/res/public/nekobox.png 644 usr/share/pixmaps vinstall ${FILESDIR}/nekoray.desktop 644 usr/share/applications + + vmkdir usr/bin + ln -s /usr/lib/nekoray/nekoray ${DESTDIR}/usr/bin } diff --git a/srcpkgs/sing-geoip/template b/srcpkgs/sing-geoip/template new file mode 100644 index 0000000000000..031e76f1bd96d --- /dev/null +++ b/srcpkgs/sing-geoip/template @@ -0,0 +1,26 @@ +# Template file for 'sing-geoip' +pkgname=sing-geoip +version=20240212 +revision=1 +build_style=meta +hostmakedepends="go" +short_desc="Geoip database and rule sets for sing-box" +maintainer="Nuckle " +license="GPL-3.0-or-later, LGPL-3.0-or-later" +homepage="https://github.com/SagerNet/sing-geoip" +changelog="https://github.com/SagerNet/sing-geoip/releases" +distfiles="https://github.com/SagerNet/sing-geoip/archive/refs/tags/${version}.tar.gz" +checksum=9c45705de8bff9ac875a332e5b2dc26b5658414f2da75b69e7e306931e6c1308 + +do_build() { + cd ${wrksrc} + NO_SKIP=true go run -modcacherw -v . +} + +do_install() { + vmkdir usr/share/sing-geoip + vmkdir usr/share/sing-geoip/rule-set + + vcopy ${wrksrc}/rule-set/* usr/share/sing-geoip/rule-set + vcopy ${wrksrc}/*.db usr/share/sing-geoip +}