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

pkgname=madx-dev
pkgver=5.09.03
pkgrel=1
pkgdesc="Accelerator Optics simulation code, shared object, development files"
url="http://cern.ch/mad"
license=("custom")
depends=('gcc-libs' 'libx11' 'lapack')
conflicts=('madx-git')
provides=('madx')
makedepends=('cmake' 'gcc-fortran')
arch=('x86_64')

tarball=${pkgver}.tar.gz
extract=MAD-X-${pkgver}

source=("https://github.com/MethodicalAcceleratorDesign/MAD-X/archive/${tarball}")
sha256sums=('cd57f9451e3541a820814ad9ef72b6e01d09c6f3be56802fa2e95b1742db7797')

build() {
    cmake -S "${srcdir}/${extract}" \
        -B "${srcdir}"/build \
        -DCMAKE_INSTALL_PREFIX="${pkgdir}"/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=ON \
        -DMADX_STATIC=OFF \
        -DMADX_ONLINE=OFF \
        -DMADX_INSTALL_DOC=OFF \
        -DMADX_X11=ON

    cmake --build "${srcdir}"/build
}

check() {
    cd "${srcdir}"/build
    # export GFORTRAN_UNBUFFERED_PRECONNECTED=y
    # ctest -E LONG
}

package() {
    cmake --build "$srcdir"/build --target install

    # resolve conflict with 'ndiff' from package 'nmap':
    mv "${pkgdir}"/usr/bin/n{,um}diff

    install -D -m644 "${srcdir}/${extract}"/License.txt \
        "${pkgdir}/usr/share/licenses/${pkgname}"/LICENSE
}