summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 376beb1a39c7384a9fb281d2e56f85c1ca3b8527 (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
# Maintainer : Daniel Bermond < gmail-com: danielbermond >

pkgname=fxdiv-git
_srcname=FXdiv
pkgver=r53.f8c5354
pkgrel=1
pkgdesc='Header-only library for division via fixed-point multiplication by inverse (git version)'
arch=('any')
url='https://github.com/Maratyszcza/FXdiv/'
license=('MIT')
makedepends=('git')
checkdepends=(
     # official repositories:
        'python2' 'ninja'
     # AUR:
        'confu2-git'
)
provides=('fxdiv')
conflicts=('fxdiv')
source=('git+https://github.com/Maratyszcza/FXdiv.git')
sha256sums=('SKIP')

pkgver() {
    cd "$_srcname"
    
    # git, no tags available
    printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

check() {
    cd "$_srcname"
    confu2 setup
    python2 ./configure.py
    ninja
    
    cd bin
    local _test
    for _test in *
    do
        printf '%s\n' "  -> Running test '${_test}'..."
        ./"$_test"
    done
}

package() {
    cd "$_srcname"
    
    # headers
    mkdir -p "${pkgdir}/usr/include"
    install -D -m644 include/*.h "${pkgdir}/usr/include"
    
    # license
    install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}