*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / sci-libs / avogadrolibs / avogadrolibs-1.91.0_pre20180415.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 COMMIT=606debb5d7c2c4020478264c609f895584fc5e38
7 inherit cmake-utils
8
9 DESCRIPTION="Advanced molecule editor and visualizer 2 - libraries"
10 HOMEPAGE="https://www.openchemistry.org/"
11 SRC_URI="https://github.com/OpenChemistry/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz
12         vtk? ( https://github.com/psavery/genXrdPattern/releases/download/1.0-static/linux64-genXrdPattern )"
13
14 SLOT="0"
15 LICENSE="BSD GPL-2+"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="archive doc hdf5 qt5 static-plugins test vtk"
18 RESTRICT="!test? ( test )"
19
20 REQUIRED_USE="vtk? ( qt5 )"
21
22 # TODO: Not yet packaged:
23 # sci-libs/libmsym (https://github.com/mcodev31/libmsym)
24 # sci-libs/spglib (https://atztogo.github.io/spglib/)
25 RDEPEND="
26         dev-libs/jsoncpp:=
27         >=sci-chemistry/molequeue-0.7
28         archive? ( app-arch/libarchive )
29         hdf5? ( sci-libs/hdf5:= )
30         qt5? (
31                 dev-qt/qtconcurrent:5
32                 dev-qt/qtcore:5
33                 dev-qt/qtgui:5
34                 dev-qt/qtnetwork:5
35                 dev-qt/qtwidgets:5
36                 media-libs/glew:0=
37                 virtual/opengl
38         )
39         vtk? ( sci-libs/vtk[qt5,views] )
40 "
41 DEPEND="${RDEPEND}
42         dev-cpp/eigen:3
43         qt5? ( dev-qt/linguist-tools:5 )
44         test? ( dev-cpp/gtest )"
45
46 S="${WORKDIR}/${PN}-${COMMIT}"
47
48 PATCHES=(
49         "${FILESDIR}"/${PN}-0.7.2-6464.patch
50         "${FILESDIR}/"${PN}-1.91.0_pre20180406-underlinking.patch
51         "${FILESDIR}/"${PN}-1.91.0_pre20180406-unbundle-jsoncpp.patch
52         "${FILESDIR}/"${PN}-1.91.0_pre20180406-bundled-genxrdpattern.patch
53         "${FILESDIR}/"${P}-qt-5.11b3.patch
54 )
55
56 src_unpack() {
57         unpack ${P}.tar.gz
58         if use vtk; then
59                 cp "${DISTDIR}"/linux64-genXrdPattern "${WORKDIR}/genXrdPattern" || die
60         fi
61 }
62
63 src_configure() {
64         local mycmakeargs=(
65                 -DUSE_PROTOCALL=OFF
66                 -DBUILD_GPL_PLUGINS=ON
67                 -DUSE_MOLEQUEUE=ON
68                 -DUSE_LIBMSYM=OFF
69                 -DUSE_LIBSPG=OFF
70                 -DUSE_PYTHON=OFF
71                 -DUSE_LIBARCHIVE=$(usex archive)
72                 -DBUILD_DOCUMENTATION=$(usex doc)
73                 -DUSE_HDF5=$(usex hdf5)
74                 -DENABLE_TRANSLATIONS=$(usex qt5)
75                 -DUSE_OPENGL=$(usex qt5)
76                 -DUSE_QT=$(usex qt5)
77                 -DBUILD_STATIC_PLUGINS=$(usex static-plugins)
78                 -DENABLE_TESTING=$(usex test)
79                 -DUSE_VTK=$(usex vtk)
80         )
81         use vtk && mycmakeargs+=(
82                 -DBUNDLED_GENXRDPATTERN="${WORKDIR}/genXrdPattern"
83         )
84
85         cmake-utils_src_configure
86 }