summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b4ff81bb93a54916dd13a06308c7785c0e24d00 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Nicolas Derumigny <nderumigny@gmail.com>

pkgname=('polylib-git' 'polylib-gmp-git')
pkgbase='polylib-git'
_pkgbase='polylib'
pkgver='5.22.09a1d8f'
pkgrel=1
pkgdesc='A library of polyhedral functions'
arch=('i686' 'x86_64')
url='http://icps.u-strasbg.fr/polylib/'
license=('GPL')
depends=('gmp')
makedepends=('git')
source=("${pkgname}::git+https://github.com/vincentloechner/polylib.git")
md5sums=('SKIP')

build() {
    cd "$srcdir/$_pkgbase"

    # now we build the normal version of polylib
    echo "compiling normal version of Polylib"
    ./autogen.sh
    [ -d "polylib" ] || mkdir "polylib"
    cd polylib
    ../configure --prefix=/usr --without-libgmp
    make

    cd ..
    # now we build the GMP version of polylib
    echo "compiling GMP version of Polylib"
    [ -d "polylibgmp" ] || mkdir "polylibgmp"
    cd polylibgmp
    ../configure --prefix=/usr --with-libgmp
    make
}

check() {
    cd "$srcdir/$_pkgbase"

    # check the normal version
    cd polylib
    make check

    cd ..
    # check the GMP version
    cd polylibgmp
    make check
}

package_polylib-git() {
    provides=("polylib=$pkgver")
    conflicts=('polylib')
    cd "$srcdir/$_pkgbase/polylib"
    make DESTDIR="$pkgdir" install
}

package_polylib-gmp-git() {
    provides=("polylib-gmp=$pkgver")
    conflicts=('polylib-gmp')
    depends=("polylib=$pkgver")
    cd "$srcdir/$_pkgbase/polylibgmp"
    make DESTDIR="$pkgdir" install-exec

    cd "$pkgdir"
    # Nasty rename to ensure we can co-exist with polylib
    mv usr/bin/c2p usr/bin/c2p-gmp
    mv usr/bin/disjoint_union_adj usr/bin/disjoint_union_adj-gmp
    mv usr/bin/disjoint_union_sep usr/bin/disjoint_union_sep-gmp
    mv usr/bin/ehrhart_lower_bound usr/bin/ehrhart_lower_bound-gmp
    mv usr/bin/ehrhart_quick_apx usr/bin/ehrhart_quick_apx-gmp
    mv usr/bin/ehrhart_upper_bound usr/bin/ehrhart_upper_bound-gmp
    mv usr/bin/findv usr/bin/findv-gmp
    mv usr/bin/r2p usr/bin/r2p-gmp
}