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 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 sha256sums=('46641504a1808c5ff6fb7d66be48d866848203899025fd386cc6e3dd5d9ec342')
18 mkdir crystals molecules # Dummy dirs to trick cmake, actually provided by avogadro-molecules and avogadro-crystals
22 cmake -B build -S $pkgname-$pkgver \
23 -DCMAKE_INSTALL_PREFIX=/usr \
24 -DCMAKE_C_CLAFS="$CFLAGS -ffat-lto-objects" \
25 -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects" \
26 -DENABLE_TRANSLATIONS=ON \
30 -DUSE_SYSTEM_GENXRDPATTERN=ON
34 package_avogadrolibs() {
35 DESTDIR="$pkgdir" cmake --install build
36 rm -r "$pkgdir"/usr/lib/libAvogadroQt* \
37 "$pkgdir"/usr/lib/libAvogadroMoleQueue* \
38 "$pkgdir"/usr/lib/libAvogadroVtk* \
39 "$pkgdir"/usr/include/avogadro/{molequeue,qt*,vtk} \
40 "$pkgdir"/usr/lib/avogadro2/{scripts,staticplugins}
42 install -Dm644 $pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
44 # Move python module to the correct place
45 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
46 mkdir -p "$pkgdir${site_packages}"
47 mv "$pkgdir"/usr/lib/avogadro "$pkgdir${site_packages}"
50 package_avogadrolibs-qt5() {
51 pkgdesc="Qt 5 modules for Avogadro"
52 depends=(qt5-svg libarchive libmsym avogadrolibs vtk openmpi fmt libxcursor)
54 DESTDIR="$pkgdir" cmake --install build/avogadro/molequeue
55 DESTDIR="$pkgdir" cmake --install build/avogadro/qtgui
56 DESTDIR="$pkgdir" cmake --install build/avogadro/qtopengl
57 DESTDIR="$pkgdir" cmake --install build/avogadro/qtplugins
58 DESTDIR="$pkgdir" cmake --install build/avogadro/vtk