Skip to content

Commit

Permalink
net-proxy/daed: add webui useflag, add missing deps
Browse files Browse the repository at this point in the history
Signed-off-by: ston <[email protected]>
  • Loading branch information
st0nie committed Jun 30, 2023
1 parent ebc72e2 commit 582e017
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DESCRIPTION="A Modern Dashboard For dae"
HOMEPAGE="https://github.com/daeuniverse/daed"
SRC_URI="
https://github.com/daeuniverse/daed/releases/download/v${PV/_rc1/rc}/daed-full-src.zip -> ${P}.zip
https://github.com/st0nie/gentoo-go-deps/releases/download/${P}/${P}-node_modules-pnpm.tar.xz
webui? ( https://github.com/st0nie/gentoo-go-deps/releases/download/${P}/${P}-node_modules-pnpm.tar.xz )
"
# EGIT_REPO_URI="https://github.com/daeuniverse/daed.git"

Expand All @@ -24,20 +24,33 @@ DEPEND="
"
RDEPEND="${DEPEND}"
BDEPEND="
sys-apps/pnpm
webui? ( sys-apps/pnpm )
sys-devel/clang
app-arch/unzip
>=dev-lang/go-1.18
"
S="${WORKDIR}"

IUSE="+webui"

src_compile(){
sed -i '/git submodule update/d' wing/Makefile || die
if ! use webui; then
cd wing || die
fi
GO_ROOT="${S}" emake CC=clang CFLAGS="$CFLAGS -fno-stack-protector" APPNAME="${PN}" VERSION="${PV}"
}

src_install(){
dobin daed
systemd_dounit install/daed.service
local service=install/daed.service
if use webui; then
dobin daed
systemd_dounit $service
else
dobin wing/dae-wing
sed -i "s!/usr/bin/daed!/usr/bin/dae-wing!" $service || die
systemd_newunit $service dae-wing.service
fi
keepdir /etc/daed/
dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/daed/geosite.dat
dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/daed/geoip.dat
Expand Down
24 changes: 19 additions & 5 deletions net-proxy/daed/daed-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,41 @@ DEPEND="
"
RDEPEND="${DEPEND}"
BDEPEND="
sys-apps/pnpm
webui? ( sys-apps/pnpm )
sys-devel/clang
"

IUSE="+webui"

src_unpack(){
git-r3_src_unpack
cd ${P} || die
pnpm install || die
if use webui; then
pnpm install || die
fi
cd wing || die
ego mod download -modcacherw
cd dae-core || die
ego mod download -modcacherw
}

src_compile(){
GO_ROOT="${S}" emake CC=clang CFLAGS="$CFLAGS -fno-stack-protector"
if ! use webui; then
cd wing || die
fi
GO_ROOT="${S}" emake CC=clang CFLAGS="$CFLAGS -fno-stack-protector" APPNAME="${PN}" VERSION="${PV}"
}

src_install(){
dobin daed
systemd_dounit install/daed.service
local service=install/daed.service
if use webui; then
dobin daed
systemd_dounit $service
else
dobin wing/dae-wing
sed -i "s!/usr/bin/daed!/usr/bin/dae-wing!" $service || die
systemd_newunit $service dae-wing.service
fi
keepdir /etc/daed/
dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/daed/geosite.dat
dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/daed/geoip.dat
Expand Down
3 changes: 3 additions & 0 deletions net-proxy/daed/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<name>ston</name>
<email>[email protected]</email>
</maintainer>
<use>
<flag name="webui">Build and install daed instead of dae-wing</flag>
</use>
<upstream>
<remote-id type="github">daeuniverse/daed</remote-id>
</upstream>
Expand Down

0 comments on commit 582e017

Please sign in to comment.