yass-1.24.13gentoo-zh
download
# Copyright 2024-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# see examples at sci-chemistry/gromacs/gromacs's ebuild files
CMAKE_MAKEFILE_GENERATOR="ninja"
inherit cmake unpacker xdg
DESCRIPTION="lightweight and efficient, socks5/http forward proxy"
HOMEPAGE="https://github.com/hukeyue/yass"
SRC_URI="https://github.com/hukeyue/yass/releases/download/${PV}/${PN}-${PV}.tar.zst"
S="${WORKDIR}/${PN}-${PV}"
LICENSE="GPL-2"
SLOT="0"
#KEYWORDS="amd64 ~arm ~arm64 ~loong ~mips ~riscv ~x86"
#FIXME pkgcheck cries on NonsolvableDepsInDev on mips, no idea why
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~x86"
IUSE="+cli server dylib test cet gui gtk3 gtk4 qt6 wayland tbbmalloc tcmalloc mimalloc jemalloc"
# tested with FEATURES="-network-sandbox test"
# tested with FEATURES="network-sandbox test"
# tested with FEATURES="test"
RESTRICT="!test? ( test )"
REQUIRED_USE="
cet? ( ^^ ( amd64 x86 ) )
gui? ( || ( gtk3 gtk4 qt6 ) )
tbbmalloc? ( !tcmalloc !mimalloc !jemalloc )
tcmalloc? ( !mimalloc !jemalloc )
mimalloc? ( !jemalloc )
"
PDEPEND="
app-misc/ca-certificates
"
RDEPEND="
net-libs/mbedtls
virtual/zlib
net-dns/c-ares
net-libs/nghttp2
dev-libs/jsoncpp
tbbmalloc? ( dev-cpp/tbb )
tcmalloc? ( dev-util/google-perftools )
mimalloc? ( dev-libs/mimalloc )
jemalloc? ( dev-libs/jemalloc )
gui? (
gtk3? (
dev-libs/glib:2
x11-libs/gtk+:3[wayland?]
)
gtk4? (
dev-libs/glib:2
gui-libs/gtk:4[wayland?]
)
qt6? (
dev-qt/qtbase:6=[dbus,gui,widgets,wayland?]
wayland? ( dev-qt/qtwayland:6 )
)
)
"
DEPEND="${RDEPEND}"
BDEPEND="
dev-lang/perl
dev-lang/go
>=dev-build/cmake-3.13.4
app-alternatives/ninja
virtual/pkgconfig
gui? (
gtk3? (
sys-devel/gettext
)
gtk4? (
sys-devel/gettext
)
)
test? ( net-misc/curl )
"
PATCHES=(
"${FILESDIR}/${PN}-1.24.13-fix-gcc16.patch"
)
src_prepare() {
local cmake_compat_files=(
third_party/boringssl/src/util/ar/testdata/sample/CMakeLists.txt
third_party/protobuf/examples/CMakeLists.txt
third_party/oneTBB/examples/sycl/tbb-async-sycl/CMakeLists.txt
third_party/oneTBB/examples/sycl/tbb-resumable-tasks-sycl/CMakeLists.txt
third_party/oneTBB/examples/sycl/tbb-task-sycl/CMakeLists.txt
third_party/mbedtls/CMakeLists.txt
third_party/mbedtls/programs/test/cmake_package/CMakeLists.txt
third_party/mbedtls/programs/test/cmake_package_install/CMakeLists.txt
third_party/mbedtls/programs/test/cmake_subproject/CMakeLists.txt
)
sed -i -E \
-e 's/cmake_minimum_required[[:space:]]*\([[:space:]]*VERSION[[:space:]]+[0-9.]+[[:space:]]*\)/cmake_minimum_required(VERSION 3.10)/' \
"${cmake_compat_files[@]}" || die
cmake_src_prepare
# some tests require network access, comment it out if not supported
if has network-sandbox ${FEATURES}; then
sed -i -e 's/BUILD_TESTS_NO_NETWORK/BUILD_TESTS/g' "${S}/CMakeLists.txt"
fi
}
src_configure() {
local mycmakeargs=(
-DCMAKE_INSTALL_SYSCONFDIR=/etc
-DCMAKE_INSTALL_LIBEXECDIR=libexec
-DUSE_DEBUG_FISSION=OFF
-DUSE_COMPRESS_DEBUG_SECTIONS=off
-DUSE_LIBCXX=off
-DUSE_TBB=off
-DCLI=$(usex cli)
-DSERVER=$(usex server)
-DUSE_CET=$(usex cet)
-DBUILD_DYLIB=$(usex dylib)
-DBUILD_TESTS=$(usex test)
-DUSE_TBBMALLOC=$(usex tbbmalloc)
-DUSE_SYSTEM_TBBMALLOC=$(usex tbbmalloc)
-DUSE_TCMALLOC=$(usex tcmalloc)
-DUSE_SYSTEM_TCMALLOC=$(usex tcmalloc)
-DUSE_MIMALLOC=$(usex mimalloc)
-DUSE_SYSTEM_MIMALLOC=$(usex mimalloc)
-DUSE_JEMALLOC=$(usex jemalloc)
-DUSE_SYSTEM_JEMALLOC=$(usex jemalloc)
-DUSE_SYSTEM_MBEDTLS=on
-DUSE_ZLIB=on
-DUSE_SYSTEM_ZLIB=on
-DUSE_CARES=on
-DUSE_SYSTEM_CARES=on
-DUSE_SYSTEM_NGHTTP2=on
-DUSE_JSONCPP=on
-DUSE_SYSTEM_JSONCPP=on
)
if use qt6; then
mycmakeargs+=( -DGUI=ON -DUSE_QT6=ON )
elif use gtk4; then
mycmakeargs+=( -DGUI=ON -DUSE_GTK4=ON )
elif use gtk3; then
mycmakeargs+=( -DGUI=ON -DUSE_GTK4=OFF )
else
mycmakeargs+=( -DGUI=OFF )
fi
cmake_src_configure
}