diff --git a/metadata/md5-cache/net-proxy/nekoray-4.3.7 b/metadata/md5-cache/net-proxy/nekoray-4.3.7 new file mode 100644 index 0000000..611a598 --- /dev/null +++ b/metadata/md5-cache/net-proxy/nekoray-4.3.7 @@ -0,0 +1,15 @@ +BDEPEND=dev-qt/qttools:6[linguist] app-alternatives/ninja >=dev-build/cmake-3.20.5 >=dev-lang/go-1.20:= app-arch/unzip +DEFINED_PHASES=compile configure install postinst postrm preinst prepare test unpack +DEPEND=dev-cpp/abseil-cpp:= dev-libs/protobuf:= dev-libs/qhotkey dev-qt/qtbase:6[dbus,network,widgets] media-libs/quirc:= dev-cpp/fkYAML +DESCRIPTION=Qt based cross-platform GUI proxy configuration manager +EAPI=8 +HOMEPAGE=https://github.com/Mahdi-zarei/nekoray +IDEPEND=dev-util/desktop-file-utils x11-misc/shared-mime-info +INHERIT=cmake desktop go-module xdg +KEYWORDS=~amd64 +LICENSE=GPL-3+ MIT 0BSD Apache-2.0 BSD ISC MIT MPL-2.0 Unlicense +RDEPEND=dev-cpp/abseil-cpp:= dev-libs/protobuf:= dev-libs/qhotkey dev-qt/qtbase:6[dbus,network,widgets] media-libs/quirc:= +SLOT=0 +SRC_URI=https://github.com/Mahdi-zarei/nekoray/archive/refs/tags/4.3.7.tar.gz -> nekoray-4.3.7.tar.gz https://gitlab.com/api/v4/projects/69517529/packages/generic/nekoray/4.3.7/nekoray-4.3.7-deps.tar.xz +_eclasses_=cmake 460729dc36f68cf03b044bc1d367e34a desktop 3a72ffe0d8e1dd73af3a1c8c15a59fed flag-o-matic a7afe42e95fb46ce9691605acfb24672 go-env 0e2babf96e7d0b045fc07ad199eb2399 go-module d96f2a2fd6d8fbad6d94516bf238f885 multiprocessing 1e32df7deee68372153dca65f4a7c21f ninja-utils 2df4e452cea39a9ec8fb543ce059f8d6 toolchain-funcs a0b29008c671a362b505f96fa80ce9c0 xdg 3ef49a87c52c8b77c476351195dfe575 xdg-utils 42869b3c8d86a70ef3cf75165a395e09 +_md5_=426fac7760ee4f68801f1422d7ce8e25 diff --git a/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-QHotkey.patch b/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-QHotkey.patch new file mode 100644 index 0000000..1266d4f --- /dev/null +++ b/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-QHotkey.patch @@ -0,0 +1,33 @@ +From: Pavel Sobolev +Subject: [PATCH] Use system `QHotkey`. + +Signed-off-by: Pavel Sobolev + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,7 +45,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) + +@@ -57,6 +56,7 @@ include("cmake/myproto.cmake") + list(APPEND NKR_EXTERNAL_TARGETS myproto) + + set(BUILD_SHARED_LIBS OFF) ++find_package(QHotkey CONFIG REQUIRED) + list(APPEND NKR_EXTERNAL_TARGETS qhotkey) + + # Sources +--- a/src/ui/mainwindow.cpp ++++ b/src/ui/mainwindow.cpp +@@ -50,7 +50,7 @@ + #endif + #include + #include +-#include <3rdparty/QHotkey/qhotkey.h> ++#include + #include + #include diff --git a/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-fkYAML.patch b/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-fkYAML.patch new file mode 100644 index 0000000..c179983 --- /dev/null +++ b/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-fkYAML.patch @@ -0,0 +1,26 @@ +From: Pavel Sobolev +Subject: [PATCH] Use system `fkYAML`. + +Signed-off-by: Pavel Sobolev + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,6 +59,8 @@ set(BUILD_SHARED_LIBS OFF) + find_package(QHotkey CONFIG REQUIRED) + list(APPEND NKR_EXTERNAL_TARGETS qhotkey) + ++find_package(fkYAML CONFIG REQUIRED) ++ + # Sources + set(PROJECT_SOURCES + ${PLATFORM_SOURCES} +--- a/src/configs/sub/GroupUpdater.cpp ++++ b/src/configs/sub/GroupUpdater.cpp +@@ -7,7 +7,7 @@ + #include + #include + +-#include "3rdparty/fkYAML/node.hpp" ++#include + + namespace NekoGui_sub { diff --git a/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-quirc.patch b/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-quirc.patch new file mode 100644 index 0000000..677721d --- /dev/null +++ b/net-proxy/nekoray/files/nekoray-4.3.7-Use-system-quirc.patch @@ -0,0 +1,37 @@ +From: Pavel Sobolev +Subject: [PATCH] Use system `quirc`. + +Signed-off-by: Pavel Sobolev + +--- a/3rdparty/QrDecoder.cpp ++++ b/3rdparty/QrDecoder.cpp +@@ -1,6 +1,6 @@ + #include "QrDecoder.h" + +-#include "quirc/quirc.h" ++#include + + QrDecoder::QrDecoder() + : m_qr(quirc_new()) +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -83,11 +83,6 @@ set(PROJECT_SOURCES + 3rdparty/qv2ray/v2/ui/widgets/speedchart/SpeedWidget.hpp + 3rdparty/qv2ray/v2/proxy/QvProxyConfigurator.cpp + +- 3rdparty/quirc/decode.c +- 3rdparty/quirc/identify.c +- 3rdparty/quirc/quirc.c +- 3rdparty/quirc/version_db.c +- + src/api/gRPC.cpp + + src/dataStore/Database.cpp +@@ -263,6 +258,7 @@ target_link_libraries(nekoray PRIVATE + Threads::Threads + ${NKR_EXTERNAL_TARGETS} + ${PLATFORM_LIBRARIES} ++ quirc + ) + + qt_finalize_executable(nekoray) diff --git a/net-proxy/nekoray/files/nekoray.desktop b/net-proxy/nekoray/files/nekoray.desktop new file mode 100644 index 0000000..cd8fd67 --- /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/nekoray-4.3.7.ebuild b/net-proxy/nekoray/nekoray-4.3.7.ebuild new file mode 100644 index 0000000..b9f3160 --- /dev/null +++ b/net-proxy/nekoray/nekoray-4.3.7.ebuild @@ -0,0 +1,86 @@ +# 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-libs/protobuf:= + dev-libs/qhotkey + dev-qt/qtbase:6[dbus,network,widgets] + media-libs/quirc:= +" +DEPEND=" + ${RDEPEND} + dev-cpp/fkYAML +" +BDEPEND=" + dev-qt/qttools:6[linguist] +" + +PATCHES=( + "${FILESDIR}/${PN}-4.3.7-Use-system-fkYAML.patch" + "${FILESDIR}/${PN}-4.3.7-Use-system-QHotkey.patch" + "${FILESDIR}/${PN}-4.3.7-Use-system-quirc.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_prepare() { + rm -r 3rdparty/{fkYAML,QHotkey,quirc} || die + + cmake_src_prepare +} + +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" +}