archrelease: copy trunk to extra-x86_64
[arch-packages.git] / avogadrolibs / repos / extra-x86_64 / PKGBUILD
blob03648b04020b2c2a7527e6d8c77ee1ea25bd3bf4
1 # Maintainer: Antonio Rojas <arojas@archlinux.org>
3 pkgbase=avogadrolibs
4 pkgname=(avogadrolibs avogadrolibs-qt5)
5 pkgver=1.95.1
6 pkgrel=6
7 pkgdesc='Libraries that provide 3D rendering, visualization, analysis and data processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas'
8 arch=(x86_64)
9 url='https://www.openchemistry.org/'
10 license=(custom)
11 depends=(molequeue glew spglib hdf5 avogadro-molecules avogadro-crystals)
12 makedepends=(cmake eigen boost python mmtf-cpp libmsym pybind11 vtk qt5-tools qt5-svg genxrdpattern tbb openmpi)
13 optdepends=('avogadrolibs-qt5: For the VTK and Qt plugins')
14 source=(https://github.com/OpenChemistry/avogadrolibs/archive/$pkgver/$pkgname-$pkgver.tar.gz
15         vtk9.patch)
16 sha256sums=('52817eebfc0cf700e5f6c0c4455b460618ec0dd7cb4ede5d8fabc5a2d73a7816'
17             'a2272c456f1a5dd85bb98fbf5ed9aa5aabaa3fbd8b191bb6d14e6ee57c2789f4')
19 prepare() {
20   mkdir crystals molecules # Dummy dirs to trick cmake, actually provided by avogadro-molecules and avogadro-crystals
21   patch -d $pkgname-$pkgver -p1 < vtk9.patch # Fix build with VTK 9
24 build() {
25   cmake -B build -S $pkgname-$pkgver \
26     -DCMAKE_INSTALL_PREFIX=/usr \
27     -DENABLE_TRANSLATIONS=ON \
28     -DUSE_HDF5=ON \
29     -DUSE_VTK=ON \
30     -DUSE_PYTHON=ON \
31     -DUSE_SYSTEM_GENXRDPATTERN=ON
32   cmake --build build
35 package_avogadrolibs() {
36   DESTDIR="$pkgdir" cmake --install build
37   rm -r "$pkgdir"/usr/lib/libAvogadroQt* \
38         "$pkgdir"/usr/lib/libAvogadroMoleQueue* \
39         "$pkgdir"/usr/lib/libAvogadroVtk* \
40         "$pkgdir"/usr/include/avogadro/{molequeue,qt*,vtk} \
41         "$pkgdir"/usr/lib/avogadro2/{scripts,staticplugins}
43   install -Dm644 $pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
45 # Move python module to the correct place
46   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
47   mkdir -p "$pkgdir${site_packages}"
48   mv "$pkgdir"/usr/lib/avogadro "$pkgdir${site_packages}"
51 package_avogadrolibs-qt5() {
52   pkgdesc="Qt 5 modules for Avogadro"
53   depends=(qt5-svg libarchive libmsym avogadrolibs vtk openmpi pugixml fmt tbb libxcursor)
55   DESTDIR="$pkgdir" cmake --install build/avogadro/molequeue
56   DESTDIR="$pkgdir" cmake --install build/avogadro/qtgui
57   DESTDIR="$pkgdir" cmake --install build/avogadro/qtopengl
58   DESTDIR="$pkgdir" cmake --install build/avogadro/qtplugins
59   DESTDIR="$pkgdir" cmake --install build/avogadro/vtk