summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b76bcde68671aec37063a9fe34500d42c8e1ee0 (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
# Maintainer: Constantine Evans <const@costi.eu>
# Contributor: Michał Wojdyła < micwoj9292 at gmail dot com >
pkgname=oxdna-cuda-git

pkgdesc="DNA/RNA/etc simulator, from lorenzo-rovigatti/oxDNA, with CUDA support and analysis tools."

url="https://github.com/lorenzo-rovigatti/oxDNA"

pkgver=v3.6.1.r10.g9af1214a
arch=('x86_64')
license=('GPL3')
provides=('oxdna')
conflicts=('oxdna')
pkgrel=1

depends=('python3' 'python-matplotlib' 'python-scikit-learn' 'python-setuptools' 'ipython')

makedepends=('git' 'cmake' 'gsl' 'cuda' 'gcc12' 'python-build' 'python-wheel' 'python-installer' 'cython' 'python-setuptools-scm')
optdepends=('python-matplotlib: for plotting')

source=("git+https://github.com/lorenzo-rovigatti/oxDNA.git")
sha256sums=('SKIP')

pkgver() {
  cd "oxDNA"
  git describe --tags --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}


build() {
    cmake -B build -S "oxDNA" \
        -DCMAKE_BUILD_TYPE='None' \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -DCMAKE_C_COMPILER='gcc-12' \
        -DCMAKE_CXX_COMPILER='g++-12' \
        -Wno-dev \
        -DCUDA=ON \
        -DPython=ON \
        -DCMAKE_SKIP_RPATH=YES \
        -DCMAKE_INSTALL_LIBDIR='lib/oxdna' \
        -DOxpySystemInstall=ON

    cmake --build build

    cd "oxDNA/analysis"
    python -m build --no-isolation --wheel
}

package() {
    DESTDIR="$pkgdir" cmake --install build

    install -Dm755 "${srcdir}/build/bin/oxDNA" "${pkgdir}/usr/bin/oxDNA"
    install -Dm755 "${srcdir}/build/bin/DNAnalysis" "${pkgdir}/usr/bin/DNAnalysis"
    install -Dm755 "${srcdir}/build/bin/confGenerator" "${pkgdir}/usr/bin/confGenerator"

    cd "oxDNA/analysis"
    python -m installer --destdir="$pkgdir" dist/*.whl

    cd "${srcdir}/build/oxpy/python/oxpy"
    python setup.py install --root="$pkgdir" --optimize=1

    install -Dm644 "${srcdir}/build/src/liboxdna_common.so" "${pkgdir}/usr/lib/liboxdna_common.so"
}