summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/med/Manifest1
-rw-r--r--sci-libs/med/files/med-4.1.0-0001-Gentoo-specific-Adjust-install-path-for-build-dir.patch26
-rw-r--r--sci-libs/med/files/med-4.1.0-0002-Re-add-option-for-building-Fortran-library.patch39
-rw-r--r--sci-libs/med/med-4.1.0.ebuild109
4 files changed, 175 insertions, 0 deletions
diff --git a/sci-libs/med/Manifest b/sci-libs/med/Manifest
index cec3ed3d3f8a..fc47f4350349 100644
--- a/sci-libs/med/Manifest
+++ b/sci-libs/med/Manifest
@@ -1 +1,2 @@
DIST med-4.0.0.tar.gz 47849098 BLAKE2B 0bc6710f7b5156e09962e3125349573989429e614a203f649843f00dea06217040ebee70e481eed9c0dd304cb7d167efcd216c3600f6954a74f262cc845fff63 SHA512 2840437010481fc5f12a56e3282f8ca5e94df541899e2b511756702f86d0f87dbf2f6e086d8e591e2bd370d8f4bab8089e7f7f939fea16354a23e2b5a4d96cd7
+DIST med-4.1.0.tar.gz 50375039 BLAKE2B 514ca19baf15e349ecbce870b318b37c51bfb57ac9b03c2b2c1b28836fec7fcf2dce573b9ea155f358d5e0bcee120c12a31598cd4f1e44837eca787553bb70d4 SHA512 94d07663c2f6a3cd497f54b480c3d742476d2a25172feb567980c9e75d49f4661aa2c6aaf570470938265997154e348bc1608065b86d42afda52d4e6361fedf8
diff --git a/sci-libs/med/files/med-4.1.0-0001-Gentoo-specific-Adjust-install-path-for-build-dir.patch b/sci-libs/med/files/med-4.1.0-0001-Gentoo-specific-Adjust-install-path-for-build-dir.patch
new file mode 100644
index 000000000000..e066385def8f
--- /dev/null
+++ b/sci-libs/med/files/med-4.1.0-0001-Gentoo-specific-Adjust-install-path-for-build-dir.patch
@@ -0,0 +1,26 @@
+From ccc372d4fa95ea2e083505ec5c536a48c49dd151 Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl@gmail.com>
+Date: Wed, 25 Nov 2020 21:08:46 +0100
+Subject: [PATCH] [Gentoo-specific] Adjust install path for build dir
+
+Signed-off-by: Bernd Waibel <waebbl@gmail.com>
+---
+ tools/mdump/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/mdump/CMakeLists.txt b/tools/mdump/CMakeLists.txt
+index 991b5af..dd2018a 100644
+--- a/tools/mdump/CMakeLists.txt
++++ b/tools/mdump/CMakeLists.txt
+@@ -44,6 +44,6 @@ CONFIGURE_FILE(xmdump3.in ${PROJECT_BINARY_DIR}/xmdump3 @ONLY)
+ CONFIGURE_FILE(xmdump4.in ${PROJECT_BINARY_DIR}/xmdump4 @ONLY)
+
+ INSTALL(PROGRAMS ${PROJECT_BINARY_DIR}/xmdump2 ${PROJECT_BINARY_DIR}/xmdump3 ${PROJECT_BINARY_DIR}/xmdump4 DESTINATION bin)
+-INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink mdump4 mdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)")
+-INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink xmdump4 xmdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)")
++INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink mdump4 mdump WORKING_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/bin\")")
++INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink xmdump4 xmdump WORKING_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/bin\")")
+
+--
+2.29.2
+
diff --git a/sci-libs/med/files/med-4.1.0-0002-Re-add-option-for-building-Fortran-library.patch b/sci-libs/med/files/med-4.1.0-0002-Re-add-option-for-building-Fortran-library.patch
new file mode 100644
index 000000000000..b5c3364b799e
--- /dev/null
+++ b/sci-libs/med/files/med-4.1.0-0002-Re-add-option-for-building-Fortran-library.patch
@@ -0,0 +1,39 @@
+From 3c8eb1ca6be13f185f20ee726f91f31d717947d2 Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl@gmail.com>
+Date: Sat, 28 Nov 2020 21:52:29 +0100
+Subject: [PATCH] Re-add option for building Fortran library
+
+Signed-off-by: Bernd Waibel <waebbl@gmail.com>
+---
+ CMakeLists.txt | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2262275..7cb014c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,12 +6,15 @@ PROJECT(MEDFile C CXX)
+ ## See http://www.cmake.org/Bug/view.php?id=10227
+ #ENABLE_LANGUAGE(Fortran OPTIONAL)
+
+-INCLUDE(CheckLanguage)
+-CHECK_LANGUAGE(Fortran)
+-IF(CMAKE_Fortran_COMPILER)
+- ENABLE_LANGUAGE(Fortran)
+-ELSE()
+- MESSAGE(STATUS "No Fortran support")
++OPTION (MEDFILE_BUILD_FORTRAN "Build MED-file fortran library" ON)
++IF (MEDFILE_BUILD_FORTRAN)
++ INCLUDE(CheckLanguage)
++ CHECK_LANGUAGE(Fortran)
++ IF(CMAKE_Fortran_COMPILER)
++ ENABLE_LANGUAGE(Fortran)
++ ELSE()
++ MESSAGE(STATUS "No Fortran support")
++ ENDIF()
+ ENDIF()
+
+ ## Version number
+--
+2.29.2
+
diff --git a/sci-libs/med/med-4.1.0.ebuild b/sci-libs/med/med-4.1.0.ebuild
new file mode 100644
index 000000000000..ab5056e4a4d7
--- /dev/null
+++ b/sci-libs/med/med-4.1.0.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+FORTRAN_NEEDED=fortran
+
+PYTHON_COMPAT=( python3_{7..9} )
+
+inherit cmake fortran-2 python-single-r1
+
+DESCRIPTION="A library to store and exchange meshed data or computation results"
+HOMEPAGE="https://www.salome-platform.org/user-section/about/med"
+SRC_URI="https://files.salome-platform.org/Salome/other/${P}.tar.gz"
+LICENSE="LGPL-3"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc fortran mpi python test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT="!test? ( test ) python? ( test )"
+
+RDEPEND="
+ !sci-libs/libmed
+ dev-lang/tk:0=
+ >=sci-libs/hdf5-1.10.2:=[fortran?,mpi?]
+ mpi? ( virtual/mpi[fortran?] )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="python? ( >=dev-lang/swig-3.0.8 )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-0001-Gentoo-specific-Adjust-install-path-for-build-dir.patch"
+ "${FILESDIR}/${P}-0002-Re-add-option-for-building-Fortran-library.patch"
+)
+
+DOCS=( AUTHORS ChangeLog NEWS README README.CMAKE TODO )
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+ use fortran && fortran-2_pkg_setup
+}
+
+src_prepare() {
+ if use python; then
+ # fixes for correct libdir name
+ local pysite=$(python_get_sitedir)
+ pysite="${pysite##/usr/}"
+ sed \
+ -e 's@SET(_install_dir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/med)@SET(_install_dir '${pysite}'/med)@' \
+ -i ./python/CMakeLists.txt || die "sed on ./python/CMakeLists.txt failed"
+ fi
+ for cm in ./src/CMakeLists.txt ./tools/medimport/CMakeLists.txt
+ do
+ sed -i -e "s@INSTALL(TARGETS \(.*\) DESTINATION lib)@INSTALL(TARGETS \1 DESTINATION $(get_libdir))@" \
+ "${cm}" || die "sed on ${cm} failed"
+ done
+ sed -e 's/med-fichier/med/' -i CMakeLists.txt || die "fix paths failed"
+ sed -e 's|doc/med-${MED_STR_VERSION}|doc/med-${MED_STR_VERSION}/html|' \
+ -i CMakeLists.txt || die "fix doc path failed"
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ # as indicated in the CMakeLists.txt, the shipped documentation is generated by a custom doxygen,
+ # so let's avoid rebuilding it because it will be different
+ -DMEDFILE_BUILD_DOC=OFF
+ -DMEDFILE_BUILD_FORTRAN=$(usex fortran)
+ -DMEDFILE_BUILD_PYTHON=$(usex python)
+ -DMEDFILE_BUILD_SHARED_LIBS=ON
+ -DMEDFILE_BUILD_STATIC_LIBS=OFF
+ -DMEDFILE_BUILD_TESTS=$(usex test)
+ -DMEDFILE_INSTALL_DOC=$(usex doc)
+ -DMEDFILE_USE_MPI=$(usex mpi)
+ -DMEDFILE_USE_UNICODE=ON
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+
+ # we don't need old 2.3.6 include files
+ rm -r "${ED}"/usr/include/2.3.6 || die "failed to delete obsolete include dir"
+
+ # the optimization done in CMakeLists.txt has been disabled so
+ # we need to do it manually
+ use python && python_optimize
+
+ # Prevent test executables being installed
+ if use test; then
+ rm -r "${ED}"/usr/bin/testc || die "failed to delete C test executables"
+ if use fortran; then
+ rm -r "${ED}"/usr/bin/testf || die "failed to delete fortran test executables"
+ fi
+ if use python; then
+ rm -r "${ED}"/usr/bin/testpy || die "failed to delete python test executables"
+ fi
+ fi
+}
+
+src_test() {
+ # override parallel mode only for tests
+ local myctestargs=( "-j 1" )
+ cmake_src_test
+}