dev-python/conda-libmamba-solver: bump version to 24.11.1
[gentoo-zh.git] / net-proxy / dae / dae-0.9.0.ebuild
blobcd43bcf9d19f5fd1380777aaacedee9df736d023
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit flag-o-matic linux-info go-module systemd shell-completion
8 _MY_PV=${PV/_rc/rc}
10 DESCRIPTION="A lightweight and high-performance transparent proxy solution based on eBPF"
11 HOMEPAGE="https://github.com/daeuniverse/dae"
12 SRC_URI="
13 https://github.com/daeuniverse/dae/releases/download/v${_MY_PV}/dae-full-src.zip -> ${P}.zip
16 S="${WORKDIR}"
18 LICENSE="AGPL-3"
19 SLOT="0"
20 KEYWORDS="~amd64 ~riscv"
21 MINKV="5.17"
23 DEPEND="
24 app-alternatives/v2ray-geoip
25 app-alternatives/v2ray-geosite
27 RDEPEND="$DEPEND"
28 BDEPEND="llvm-core/clang"
30 pkg_pretend() {
31 local CONFIG_CHECK="
32 ~BPF
33 ~BPF_SYSCALL
34 ~BPF_JIT
35 ~CGROUPS
36 ~KPROBES
37 ~NET_INGRESS
38 ~NET_EGRESS
39 ~NET_SCH_INGRESS
40 ~NET_CLS_BPF
41 ~NET_CLS_ACT
42 ~BPF_STREAM_PARSER
43 ~DEBUG_INFO
44 ~DEBUG_INFO_BTF
45 ~KPROBE_EVENTS
46 ~BPF_EVENTS
49 if kernel_is -lt ${MINKV//./ }; then
50 ewarn "Kernel version at least ${MINKV} required"
53 check_extra_config
56 src_prepare() {
57 # Prevent conflicting with the user's flags
58 sed -i -e 's/-O2//' "${S}/Makefile" || die 'Failed to remove -O2 via sed'
59 sed -i -e 's/-Werror//' "${S}/Makefile" || die 'Failed to remove -Werror via sed'
61 default
64 src_compile() {
65 #-flto makes llvm-strip complains
66 #llvm-strip: error: '*/control/bpf_bpfel.o': The file was not recognized as a valid object file
67 filter-lto
68 # for dae's ebpf target
69 # gentoo-zh#3720
70 filter-flags "-march=*" "-mtune=*"
71 append-cflags "-fno-stack-protector"
73 emake VERSION="${PV}" GOFLAGS="-buildvcs=false -w"
76 src_install() {
77 dobin dae
79 systemd_dounit install/dae.service
80 newinitd "${FILESDIR}"/dae.initd dae
82 insinto /etc/dae
83 newins example.dae config.dae.example
84 newins install/empty.dae config.dae
86 newbashcomp install/shell-completion/dae.bash dae
87 newfishcomp install/shell-completion/dae.fish dae.fish
88 newzshcomp install/shell-completion/dae.zsh _dae
90 dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/dae/geosite.dat
91 dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/dae/geoip.dat