From ac9871c2ab28edd37fdc4ddc9525d2088468324d Mon Sep 17 00:00:00 2001 From: Integral Date: Sun, 29 Dec 2024 13:59:19 +0800 Subject: [PATCH] daed-git: fetch submodules in source & simplify PKGBUILD According to VCS package guidelines in ArchWiki, URLs of submodules should be added directly to the source array. --- archlinuxcn/daed-git/PKGBUILD | 44 +++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/archlinuxcn/daed-git/PKGBUILD b/archlinuxcn/daed-git/PKGBUILD index 7e27dbe70d04..f9b627104f83 100644 --- a/archlinuxcn/daed-git/PKGBUILD +++ b/archlinuxcn/daed-git/PKGBUILD @@ -7,28 +7,45 @@ pkgver=0.9.0.r0.g68d13a3 pkgrel=1 pkgdesc="A modern dashboard for dae, bundled with dae-wing (backend API server) and dae (core)." arch=('x86_64' 'aarch64') -url="https://github.com/daeuniverse/daed" +url="https://github.com/daeuniverse/${_pkgname}" license=('AGPL-3.0-or-later AND MIT') +depends=('v2ray-geoip' 'v2ray-domain-list-community') makedepends=('git' 'pnpm' 'clang' 'go') provides=("${_pkgname}" "dae") conflicts=("${_pkgname}" "dae") -source=("git+https://github.com/daeuniverse/${_pkgname}.git") -sha256sums=('SKIP') +source=( + "git+${url}.git" + "git+https://github.com/daeuniverse/dae-wing.git" + "git+https://github.com/daeuniverse/dae.git" + "git+https://github.com/daeuniverse/dae_bpf_headers.git" +) +sha256sums=('SKIP' + 'SKIP' + 'SKIP' + 'SKIP') install="${_pkgname}.install" options=(!debug) pkgver() { cd "${_pkgname}/" - ( - set -o pipefail - git describe --tags --long --match="v[0-9]*" --abbrev=7 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" - ) + git describe --tags --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { cd "${_pkgname}/" - git submodule update --init --recursive + git submodule init + git config submodule.wing.url "${srcdir}/dae-wing" + git -c protocol.file.allow=always submodule update + + cd wing + git submodule init + git config submodule.dae-core.url "${srcdir}/dae" + git -c protocol.file.allow=always submodule update + + cd dae-core + git config submodule.control/kern/headers.url "${srcdir}/dae_bpf_headers" + git config submodule.trace/kern/headers.url "${srcdir}/dae_bpf_headers" + git -c protocol.file.allow=always submodule update } build() { @@ -39,19 +56,12 @@ build() { } package() { - depends=( - v2ray-geoip - v2ray-domain-list-community - ) - cd "${_pkgname}/" install -vDm755 "${_pkgname}" -t "${pkgdir}/usr/bin/" install -vDm644 "install/${_pkgname}.service" -t "${pkgdir}/usr/lib/systemd/system/" install -vDm644 "LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}/" - install -d "${pkgdir}/etc/daed/" - - install -d "${pkgdir}/usr/share/daed" + install -d ${pkgdir}/{etc,usr/share}/${_pkgname}/ ln -vs "/usr/share/v2ray/geoip.dat" "${pkgdir}/usr/share/daed/geoip.dat" ln -vs "/usr/share/v2ray/geosite.dat" "${pkgdir}/usr/share/daed/geosite.dat" }