1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic linux-info go-module systemd shell-completion
10 DESCRIPTION
="A lightweight and high-performance transparent proxy solution based on eBPF"
11 HOMEPAGE
="https://github.com/daeuniverse/dae"
15 KEYWORDS
="~amd64 ~riscv"
18 https://github.com/daeuniverse/dae/releases/download/v${_MY_PV}/dae-full-src.zip -> ${P}.zip
23 app-alternatives/v2ray-geoip
24 app-alternatives/v2ray-geosite
27 BDEPEND
="sys-devel/clang"
50 if kernel_is
-lt ${MINKV//./ }; then
51 ewarn
"Kernel version at least ${MINKV} required"
58 # Prevent conflicting with the user's flags
59 sed -i -e 's/-O2//' "${S}/Makefile" || die
'Failed to remove -O2 via sed'
60 sed -i -e 's/-Werror//' "${S}/Makefile" || die
'Failed to remove -Werror via sed'
66 #-flto makes llvm-strip complains
67 #llvm-strip: error: '*/control/bpf_bpfel.o': The file was not recognized as a valid object file
69 # for dae's ebpf target
71 filter-flags
"-march=*" "-mtune=*"
72 append-cflags
"-fno-stack-protector"
74 emake VERSION
="${PV}" GOFLAGS
="-buildvcs=false -w"
80 systemd_dounit install
/dae.service
81 newinitd
"${FILESDIR}"/dae.initd dae
84 newins example.dae config.dae.example
85 newins install
/empty.dae config.dae
87 newbashcomp install
/shell-completion
/dae.bash dae
88 newfishcomp install
/shell-completion
/dae.fish dae.fish
89 newzshcomp install
/shell-completion
/dae.zsh _dae
91 dosym
-r "/usr/share/v2ray/geosite.dat" /usr
/share
/dae
/geosite.dat
92 dosym
-r "/usr/share/v2ray/geoip.dat" /usr
/share
/dae
/geoip.dat