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

pkgname=pthreadpool-git
pkgver=r55.13da0b4
pkgrel=1
pkgdesc='A pthread-based thread pool implementation for C/C++ (git version)'
arch=('i386' 'x86_64')
url='https://github.com/Maratyszcza/pthreadpool/'
license=('BSD')
makedepends=(
    # binary repositories:
        'git' 'python2' 'ninja'
    # AUR:
        'confu2-git'
)
provides=('pthreadpool')
conflicts=('pthreadpool')
options=('staticlibs')
source=("$pkgname"::'git+https://github.com/Maratyszcza/pthreadpool.git')
sha256sums=('SKIP')

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

build() {
    cd "$pkgname"
    
    confu2 setup
    python2 ./configure.py #--enable-shared
    sed -i '/cflags[[:space:]]=[[:space:]]/s/$/ -fPIC/'   build.ninja # add -fPIC
    sed -i '/cxxflags[[:space:]]=[[:space:]]/s/$/ -fPIC/' build.ninja # add -fPIC
    ninja
}

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