summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Freyermuth <o.freyermuth@googlemail.com>2022-02-11 17:37:05 +0100
committerGuilherme Amadio <amadio@gentoo.org>2022-02-14 08:56:32 +0100
commitc67dc83f4e17907ce7083edcd0db1c8294c7fcd5 (patch)
tree7b561474b36e53c666e910a5d5d33821b1e0e148 /sci-physics/geant4_vmc/geant4_vmc-6.0-r1.ebuild
parentapp-containers/docker-cli: restrict tests again (diff)
downloadgentoo-c67dc83f4e17907ce7083edcd0db1c8294c7fcd5.tar.gz
gentoo-c67dc83f4e17907ce7083edcd0db1c8294c7fcd5.tar.bz2
gentoo-c67dc83f4e17907ce7083edcd0db1c8294c7fcd5.zip
sci-physics/geant4_vmc: Do not compile tests if USE=-test.
This fixes upstream's build system to honour enabling/disabling of tests, and uses the now functional CMake option. PRed upstream at: https://github.com/vmc-project/geant4_vmc/pull/28 Closes: https://bugs.gentoo.org/833126 Closes: https://github.com/gentoo/gentoo/pull/24162 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com> Signed-off-by: Guilherme Amadio <amadio@gentoo.org>
Diffstat (limited to 'sci-physics/geant4_vmc/geant4_vmc-6.0-r1.ebuild')
-rw-r--r--sci-physics/geant4_vmc/geant4_vmc-6.0-r1.ebuild86
1 files changed, 86 insertions, 0 deletions
diff --git a/sci-physics/geant4_vmc/geant4_vmc-6.0-r1.ebuild b/sci-physics/geant4_vmc/geant4_vmc-6.0-r1.ebuild
new file mode 100644
index 000000000000..3b9a8dd1cb99
--- /dev/null
+++ b/sci-physics/geant4_vmc/geant4_vmc-6.0-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/vmc-project/${PN}.git"
+else
+ MY_PV=$(ver_rs 1- -)
+ SRC_URI="https://github.com/vmc-project/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Virtual Monte Carlo Geant4 implementation"
+HOMEPAGE="https://github.com/vmc-project/geant4_vmc"
+
+LICENSE="GPL-3"
+SLOT="4"
+IUSE="doc examples geant3 +g4root vgm test"
+
+RDEPEND="
+ >=sci-physics/geant-4.11[c++17,opengl,geant3?]
+ sci-physics/root:=[c++17,-vmc]
+ >=sci-physics/vmc-2.0:=[c++17]
+ vgm? ( sci-physics/vgm:= )"
+DEPEND="${RDEPEND}
+ test? ( >=sci-physics/geant-4.11[gdml] )"
+BDEPEND="doc? ( app-doc/doxygen[dot] )"
+RESTRICT="
+ !examples? ( test )
+ !geant3? ( test )
+ !g4root? ( test )
+ !test? ( test )
+ !vgm? ( test )"
+
+DOCS=(history README.md)
+
+PATCHES=(
+ # https://github.com/vmc-project/geant4_vmc/pull/28
+ "${FILESDIR}"/${PN}-6.0-cmake-g4root-tests.patch
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DGeant4VMC_USE_VGM="$(usex vgm)"
+ -DGeant4VMC_USE_GEANT4_G3TOG4="$(usex geant3)"
+ -DGeant4VMC_USE_G4Root="$(usex g4root)"
+ -DGeant4VMC_BUILD_EXAMPLES="$(usex test)"
+ -DGeant4VMC_INSTALL_EXAMPLES="$(usex examples)"
+ -DGeant4VMC_BUILD_G4Root_TEST="$(usex test)"
+ )
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ if use doc ; then
+ local dirs=(
+ source
+ $(usev g4root)
+ $(usev examples)
+ )
+ local d
+ for d in "${dirs[@]}"; do
+ pushd "${d}" > /dev/null || die
+ doxygen || die
+ popd > /dev/null || die
+ done
+ fi
+}
+
+src_test() {
+ cd examples || die
+ ./test_suite.sh --debug --g3=off --garfield=off --builddir="${BUILD_DIR}" || die
+ ./test_suite_exe.sh --g3=off --garfield=off --garfield=off --builddir="${BUILD_DIR}" || die
+}
+
+src_install() {
+ cmake_src_install
+ use doc && local HTML_DOCS=(doc/.)
+ einstalldocs
+}