summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aa6604a31ba82742697f8e11c023136909a5c72f (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
# Maintainer: Kuan-Yen Chou <kuanyenchou at gmail dot com>

pkgname=wllvm-git
pkgver=r497.cd87744
pkgrel=2
pkgdesc="A wrapper script to build whole-program LLVM bitcode files"
arch=('any')
url="https://github.com/travitch/whole-program-llvm"
license=('MIT')
depends=('python')
makedepends=('git' 'python-setuptools' 'python-build' 'python-installer'
             'python-wheel')
provides=('wllvm')
conflicts=('wllvm')
source=("$pkgname"::'git+https://github.com/travitch/whole-program-llvm')
md5sums=('SKIP')

pkgver() {
    cd "$srcdir/$pkgname"
    if git describe --long --tags >/dev/null 2>&1; then
        git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
    else
        printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git describe --always)"
    fi
}

build() {
    cd "$srcdir/$pkgname"
    python -m build --wheel --no-isolation
}

package() {
    cd "$srcdir/$pkgname"
    python -m installer \
        --prefix=/usr \
        --destdir="$pkgdir" \
        --compile-bytecode=1 \
        dist/*.whl
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}