1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic linux-info git-r3 go-module systemd shell-completion
8 DESCRIPTION="A lightweight and high-performance transparent proxy solution based on eBPF"
9 HOMEPAGE="https://github.com/daeuniverse/dae"
15 EGIT_REPO_URI="https://github.com/daeuniverse/dae.git"
18 app-alternatives/v2ray-geoip
19 app-alternatives/v2ray-geosite
22 BDEPEND="sys-devel/clang"
25 local CONFIG_CHECK="~DEBUG_INFO_BTF ~NET_CLS_ACT ~NET_SCH_INGRESS ~NET_INGRESS ~NET_EGRESS"
27 if kernel_is -lt ${MINKV//./ }; then
28 ewarn "Kernel version at least ${MINKV} required"
37 ego mod download -modcacherw
41 # Prevent conflicting with the user's flags
42 # https://devmanual.gentoo.org/ebuild-writing/common-mistakes/#-werror-compiler-flag-not-removed
43 sed -i -e 's/-Werror//' "${S}/Makefile" || die 'Failed to remove -Werror via sed'
49 # for dae's ebpf target
51 filter-flags "-march=*" "-mtune=*"
52 append-cflags "-fno-stack-protector"
54 local GIT_VER=$(git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-\([^-]*\)-\([^-]*\)$/.\1.\2/;s/-//')
55 emake VERSION="${GIT_VER}" GOFLAGS="-buildvcs=false"
61 systemd_dounit install/dae.service
62 newinitd "${FILESDIR}"/dae.initd dae
65 newins example.dae config.dae.example
66 newins install/empty.dae config.dae
68 newbashcomp install/shell-completion/dae.bash dae
69 newfishcomp install/shell-completion/dae.fish dae.fish
70 newzshcomp install/shell-completion/dae.zsh _dae
72 dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/dae/geosite.dat
73 dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/dae/geoip.dat