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

pkgname=wllvm-git
pkgver=r461.6d8955b
pkgrel=3
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')
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 setup.py build
}

package() {
    cd "$srcdir/$pkgname"
    python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}