dev-python/conda-libmamba-solver: bump version to 24.11.1
[gentoo-zh.git] / net-proxy / daed / daed-0.8.0.ebuild
blobf1965b7aa5435c8730f2530196324fe14b386490
1 # Copyright 2023-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit flag-o-matic systemd
8 DESCRIPTION="A Modern Dashboard For dae"
9 HOMEPAGE="https://github.com/daeuniverse/daed"
10 SRC_URI="
11 https://github.com/daeuniverse/daed/releases/download/v${PV/_rc/rc}/daed-full-src.zip -> ${P}.zip
12 webui? ( https://github.com/daeuniverse/daed/releases/download/v${PV/_rc/rc}/web.zip -> ${P}-web.zip )
14 # EGIT_REPO_URI="https://github.com/daeuniverse/daed.git"
16 S="${WORKDIR}"
17 LICENSE="MIT AGPL-3"
18 SLOT="0"
19 KEYWORDS="~amd64"
21 DEPEND="
22 app-alternatives/v2ray-geoip
23 app-alternatives/v2ray-geosite
25 RDEPEND="${DEPEND}"
26 BDEPEND="
27 llvm-core/clang
28 app-arch/unzip
29 >=dev-lang/go-1.22
31 IUSE="+webui"
32 RESTRICT="strip"
34 src_prepare() {
35 # Prevent conflicting with the user's flags
36 sed -i -e 's/-Werror//' wing/dae-core/Makefile || die 'Failed to remove -Werror via sed'
37 if use webui; then
38 # Use upstream web archive
39 sed -e 's|daed: submodule $(DAE_WING_READY) dist|daed: $(DAE_WING_READY)|' \
40 -i Makefile || die
41 mv -v "${WORKDIR}/web" "${S}/dist" || die
44 default
47 src_compile(){
48 # sed -i '/git submodule update/d' wing/Makefile || die
49 # sed -i 's/git rev-parse --short HEAD/echo/' vite.config.ts || die
50 if ! use webui; then
51 cd wing || die
54 # for dae's ebpf target
55 # gentoo-zh#3720
56 filter-flags "-march=*" "-mtune=*"
57 append-cflags "-fno-stack-protector"
59 GO_ROOT="${S}" SKIP_SUBMODULES=1 emake APPNAME="${PN}" VERSION="${PV}"
62 src_install(){
63 local service=install/daed.service
64 if use webui; then
65 dobin daed
66 systemd_dounit ${service}
67 else
68 dobin wing/dae-wing
69 sed -i "s!/usr/bin/daed!/usr/bin/dae-wing!" ${service} || die
70 systemd_newunit ${service} dae-wing.service
72 keepdir /etc/daed/
73 dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/daed/geosite.dat
74 dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/daed/geoip.dat
76 # thanks to @MarksonHon
77 newinitd "${FILESDIR}"/${PN}.initd daed
80 pkg_postinst() {
81 elog
82 elog "For OpenRC user, if you want to use"
83 elog "openrc to manager daed service,"
84 elog "please refer to dae document to modify"
85 elog "rc.conf and sysfs first, then reboot."
86 elog "https://github.com/daeuniverse/dae/blob/main/docs/en/tutorials/run-on-alpine.md"
87 elog "Now you can start and add it to default runlevel "
88 elog "# rc-service daed start"
89 elog "# rc-update add daed default"
90 elog