summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-05-07 10:10:58 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-05-07 10:12:47 +0200
commitc78ecbd3fdf9b33e307023baf0de12c4448dd283 (patch)
tree507693a1428c830a85f949ea78539c4ab207b1ec /sci-libs/metis/metis-5.2.1-r2.ebuild
parentdev-db/libzdb: add 3.2.3, drop 3.1-r1 (diff)
downloadgentoo-c78ecbd3fdf9b33e307023baf0de12c4448dd283.tar.gz
gentoo-c78ecbd3fdf9b33e307023baf0de12c4448dd283.tar.bz2
gentoo-c78ecbd3fdf9b33e307023baf0de12c4448dd283.zip
sci-libs/metis: ensure GKlib is marked as NEEDED
Closes: https://bugs.gentoo.org/905822 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'sci-libs/metis/metis-5.2.1-r2.ebuild')
-rw-r--r--sci-libs/metis/metis-5.2.1-r2.ebuild94
1 files changed, 94 insertions, 0 deletions
diff --git a/sci-libs/metis/metis-5.2.1-r2.ebuild b/sci-libs/metis/metis-5.2.1-r2.ebuild
new file mode 100644
index 000000000000..593b9797c249
--- /dev/null
+++ b/sci-libs/metis/metis-5.2.1-r2.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="A package for unstructured serial graph partitioning"
+HOMEPAGE="https://github.com/KarypisLab/METIS"
+SRC_URI="https://github.com/KarypisLab/METIS/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/METIS-${PV}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~riscv ~x86 ~amd64-linux"
+IUSE="double-precision examples int64 openmp"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-multilib.patch
+ "${FILESDIR}"/${P}-respect-user-flags.patch
+ # https://github.com/KarypisLab/METIS/pull/52 Bug 905822
+ "${FILESDIR}"/${P}-add-gklib-as-required.patch
+)
+
+DEPEND="sci-libs/gklib"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ local idxwidth realwidth
+
+ if use int64; then
+ idxwidth="#define IDXTYPEWIDTH 64"
+ else
+ idxwidth="#define IDXTYPEWIDTH 32"
+ fi
+
+ if use double-precision; then
+ realwidth="#define REALTYPEWIDTH 64"
+ else
+ realwidth="#define REALTYPEWIDTH 32"
+ fi
+
+ cmake_src_prepare
+
+ # From Makefile
+ mkdir -p build/xinclude || die
+ echo ${idxwidth} > build/xinclude/metis.h || die
+ echo ${realwidth} >> build/xinclude/metis.h || die
+ cat include/metis.h >> build/xinclude/metis.h || die
+ cp include/CMakeLists.txt build/xinclude || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DSHARED=yes
+ -DOPENMP=$(usex openmp)
+ )
+ cmake_src_configure
+}
+
+src_test() {
+ cd graphs || die
+ local PATH="${BUILD_DIR}"/programs/:${PATH}
+
+ ndmetis mdual.graph || die
+ mpmetis metis.mesh 2 || die
+ gpmetis test.mgraph 4 || die
+ gpmetis copter2.graph 4 || die
+ graphchk 4elt.graph || die
+}
+
+src_install() {
+ cmake_src_install
+ dodoc manual/manual.pdf
+ if use examples; then
+ docinto examples
+ dodoc -r programs graphs
+ fi
+
+ cat >> "${T}"/metis.pc <<- EOF || die
+ prefix=${EPREFIX}/usr
+ exec_prefix=\${prefix}
+ libdir=\${exec_prefix}/$(get_libdir)
+ includedir=\${prefix}/include
+
+ Name: METIS
+ Description: Software for partioning unstructured graphes and meshes
+ Version: ${PV}
+ Cflags: -I\${includedir}
+ Libs: -L\${libdir} -lmetis -lGKlib
+ EOF
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins "${T}"/metis.pc
+}