summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6a93181566c5d716b06936e72e3199a666f313f0 (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
# Maintainer: Thomas Gläßle <t_glaessleATgmxDOTnet>

pkgname=madx-dev
pkgver=5.02.13
pkgrel=3
pkgdesc="Accelerator Optics simulation code, latest development release"
url="http://cern.ch/mad"
license=("custom")
depends=('gcc-libs' 'libx11' 'lapack')
conflicts=('madx-svn')
provides=('madx')
makedepends=('cmake')
arch=('x86_64')


tarball=madx-src.tgz
extract=madx-${pkgver}

source=("http://madx.web.cern.ch/madx/releases/${pkgver}/${tarball}" madx_vim.diff pmass.diff)
md5sums=('11307450b9a25a9d75c7bca42ae18c2c'
         'befa90472e7b5725406c1dab5811102d'
         '99a1f46963d8db5d933e2ac941a1fdcf')

prepare() {
    cd ${srcdir}/${extract}
    find . -name '._*' -print0 | xargs -0 -r rm
    patch -p0 < ${srcdir}/madx_vim.diff
    patch -p0 < ${srcdir}/pmass.diff

    mkdir -p ${srcdir}/build
    cd ${srcdir}/build

    cmake \
        -DCMAKE_C_COMPILER=gcc \
        -DCMAKE_Fortran_COMPILER=gfortran \
        -DMADX_STATIC=OFF \
        -DMADX_ONLINE=OFF \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DBINARY_POSTFIX= \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DCMAKE_INSTALL_RPATH='$ORIGIN' \
        ${srcdir}/${extract}
}

build() {
    cd ${srcdir}/build
    make
}

check() {
    cd ${srcdir}/build
    # ctest -E LONG
}

package() {
    cd ${srcdir}/build
    make DESTDIR=${pkgdir} install
    # resolve conflict with 'ndiff' from package 'nmap':
    mv ${pkgdir}/usr/bin/n{,um}diff

    cd ${srcdir}/${extract}
    install -D -m644 License.txt ${pkgdir}/usr/share/licenses/${pkgname}/license.txt
}