summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d20f1d93cba65b99cce18d5760f83dd2822dbbc7 (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
# Maintainer: Frank Siegert <frank.siegert@googlemail.com>
pkgname=rivet
pkgver=3.1.0
pkgrel=4
pkgdesc="A particle physics package for data analysis and validation of Monte Carlo event generators"
arch=('x86_64' 'i686')
url="http://rivet.hepforge.org"
license=('GPL3')
depends=('python' 'yoda>=1.8.0' 'fastjet' 'gsl' 'hepmc3' 'fastjet-contrib')
optdepends=('texlive-core: Plotting functionality'
            'ghostscript: PDF plot output'
            'imagemagick: PNG plot output'
            'python2: For Python2 module in addition to Python3')
makedepends=('cython')
source=(http://www.hepforge.org/archive/rivet/Rivet-$pkgver.tar.gz
        https://gitlab.com/hepcedar/rivet/-/commit/900d209692893606e52d92ec37375b5131d5b1f0.diff
        https://gitlab.com/hepcedar/rivet/-/commit/6dc3735a2dfe4aa80e64afe0a169366f0db1016d.diff
        rivet-3-1-0-with-hepmc-3-2-1-MR85.patch)
md5sums=('d5eb0e69aa3fdf44f5925419e0d40dc9'
         'df1ee13b5566464377d9a697bf696c42'
         '33be87d5ea7f658b916e43dde3bbc3f8'
         'e10f1d04be0c091a13fb2091842c2eb3')

package() {
	cd "$srcdir/Rivet-$pkgver"
        patch -p1 < ../900d209692893606e52d92ec37375b5131d5b1f0.diff
        patch -p1 < ../6dc3735a2dfe4aa80e64afe0a169366f0db1016d.diff
        patch -p1 < ../rivet-3-1-0-with-hepmc-3-2-1-MR85.patch

        # If python2 is present, also build a library for it
        # Have to do this first, such that files like rivet-config get overwritten with the "proper" Python3 version
        if [ -x /usr/bin/python2 ]; then
          PYTHON=/usr/bin/python2 ./configure --prefix=/usr --with-hepmc3=/usr
          make DESTDIR="$pkgdir/" install
          make clean
        fi
        
	./configure --prefix=/usr --with-hepmc3=/usr
	make
        make DESTDIR="$pkgdir/" install

        mkdir -p $pkgdir/etc/bash_completion.d
        mv $pkgdir/usr/share/Rivet/rivet-completion $pkgdir/etc/bash_completion.d
}