summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c165091f9b0aee79cb0146aa787f5347f56162f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Maintainer: taotieren <admin@taotieren.com>

pkgname=tinybpt-git
pkgver=r38.2729f6a
pkgrel=1
epoch=
pkgdesc="Tinybpt (Tiny Buildroot Packaging Tool) 是一个 buildroot 的包管理工具,主要处理 buildroot 的包依赖关系,提供包的安装、卸载等功能。"
arch=(
    'aarch64'
    'riscv64'
    'x86_64')
url="https://gitee.com/tinylab/buildroot-toolkit"
license=(GPL-2.0-or-later)
groups=()
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
depends=(
    bash
    gcc-libs
    glibc
)
makedepends=(
    git
    cmake
    nlohmann-json
    ninja)
optdepends=("buildroot-meta: dependency requirements for buildroot")
checkdepends=()
options=()
source=(${pkgname}::git+$url.git)
noextract=()
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    (
        set -o pipefail
        git describe --long --tag --abbrev=7 2>/dev/null | sed 's/^v//g;s/\([^-]*-g\)/r\1/;s/-/./g' ||
            printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
    )
}

prepare() {
    git -C "${srcdir}/${pkgname}" clean -dfx
    cd "${srcdir}/${pkgname}"
    git remote add petaluz https://gitee.com/petalzu/buildroot-toolkit.git
    git fetch --all
    git checkout petaluz/master
}

build() {
    # see:https://wiki.archlinux.org/title/CMake_package_guidelines
    cmake -S ${pkgname} \
        -DCMAKE_BUILD_TYPE=None \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -B build \
        -G Ninja

    ninja -C build
}

package() {
    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/build install
    install -dm777 ${pkgdir}/var/cache/tinybpt
}