diff options
author | Marek Szuba <marecki@gentoo.org> | 2021-07-16 11:00:02 +0100 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2021-07-16 12:43:25 +0100 |
commit | fab9308cfb8c6c168b169803c9d8d04d3696dc64 (patch) | |
tree | 84edb2b05ec5dc86611d26e3103e8a6ed1cd1d96 /sci-libs | |
parent | sci-libs/metis: remove unused fortran-2 inherit (diff) | |
download | gentoo-fab9308cfb8c6c168b169803c9d8d04d3696dc64.tar.gz gentoo-fab9308cfb8c6c168b169803c9d8d04d3696dc64.tar.bz2 gentoo-fab9308cfb8c6c168b169803c9d8d04d3696dc64.zip |
sci-libs/parmetis: major refactoring
1. Update to EAPI 7 and cmake.eclass
2. Unbundle sci-libs/metis
3. Remove IUSE=mpi - with METIS unbundled, settings USE=-mpi effectively
turns this package into a metapackage
4. Add USE=fortran requirement to virtual/mpi - without it,
libparmetis.so ends up with unresolved symbol MPI_Comm_f2c
5. CMakeFiles are now modified by patches rather than sed - the changes
are entirely static so there is no need for the latter
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'sci-libs')
3 files changed, 123 insertions, 0 deletions
diff --git a/sci-libs/parmetis/files/parmetis-4.0.3-01-cmake-paths.patch b/sci-libs/parmetis/files/parmetis-4.0.3-01-cmake-paths.patch new file mode 100644 index 000000000000..cdff3c0ea490 --- /dev/null +++ b/sci-libs/parmetis/files/parmetis-4.0.3-01-cmake-paths.patch @@ -0,0 +1,37 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,8 @@ + cmake_minimum_required(VERSION 2.8) + project(ParMETIS) + ++include(GNUInstallDirs) ++ + set(GKLIB_PATH METIS/GKlib CACHE PATH "path to GKlib") + set(METIS_PATH METIS CACHE PATH "path to METIS") + +@@ -36,7 +38,6 @@ + add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) + add_subdirectory(include) + add_subdirectory(libparmetis) +-add_subdirectory(programs) + + # This is for testing during development and is not being distributed + #add_subdirectory(test) +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -1 +1 @@ +-install(FILES parmetis.h DESTINATION include) +\ No newline at end of file ++install(FILES parmetis.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +--- a/libparmetis/CMakeLists.txt ++++ b/libparmetis/CMakeLists.txt +@@ -9,6 +9,6 @@ + set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") + + install(TARGETS parmetis +- LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib +- ARCHIVE DESTINATION lib) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/sci-libs/parmetis/files/parmetis-4.0.3-02-unbundle-metis.patch b/sci-libs/parmetis/files/parmetis-4.0.3-02-unbundle-metis.patch new file mode 100644 index 000000000000..f4e04eb48a94 --- /dev/null +++ b/sci-libs/parmetis/files/parmetis-4.0.3-02-unbundle-metis.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,7 +35,6 @@ + include_directories(${METIS_PATH}/include) + + # List of directories that cmake will look for CMakeLists.txt +-add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) + add_subdirectory(include) + add_subdirectory(libparmetis) + diff --git a/sci-libs/parmetis/parmetis-4.0.3-r2.ebuild b/sci-libs/parmetis/parmetis-4.0.3-r2.ebuild new file mode 100644 index 000000000000..6d9599fec417 --- /dev/null +++ b/sci-libs/parmetis/parmetis-4.0.3-r2.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake toolchain-funcs + +DESCRIPTION="Parallel (MPI) unstructured graph partitioning library" +HOMEPAGE="https://www-users.cs.umn.edu/~karypis/metis/parmetis/" +SRC_URI="http://glaros.dtc.umn.edu/gkhome/fetch/sw/${PN}/${P}.tar.gz" + +LICENSE="all-rights-reserved" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux ~x86-linux" +IUSE="doc examples openmp pcre" +RESTRICT="mirror bindist" + +DEPEND=">=sci-libs/metis-5.1.0-r5 + virtual/mpi[fortran] + pcre? ( dev-libs/libpcre:= )" +RDEPEND="${DEPEND} + !<sci-libs/metis-5.1.0-r5" + +PATCHES=( + "${FILESDIR}"/${PN}-4.0.3-01-cmake-paths.patch + "${FILESDIR}"/${PN}-4.0.3-02-unbundle-metis.patch +) + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]]; then + use openmp && tc-check-openmp + fi +} + +src_prepare() { + export CC=mpicc CXX=mpicxx + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DGKLIB_PATH="${S}/metis/GKlib" + -DGKRAND=ON + -DMETIS_PATH="${EPREFIX}/usr" + -DOPENMP=$(usex openmp) + -DPCRE=$(usex pcre) + -DSHARED=ON + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + + dodoc Changelog + use doc && dodoc manual/manual.pdf + if use examples; then + docinto examples + dodoc -r Graphs programs + fi + + cat > ${PN}.pc <<-EOF + prefix=${EPREFIX}/usr + libdir=\${prefix}/$(get_libdir) + includedir=\${prefix}/include + Name: ${PN} + Description: ${DESCRIPTION} + Version: ${PV} + URL: ${HOMEPAGE} + Libs: -L\${libdir} -l${PN} + Cflags: -I\${includedir}/${PN} + Requires: metis + EOF + insinto /usr/$(get_libdir)/pkgconfig + doins ${PN}.pc +} |