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"
13 https://github.com/daeuniverse/dae/releases/download/v${_MY_PV}/dae-full-src.zip -> ${P}.zip
20 KEYWORDS
="~amd64 ~riscv"
24 app-alternatives/v2ray-geoip
25 app-alternatives/v2ray-geosite
28 BDEPEND
="llvm-core/clang"
49 if kernel_is
-lt ${MINKV//./ }; then
50 ewarn
"Kernel version at least ${MINKV} required"
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'
65 #-flto makes llvm-strip complains
66 #llvm-strip: error: '*/control/bpf_bpfel.o': The file was not recognized as a valid object file
68 # for dae's ebpf target
70 filter-flags
"-march=*" "-mtune=*"
71 append-cflags
"-fno-stack-protector"
73 emake VERSION
="${PV}" GOFLAGS
="-buildvcs=false -w"
79 systemd_dounit install
/dae.service
80 newinitd
"${FILESDIR}"/dae.initd 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