app-crypt/etoken-sac: fix eutils EAPI 7
[gentoo-zh.git] / net-proxy / daed / daed-9999.ebuild
blob8f236dc13a107912a46b1a405a0c787f944f46a5
1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit git-r3 go-module systemd
8 DESCRIPTION="A Modern Dashboard For dae"
9 HOMEPAGE="https://github.com/daeuniverse/daed"
10 # SRC_URI=""
11 EGIT_REPO_URI="https://github.com/daeuniverse/daed.git"
13 LICENSE="MIT AGPL-3"
14 SLOT="0"
15 KEYWORDS=""
16 RESTRICT="strip"
18 DEPEND="
19         app-alternatives/v2ray-geoip
20         app-alternatives/v2ray-geosite
22 RDEPEND="${DEPEND}"
23 BDEPEND="
24         webui? ( sys-apps/pnpm )
25         sys-devel/clang
28 IUSE="+webui"
30 src_unpack(){
31         git-r3_src_unpack
32         cd ${P} || die
33         if use webui; then
34                 pnpm install || die
35         fi
36         cd wing || die
37         ego mod download -modcacherw
38         cd dae-core || die
39         ego mod download -modcacherw
42 src_compile(){
43         if ! use webui; then
44                 cd wing || die
45         fi
46         GO_ROOT="${S}" emake CC=clang CFLAGS="$CFLAGS -fno-stack-protector" APPNAME="${PN}" VERSION="${PV}"
49 src_install(){
50         local service=install/daed.service
51         if use webui; then
52                 dobin daed
53                 systemd_dounit $service
54         else
55                 dobin wing/dae-wing
56                 sed -i "s!/usr/bin/daed!/usr/bin/dae-wing!" $service || die
57                 systemd_newunit $service dae-wing.service
58         fi
59         keepdir /etc/daed/
60         dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/daed/geosite.dat
61         dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/daed/geoip.dat