app-editors/zed: add 0.144.3, drop 0.143.7
[gentoo-zh.git] / net-proxy / yass / yass-1.11.4.ebuild
blob73ff5ee81fcba63bbac80f0ce13decee47fd1d94
1 # Copyright 2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 # see examples at sci-chemistry/gromacs/gromacs's ebuild files
7 CMAKE_MAKEFILE_GENERATOR="ninja"
9 inherit cmake xdg
11 MY_PN="yass"
12 DESCRIPTION="lightweight and efficient, socks5/http forward proxy"
13 HOMEPAGE="https://github.com/Chilledheart/yass"
14 SRC_URI="https://github.com/Chilledheart/yass/releases/download/${PV}/yass-${PV}.tar.bz2"
15 S="${WORKDIR}/${MY_PN}-${PV}"
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~riscv ~x86"
20 IUSE="+cli server test +gui gtk3 gtk4 +qt5 qt6 wayland +tcmalloc mimalloc"
22 # tested with FEATURES="-network-sandbox test"
23 # tested with FEATURES="network-sandbox test"
24 # tested with FEATURES="test"
25 RESTRICT="!test? ( test )"
27 REQUIRED_USE="
28         gui? ( ^^ ( gtk3 gtk4 qt5 qt6 ) )
29         loong? ( !gtk4 )
30         tcmalloc? ( !mimalloc )
33 PDEPEND="
34         app-misc/ca-certificates
37 RDEPEND="
38         net-libs/mbedtls
39         sys-libs/zlib
40         net-dns/c-ares
41         net-libs/nghttp2
42         tcmalloc? ( dev-util/google-perftools )
43         mimalloc? ( dev-libs/mimalloc )
44         gui? (
45                 gtk3? (
46                         dev-libs/glib:2
47                         x11-libs/gtk+:3[wayland?]
48                 )
49                 gtk4? (
50                         dev-libs/glib:2
51                         gui-libs/gtk:4[wayland?]
52                 )
53                 qt5? (
54                         dev-qt/qtcore:5
55                         dev-qt/qtgui:5
56                         dev-qt/qtwidgets:5
57                         wayland? ( dev-qt/qtwayland:5 )
58                 )
59                 qt6? (
60                         dev-qt/qtbase:6=[dbus,gui,widgets,wayland?]
61                         wayland? ( dev-qt/qtwayland:6 )
62                 )
63         )
65 DEPEND="${RDEPEND}"
66 BDEPEND="
67         dev-lang/perl
68         dev-lang/go
69         >=dev-build/cmake-3.13.4
70         app-alternatives/ninja
71         virtual/pkgconfig
72         gui? (
73                 gtk3? (
74                         sys-devel/gettext
75                 )
76                 gtk4? (
77                         sys-devel/gettext
78                 )
79         )
80         test? ( net-misc/curl )
83 src_prepare() {
84         cmake_src_prepare
85         # some tests require network access, comment it out if not supported
86         if has network-sandbox ${FEATURES}; then
87                 sed -i -e 's/BUILD_TESTS_NO_NETWORK/BUILD_TESTS/g' "${S}/CMakeLists.txt"
88         fi
91 src_configure() {
92         local mycmakeargs=(
93                 -DCMAKE_INSTALL_SYSCONFDIR=/etc
94                 -DBUILD_SHARED_LIBS=off
95                 -DUSE_BUILTIN_CA_BUNDLE_CRT=off
96                 -DUSE_LIBCXX=off
97                 -DENABLE_GOLD=off
98                 -DCLI=$(usex cli)
99                 -DSERVER=$(usex server)
100                 -DGUI=$(usex gui)
101                 -DUSE_GTK4=$(usex gtk4)
102                 -DUSE_QT5=$(usex qt5)
103                 -DUSE_QT6=$(usex qt6)
104                 -DBUILD_TESTS=$(usex test)
105                 -DUSE_TCMALLOC=$(usex tcmalloc)
106                 -DUSE_SYSTEM_TCMALLOC=$(usex tcmalloc)
107                 -DUSE_MIMALLOC=$(usex mimalloc)
108                 -DUSE_SYSTEM_MIMALLOC=$(usex mimalloc)
109                 -DUSE_SYSTEM_MBEDTLS=on
110                 -DUSE_SYSTEM_ZLIB=on
111                 -DUSE_SYSTEM_CARES=on
112                 -DUSE_SYSTEM_NGHTTP2=on
113         )
114         cmake_src_configure