archrelease: copy trunk to staging-x86_64
[arch-packages.git] / avogadrolibs / trunk / PKGBUILD
blob8edb52db5b4a0eca4f0114418d1e1cdc308a2995
1 # Maintainer: Antonio Rojas <arojas@archlinux.org>
3 pkgbase=avogadrolibs
4 pkgname=(avogadrolibs avogadrolibs-qt5)
5 pkgver=1.97.0
6 pkgrel=7
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 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')
17 prepare() {
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
22 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 \
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   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