Skip to content

Commit

Permalink
daed-git: fetch submodules in source & simplify PKGBUILD
Browse files Browse the repository at this point in the history
According to VCS package guidelines in ArchWiki, URLs of submodules
should be added directly to the source array.
  • Loading branch information
Integral-Tech committed Dec 29, 2024
1 parent 5cb903c commit ac9871c
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions archlinuxcn/daed-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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"
}

0 comments on commit ac9871c

Please sign in to comment.