1 |
commit: 9280e069ddb743ca233d2091b7ccb5a74e3c1841 |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 16 10:08:57 2021 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 16 11:43:26 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9280e069 |
7 |
|
8 |
sci-libs/metis: support USE="doc double-precision examples int64" |
9 |
|
10 |
USE flags: all of these were implemented (incorrectly in case of the two |
11 |
type switchers, I might add) for the METIS version bundled in |
12 |
sci-libs/parmetis yet not here. |
13 |
|
14 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
15 |
|
16 |
sci-libs/metis/metadata.xml | 6 ++- |
17 |
sci-libs/metis/metis-5.1.0-r5.ebuild | 79 ++++++++++++++++++++++++++++++++++++ |
18 |
2 files changed, 84 insertions(+), 1 deletion(-) |
19 |
|
20 |
diff --git a/sci-libs/metis/metadata.xml b/sci-libs/metis/metadata.xml |
21 |
index 142ea93c83a..cfc70289ed3 100644 |
22 |
--- a/sci-libs/metis/metadata.xml |
23 |
+++ b/sci-libs/metis/metadata.xml |
24 |
@@ -11,5 +11,9 @@ |
25 |
orderings for sparse matrices. The algorithms implemented in METIS are |
26 |
based on the multilevel recursive-bisection, multilevel k-way, and |
27 |
multi-constraint partitioning schemes. |
28 |
-</longdescription> |
29 |
+ </longdescription> |
30 |
+ <use> |
31 |
+ <flag name="double-precision">Use double- rather than single-precision floating-point representation</flag> |
32 |
+ <flag name="int64">Use 64- rather than 32-bit integer representation (needed for > 2^31 vertices)</flag> |
33 |
+ </use> |
34 |
</pkgmetadata> |
35 |
|
36 |
diff --git a/sci-libs/metis/metis-5.1.0-r5.ebuild b/sci-libs/metis/metis-5.1.0-r5.ebuild |
37 |
new file mode 100644 |
38 |
index 00000000000..f10620aef76 |
39 |
--- /dev/null |
40 |
+++ b/sci-libs/metis/metis-5.1.0-r5.ebuild |
41 |
@@ -0,0 +1,79 @@ |
42 |
+# Copyright 1999-2021 Gentoo Authors |
43 |
+# Distributed under the terms of the GNU General Public License v2 |
44 |
+ |
45 |
+EAPI=7 |
46 |
+ |
47 |
+inherit cmake |
48 |
+ |
49 |
+DESCRIPTION="A package for unstructured serial graph partitioning" |
50 |
+HOMEPAGE="https://www-users.cs.umn.edu/~karypis/metis/metis/" |
51 |
+SRC_URI="http://glaros.dtc.umn.edu/gkhome/fetch/sw/${PN}/${P}.tar.gz" |
52 |
+ |
53 |
+LICENSE="Apache-2.0" |
54 |
+SLOT="0" |
55 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux" |
56 |
+IUSE="doc double-precision examples int64 openmp" |
57 |
+ |
58 |
+RDEPEND="!sci-libs/parmetis" |
59 |
+ |
60 |
+PATCHES=( |
61 |
+ "${FILESDIR}"/${P}-shared-GKlib.patch |
62 |
+ "${FILESDIR}"/${P}-multilib.patch |
63 |
+ "${FILESDIR}"/${P}-remove-GKlib-O3.patch |
64 |
+) |
65 |
+ |
66 |
+src_prepare() { |
67 |
+ if use int64; then |
68 |
+ sed -i -e '/^#define IDXTYPEWIDTH/s/32/64/' include/metis.h || die |
69 |
+ fi |
70 |
+ |
71 |
+ if use double-precision; then |
72 |
+ sed -i -e '/^#define REALTYPEWIDTH/s/32/64/' include/metis.h || die |
73 |
+ fi |
74 |
+ |
75 |
+ cmake_src_prepare |
76 |
+} |
77 |
+ |
78 |
+src_configure() { |
79 |
+ local mycmakeargs=( |
80 |
+ -DGKLIB_PATH="${S}"/GKlib |
81 |
+ -DSHARED=yes |
82 |
+ -DOPENMP=$(usex openmp) |
83 |
+ ) |
84 |
+ cmake_src_configure |
85 |
+} |
86 |
+ |
87 |
+src_test() { |
88 |
+ cd graphs || die |
89 |
+ local PATH="${BUILD_DIR}"/programs/:${PATH} |
90 |
+ |
91 |
+ ndmetis mdual.graph || die |
92 |
+ mpmetis metis.mesh 2 || die |
93 |
+ gpmetis test.mgraph 4 || die |
94 |
+ gpmetis copter2.graph 4 || die |
95 |
+ graphchk 4elt.graph || die |
96 |
+} |
97 |
+ |
98 |
+src_install() { |
99 |
+ cmake_src_install |
100 |
+ use doc && dodoc manual/manual.pdf |
101 |
+ if use examples; then |
102 |
+ docinto examples |
103 |
+ dodoc -r programs graphs |
104 |
+ fi |
105 |
+ |
106 |
+ cat >> "${T}"/metis.pc <<- EOF || die |
107 |
+ prefix=${EPREFIX}/usr |
108 |
+ exec_prefix=\${prefix} |
109 |
+ libdir=\${exec_prefix}/$(get_libdir) |
110 |
+ includedir=\${prefix}/include |
111 |
+ |
112 |
+ Name: METIS |
113 |
+ Description: Software for partioning unstructured graphes and meshes |
114 |
+ Version: ${PV} |
115 |
+ Cflags: -I\${includedir}/metis |
116 |
+ Libs: -L\${libdir} -lmetis |
117 |
+ EOF |
118 |
+ insinto /usr/$(get_libdir)/pkgconfig |
119 |
+ doins "${T}"/metis.pc |
120 |
+} |