summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2018-08-30 17:58:30 +0300
committerAlexey Shvetsov <alexxy@gentoo.org>2018-08-30 17:59:42 +0300
commit70c86f141899974ebead3d3372ef6d6aa87ddd2c (patch)
tree2683c322724e1f176e4272aba73434aab93f9a92
parentx11-themes/numix-gtk-theme: [QA] remove obsolete statements (diff)
downloadgentoo-70c86f141899974ebead3d3372ef6d6aa87ddd2c.tar.gz
gentoo-70c86f141899974ebead3d3372ef6d6aa87ddd2c.tar.bz2
gentoo-70c86f141899974ebead3d3372ef6d6aa87ddd2c.zip
sci-libs/xdmf2: Fix build with CMake 3.12+
Package-Manager: Portage-2.3.47, Repoman-2.3.10
-rw-r--r--sci-libs/xdmf2/files/xdmf2-1.0_p141226-cmake-3.12.patch14
-rw-r--r--sci-libs/xdmf2/xdmf2-1.0_p141226-r3.ebuild78
2 files changed, 92 insertions, 0 deletions
diff --git a/sci-libs/xdmf2/files/xdmf2-1.0_p141226-cmake-3.12.patch b/sci-libs/xdmf2/files/xdmf2-1.0_p141226-cmake-3.12.patch
new file mode 100644
index 000000000000..14e74bb6108e
--- /dev/null
+++ b/sci-libs/xdmf2/files/xdmf2-1.0_p141226-cmake-3.12.patch
@@ -0,0 +1,14 @@
+--- a/CMakeLists.txt 2018-08-30 17:49:07.777815386 +0300
++++ b/CMakeLists.txt 2018-08-30 17:49:49.276706955 +0300
+@@ -6,6 +6,11 @@
+ cmake_policy(SET CMP0015 NEW)
+ endif (POLICY CMP0015)
+
++# Needed for CMake 2.12+
++if(POLICY CMP0077)
++ cmake_policy(SET CMP0077 NEW)
++endif()
++
+ if(MSVC10)
+ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
+ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
diff --git a/sci-libs/xdmf2/xdmf2-1.0_p141226-r3.ebuild b/sci-libs/xdmf2/xdmf2-1.0_p141226-r3.ebuild
new file mode 100644
index 000000000000..205807de8ada
--- /dev/null
+++ b/sci-libs/xdmf2/xdmf2-1.0_p141226-r3.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic python-single-r1
+
+DESCRIPTION="eXtensible Data Model and Format"
+HOMEPAGE="http://xdmf.org/index.php/Main_Page"
+SRC_URI="https://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+SLOT="0"
+LICENSE="VTK"
+KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc python test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ dev-libs/boost:=
+ sci-libs/hdf5:=
+ dev-libs/libxml2:2
+ python? ( ${PYTHON_DEPS} )
+ "
+
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )
+ python? ( dev-lang/swig:0 )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-module.patch
+ "${FILESDIR}"/${P}-cannot-find-hdf5-bug-591302.patch
+ "${FILESDIR}"/${P}-cmake-3.12.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup && python_export
+}
+
+src_prepare() {
+ if use python; then
+ local _site=$(python_get_sitedir)
+ sed \
+ -e "/DESTINATION/s:python:${_site##${EPREFIX}/usr/$(get_libdir)/}:g" \
+ -i CMakeLists.txt || die
+ fi
+
+ sed \
+ -e "/DESTINATION/s:lib:$(get_libdir):g" \
+ -e "/INSTALL/s:lib:$(get_libdir):g" \
+ -i CMakeLists.txt core/CMakeLists.txt || die
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ # bug 619604
+ append-cxxflags -std=c++14
+
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=1
+ -DXDMF_BUILD_DOCUMENTATION=$(usex doc)
+ -DBUILD_TESTING=$(usex test)
+ -DXDMF_WRAP_PYTHON=$(usex python)
+# -DXDMF_WRAP_JAVA=$(usex java)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ dosym XdmfConfig.cmake /usr/share/cmake/Modules/${PN}Config.cmake
+
+ # need to byte-compile 'XdmfCore.py' and 'Xdmf.py'
+ # as the CMake build system does not compile them itself
+ use python && python_optimize "${D%/}$(python_get_sitedir)"
+}