1 # Maintainer: Antonio Rojas <arojas@archlinux.org>
4 pkgname=(avogadrolibs avogadrolibs-qt5)
7 pkgdesc='Libraries that provide 3D rendering, visualization, analysis and data processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas'
9 url='https://www.openchemistry.org/'
11 makedepends=(cmake eigen boost python glew spglib hdf5 mmtf-cpp libmsym pybind11 vtk qt5-tools qt5-svg genxrdpattern tbb openmpi)
12 source=(https://github.com/OpenChemistry/avogadrolibs/archive/$pkgver/$pkgname-$pkgver.tar.gz
13 https://github.com/OpenChemistry/avogadrolibs/commit/0db79eb1.patch)
14 sha256sums=('46641504a1808c5ff6fb7d66be48d866848203899025fd386cc6e3dd5d9ec342'
15 'd7e6f2ba9a123c52313df31763dc9cb043a41ca64bb0dc695fb8af77716ed70a')
18 mkdir crystals molecules # Dummy dirs to trick cmake, actually provided by avogadro-molecules and avogadro-crystals
19 patch -d $pkgname-$pkgver -p1 < 0db79eb1.patch # Fix build
23 cmake -B build -S $pkgname-$pkgver \
24 -DCMAKE_INSTALL_PREFIX=/usr \
25 -DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects" \
26 -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects" \
27 -DENABLE_TRANSLATIONS=ON \
31 -DUSE_SYSTEM_GENXRDPATTERN=ON
35 package_avogadrolibs() {
36 depends=(molequeue glew spglib hdf5 avogadro-molecules avogadro-crystals)
37 optdepends=('avogadrolibs-qt5: For the VTK and Qt plugins')
39 DESTDIR="$pkgdir" cmake --install build
40 rm -r "$pkgdir"/usr/lib/libAvogadroQt* \
41 "$pkgdir"/usr/lib/libAvogadroMoleQueue* \
42 "$pkgdir"/usr/lib/libAvogadroVtk* \
43 "$pkgdir"/usr/include/avogadro/{molequeue,qt*,vtk} \
44 "$pkgdir"/usr/lib/avogadro2/{scripts,staticplugins}
46 install -Dm644 $pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
48 # Move python module to the correct place
49 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
50 mkdir -p "$pkgdir${site_packages}"
51 mv "$pkgdir"/usr/lib/avogadro "$pkgdir${site_packages}"
54 package_avogadrolibs-qt5() {
55 pkgdesc="Qt 5 modules for Avogadro"
56 depends=(qt5-svg libarchive libmsym avogadrolibs vtk openmpi fmt libxcursor)
58 DESTDIR="$pkgdir" cmake --install build/avogadro/molequeue
59 DESTDIR="$pkgdir" cmake --install build/avogadro/qtgui
60 DESTDIR="$pkgdir" cmake --install build/avogadro/qtopengl
61 DESTDIR="$pkgdir" cmake --install build/avogadro/qtplugins
62 DESTDIR="$pkgdir" cmake --install build/avogadro/vtk
64 install -Dm644 $pkgbase-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname