net-proxy/nekoray: new package, add 4.3.5

Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
This commit is contained in:
Pavel Sobolev
2025-05-13 21:27:44 +03:00
parent 4ea43d5f1c
commit b3fa8b7719
5 changed files with 122 additions and 0 deletions

View File

@@ -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

View File

@@ -0,0 +1,21 @@
From: Pavel Sobolev <contact@paveloom.dev>
--- 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

View File

@@ -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

View File

@@ -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>contact@paveloom.dev</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>

View File

@@ -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"
}