summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a083a06941e24451d9fb3ea4be9aa9e3ec2fbfcb (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
# Maintainer: Juacrumar <juacrumar at lairen dot eu>

pkgname=pineappl
pkgver=0.3.0
pkgrel=3
pkgdesc='PineAPPL is not an extension of APPLgrid'
arch=('any')
url="https://n3pdf.github.io/pineappl/"
license=('GPL3')
makedepends=("python-setuptools")
depends=("cargo-c"
         "rust"
         "lhapdf"
         "python-pkgconfig"
         "python-numpy"
         )
optdepends=()
provides=("pineappl")
changelog=
source=("https://github.com/N3PDF/pineappl/archive/v${pkgver}.tar.gz")
md5sums=("ca5d7a4b39ed49a5d62c015d9fe75591")

prepare() {
	cd "$pkgname-$pkgver"
    # Patch the loader
    sed -i "s/pkgconfig.libs('pineappl_capi').split(' ')/pkgconfig.libs('pineappl_capi').split(' ')\nif len(paths) < 2: paths.insert(0, '-L\/usr\/lib')/" wrappers/python/src/pineappl/loader.py
}

build() {
    # Build the python interface
	cd "$pkgname-$pkgver"/wrappers/python
    python setup.py build 
    cd ../../..
}

package() {
    # Install pineappl_capi
	cd "$pkgname-$pkgver"/pineappl_capi
    cargo cinstall --release --destdir=${pkgdir} --prefix=/usr
    cd ..
    # Now install the command-line program
    cargo install --path pineappl_cli --root=${pkgdir}/usr
    # And the python wrapper
    cd wrappers/python
    python setup.py install --root="${pkgdir}" --optimize=2 --skip-build
}