Skip to content

Commit

Permalink
net-proxy/daed: add wing useflag
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 11b54b0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,32 @@ DEPEND="
"
RDEPEND="${DEPEND}"
BDEPEND="
sys-apps/pnpm
!wing? ( sys-apps/pnpm )
sys-devel/clang
app-arch/unzip
"
S="${WORKDIR}"

IUSE="wing"

src_compile(){
sed -i '/git submodule update/d' wing/Makefile || die
if use wing; 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 wing; then
dobin wing/dae-wing
sed -i "s!/usr/bin/daed!/usr/bin/dae-wing!" $service || die
systemd_newunit $service dae-wing.service
else
dobin daed
systemd_dounit $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
!wing? ( sys-apps/pnpm )
sys-devel/clang
"

IUSE="wing"

src_unpack(){
git-r3_src_unpack
cd ${P} || die
pnpm install || die
if ! use wing; 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 wing; 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 wing; then
dobin wing/dae-wing
sed -i "s!/usr/bin/daed!/usr/bin/dae-wing!" $service || die
systemd_newunit $service dae-wing.service
else
dobin daed
systemd_dounit $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="wing">Only build and install dae-wing</flag>
</use>
<upstream>
<remote-id type="github">daeuniverse/daed</remote-id>
</upstream>
Expand Down

0 comments on commit 11b54b0

Please sign in to comment.