summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ccb679b33b2494bc16aecc85f211e1e3be8937f1 (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
# Maintainer: taotieren <admin@taotieren.com>

pkgname=yjson-git
pkgver=r73.a38e605
pkgrel=13
pkgdesc="YJson"
arch=('x86_64')
url="https://github.com/yjmthu/YJson"
license=('MIT')
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
depends=()
makedepends=(cmake
            git
            ninja
            qt6-tools)
backup=()
options=()
source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}/"
#     git describe --long --tags | 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
}

build() {
    cd "${srcdir}/${pkgname}/"

    cmake -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_INSTALL_LIBEXECDIR=lib \
        -Bbuild \
        -GNinja
#         \
#         -W no-dev

    ninja -C build
}

package() {
    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/$pkgname/build install
}