commit:     b3fa8b77197fea66dee4d51f153461677e566a8f
Author:     Pavel Sobolev <contact <AT> paveloom <DOT> dev>
AuthorDate: Tue May 13 18:27:44 2025 +0000
Commit:     Pavel Sobolev <contact <AT> paveloom <DOT> dev>
CommitDate: Sun May 25 18:42:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b3fa8b77

net-proxy/nekoray: new package, add 4.3.5

Signed-off-by: Pavel Sobolev <contact <AT> paveloom.dev>

 net-proxy/nekoray/Manifest                         |  2 +
 .../files/nekoray-4.3.5-use-system-qhotkey.patch   | 21 ++++++
 net-proxy/nekoray/files/nekoray.desktop            | 11 ++++
 net-proxy/nekoray/metadata.xml                     | 12 ++++
 net-proxy/nekoray/nekoray-4.3.5.ebuild             | 76 ++++++++++++++++++++++
 5 files changed, 122 insertions(+)

diff --git a/net-proxy/nekoray/Manifest b/net-proxy/nekoray/Manifest
new file mode 100644
index 0000000000..f8604407ba
--- /dev/null
+++ b/net-proxy/nekoray/Manifest
@@ -0,0 +1,2 @@
+DIST nekoray-4.3.5-deps.tar.xz 5031332 BLAKE2B 
4975beab9ee4f644579e38349e9961319bea356766bb2b71c1867359384c86ec0fe2de2237321f1eefadb0b62bc0965b59c8e1a16902a793a6315a7aacd0d23a
 SHA512 
eaa49199066f9d6d0dc60a8404597ff862253bba21c63e9f68ba61a5ecb1930156772fa5f1d0c556541ce1e24db262f893aecc1895dc684945d36b58e4719984
+DIST nekoray-4.3.5.tar.gz 1142930 BLAKE2B 
c07653f0fe6a74a5881233125659fea7a844aea7275ace496b320cb6f8d323e7875598ebe3be0124c1607307acaa8390cc16a66e72f942230e4fcfdec3eb760b
 SHA512 
d22dbd19860d325cb1e1108905840c1e0adf28fb5e30a7d86b0e9c0cb416af0b3035f07f398684017f69de5b6ac4d74f7c4bcc87fab942128195e45b77cf2539

diff --git a/net-proxy/nekoray/files/nekoray-4.3.5-use-system-qhotkey.patch 
b/net-proxy/nekoray/files/nekoray-4.3.5-use-system-qhotkey.patch
new file mode 100644
index 0000000000..45cdeff3c6
--- /dev/null
+++ b/net-proxy/nekoray/files/nekoray-4.3.5-use-system-qhotkey.patch
@@ -0,0 +1,21 @@
+From: Pavel Sobolev <[email protected]>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -48,7 +48,6 @@ message("[CMAKE_FIND_ROOT_PATH] ${CMAKE_FIND_ROOT_PATH}")
+ 
+ include("cmake/print.cmake")
+ include("cmake/nkr.cmake")
+-include("cmake/QHotkey.cmake")
+ 
+ find_package(Threads)
+ 
+@@ -65,7 +64,7 @@ list(APPEND NKR_EXTERNAL_TARGETS yaml-cpp)
+ find_package(ZXing CONFIG REQUIRED)
+ list(APPEND NKR_EXTERNAL_TARGETS ZXing::ZXing)
+ 
+-set(BUILD_SHARED_LIBS OFF)
++find_package(QHotkey CONFIG REQUIRED)
+ list(APPEND NKR_EXTERNAL_TARGETS qhotkey)
+ 
+ # Sources

diff --git a/net-proxy/nekoray/files/nekoray.desktop 
b/net-proxy/nekoray/files/nekoray.desktop
new file mode 100644
index 0000000000..cd8fd67dfe
--- /dev/null
+++ b/net-proxy/nekoray/files/nekoray.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Version=1.0
+Terminal=false
+Type=Application
+Name=NekoRay
+Categories=Network;
+Comment=Qt based cross-platform GUI proxy configuration manager (backend: 
sing-box)
+Comment[zh_CN]=基于 Qt 的跨平台代理配置管理器 (后端 sing-box)
+Keywords=Internet;VPN;Proxy;sing-box;
+Exec=nekoray
+Icon=nekobox

diff --git a/net-proxy/nekoray/metadata.xml b/net-proxy/nekoray/metadata.xml
new file mode 100644
index 0000000000..601e381236
--- /dev/null
+++ b/net-proxy/nekoray/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>[email protected]</email>
+    <name>Pavel Sobolev</name>
+  </maintainer>
+  <upstream>
+    <bugs-to>https://github.com/Mahdi-zarei/nekoray/issues</bugs-to>
+    <remote-id type="github">Mahdi-zarei/nekoray</remote-id>
+  </upstream>
+</pkgmetadata>

diff --git a/net-proxy/nekoray/nekoray-4.3.5.ebuild 
b/net-proxy/nekoray/nekoray-4.3.5.ebuild
new file mode 100644
index 0000000000..12159b0392
--- /dev/null
+++ b/net-proxy/nekoray/nekoray-4.3.5.ebuild
@@ -0,0 +1,76 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake desktop go-module xdg
+
+DESCRIPTION="Qt based cross-platform GUI proxy configuration manager"
+HOMEPAGE="https://github.com/Mahdi-zarei/nekoray";
+SRC_URI="
+       https://github.com/Mahdi-zarei/nekoray/archive/refs/tags/${PV}.tar.gz 
-> ${P}.tar.gz
+       
https://gitlab.com/api/v4/projects/69517529/packages/generic/${PN}/${PV}/${P}-deps.tar.xz
+"
+
+# The first line is for the C++ code, the second line is for the Go module
+LICENSE="
+       GPL-3+ MIT
+       0BSD Apache-2.0 BSD ISC MIT MPL-2.0 Unlicense
+"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+       dev-cpp/abseil-cpp
+       dev-cpp/yaml-cpp
+       dev-libs/protobuf:=
+       dev-libs/qhotkey[qt6]
+       dev-qt/qtbase:6[dbus,network,widgets]
+       media-libs/zxing-cpp
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       dev-qt/qttools:6[linguist]
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.3.5-use-system-qhotkey.patch
+)
+
+src_unpack() {
+       # The vendor tarball is unpacked to `${S}/core/server`, but 
`go-module_src_unpack`
+       # requires the `vendor` directory to be present at `${S}/vendor`
+       mkdir -p "${S}/vendor" || die
+
+       go-module_src_unpack
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DNKR_PACKAGE=true
+       )
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake_src_compile
+
+       cd "${S}/core/server" || die
+
+       VERSION_SINGBOX=$(go list -m -f '{{.Version}}' 
github.com/sagernet/sing-box)
+       ego build \
+               -trimpath -ldflags "-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_ech,with_dhcp"
+}
+
+src_install() {
+       exeinto /usr/lib/nekoray
+       doexe "${BUILD_DIR}/nekoray"
+       doexe core/server/nekobox_core
+
+       dosym -r /usr/lib/nekoray/nekoray /usr/bin/nekoray
+
+       doicon -s 256 res/public/nekobox.png
+       domenu "${FILESDIR}/nekoray.desktop"
+}

Reply via email to