app-editors/appflowy-bin: add 0.7.4, drop 0.7.3
[gentoo-zh.git] / net-proxy / dae / dae-9999.ebuild
blob8d3894d958ce5da55a6cc66477686b329965ea7c
1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
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"
11 LICENSE="AGPL-3"
12 SLOT="0"
13 MINKV="5.8"
15 EGIT_REPO_URI="https://github.com/daeuniverse/dae.git"
17 DEPEND="
18         app-alternatives/v2ray-geoip
19         app-alternatives/v2ray-geosite
21 RDEPEND="$DEPEND"
22 BDEPEND="sys-devel/clang"
24 pkg_pretend() {
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"
29         fi
31         check_extra_config
34 src_unpack() {
35         git-r3_src_unpack
36         cd "${P}" || die
37         ego mod download -modcacherw
40 src_prepare() {
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'
45         default
48 src_compile() {
49         # for dae's ebpf target
50         # gentoo-zh#3720
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"
58 src_install() {
59         dobin dae
61         systemd_dounit install/dae.service
62         newinitd "${FILESDIR}"/dae.initd dae
64         insinto /etc/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