Skip to content

Commit

Permalink
net-proxy/dae: add 0.9.0_rc1
Browse files Browse the repository at this point in the history
Signed-off-by: irort <[email protected]>
  • Loading branch information
irort committed Nov 3, 2024
1 parent 25717e3 commit 596f99f
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
1 change: 1 addition & 0 deletions net-proxy/dae/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST dae-0.8.0.zip 124733240 BLAKE2B 938912224a0824b4f9190927c5153e3e3740109c14af6b42e4cca69a4eb62968a7a5d995298f967c724d1e643c1e567966a0cb541ec0509904ff049c7b70e883 SHA512 d39d0df09937e64551313a3eb464bac6be60aadeffffa1ea87229b3a5e0af672db47712da0d4f33872059c0ef26e640b88f06da21bf9710fa1f4205f9f745809
DIST dae-0.9.0_rc1.zip 132826351 BLAKE2B 2d44928966a98bd048db639a139d3067d7c0de492b978d87c3b5a28ca6fe4f12892b3481ff146560651ff6294f3b8754489fed3aa9899c03beb1b1d7798e73c6 SHA512 94ee21d1c46cc6c724f59553c840054b16fee80f9bbc65eba02ca46773cd8a88a1c0d16ad7e97ffc11b1064330507423d953da651aac372b616cb4125c73903c
92 changes: 92 additions & 0 deletions net-proxy/dae/dae-0.9.0_rc1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit flag-o-matic linux-info go-module systemd shell-completion

_MY_PV=${PV/_rc/rc}

DESCRIPTION="A lightweight and high-performance transparent proxy solution based on eBPF"
HOMEPAGE="https://github.com/daeuniverse/dae"
SRC_URI="
https://github.com/daeuniverse/dae/releases/download/v${_MY_PV}/dae-full-src.zip -> ${P}.zip
"

S="${WORKDIR}"

LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~riscv"
MINKV="5.17"

DEPEND="
app-alternatives/v2ray-geoip
app-alternatives/v2ray-geosite
"
RDEPEND="$DEPEND"
BDEPEND="sys-devel/clang"

pkg_pretend() {
local CONFIG_CHECK="
~BPF
~BPF_SYSCALL
~BPF_JIT
~CGROUPS
~KPROBES
~NET_INGRESS
~NET_EGRESS
~NET_SCH_INGRESS
~NET_CLS_BPF
~NET_CLS_ACT
~BPF_STREAM_PARSER
~DEBUG_INFO
~DEBUG_INFO_BTF
~KPROBE_EVENTS
~BPF_EVENTS
"

if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi

check_extra_config
}

src_prepare() {
# Prevent conflicting with the user's flags
sed -i -e 's/-O2//' "${S}/Makefile" || die 'Failed to remove -O2 via sed'
sed -i -e 's/-Werror//' "${S}/Makefile" || die 'Failed to remove -Werror via sed'

default
}

src_compile() {
#-flto makes llvm-strip complains
#llvm-strip: error: '*/control/bpf_bpfel.o': The file was not recognized as a valid object file
filter-lto
# for dae's ebpf target
# gentoo-zh#3720
filter-flags "-march=*" "-mtune=*"
append-cflags "-fno-stack-protector"

emake VERSION="${PV}" GOFLAGS="-buildvcs=false -w"
}

src_install() {
dobin dae

systemd_dounit install/dae.service
newinitd "${FILESDIR}"/dae.initd dae

insinto /etc/dae
newins example.dae config.dae.example
newins install/empty.dae config.dae

newbashcomp install/shell-completion/dae.bash dae
newfishcomp install/shell-completion/dae.fish dae.fish
newzshcomp install/shell-completion/dae.zsh _dae

dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/dae/geosite.dat
dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/dae/geoip.dat
}

0 comments on commit 596f99f

Please sign in to comment.