summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/parmetis')
-rw-r--r--sci-libs/parmetis/files/parmetis-4.0.3-01-cmake-paths.patch37
-rw-r--r--sci-libs/parmetis/files/parmetis-4.0.3-02-unbundle-metis.patch10
-rw-r--r--sci-libs/parmetis/parmetis-4.0.3-r2.ebuild76
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
+}