dae: 0.2.4 -> 0.3.0

This commit is contained in:
oluceps 2023-09-03 00:18:34 +08:00
parent dc75443818
commit d0decc53e9
No known key found for this signature in database

View file

@ -1,29 +1,25 @@
{ lib { lib
, clang , clang
, fetchFromGitHub , fetchFromGitHub
, symlinkJoin
, buildGoModule , buildGoModule
, makeWrapper
, v2ray-geoip
, v2ray-domain-list-community
}: }:
buildGoModule rec { buildGoModule rec {
pname = "dae"; pname = "dae";
version = "0.2.4"; version = "0.3.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "daeuniverse"; owner = "daeuniverse";
repo = "dae"; repo = "dae";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-MVmx37q5nbgaUehPJ2C2UjVyx48/U/vA3NeBx6Zcmg8="; hash = "sha256-WiJqhXYehuUCLEuVbsQkmTntuH1srtePtZgYBSTbxiw=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
vendorHash = "sha256-oeMAekLWRJzmkmge4LmrVSFRzHZ/dStX+CvLtuYOsog="; vendorHash = "sha256-fb4PEMhV8+5zaRJyl+nYi2BHcOUDUVAwxce2xaRt5JA=";
proxyVendor = true; proxyVendor = true;
nativeBuildInputs = [ clang makeWrapper ]; nativeBuildInputs = [ clang ];
ldflags = [ ldflags = [
"-s" "-s"
@ -33,7 +29,7 @@ buildGoModule rec {
]; ];
preBuild = '' preBuild = ''
make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector" \ make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \
NOSTRIP=y \ NOSTRIP=y \
ebpf ebpf
''; '';
@ -41,15 +37,8 @@ buildGoModule rec {
# network required # network required
doCheck = false; doCheck = false;
assetsDrv = symlinkJoin {
name = "dae-assets";
paths = [ v2ray-geoip v2ray-domain-list-community ];
};
postInstall = '' postInstall = ''
install -Dm444 install/dae.service $out/lib/systemd/system/dae.service install -Dm444 install/dae.service $out/lib/systemd/system/dae.service
wrapProgram $out/bin/dae \
--suffix DAE_LOCATION_ASSET : $assetsDrv/share/v2ray
substituteInPlace $out/lib/systemd/system/dae.service \ substituteInPlace $out/lib/systemd/system/dae.service \
--replace /usr/bin/dae $out/bin/dae --replace /usr/bin/dae $out/bin/dae
''; '';