diff options
author | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2023-05-02 15:56:42 +0200 |
---|---|---|
committer | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2023-05-02 15:57:30 +0200 |
commit | 1a178de287fbeab48b20c1294f53a58e24893e6e (patch) | |
tree | 205620b868e1284c983bd03a50f22d4780f13439 /sci-libs/metis | |
parent | sci-libs/gklib: new package, add 5.1.1_p20230327 (diff) | |
download | gentoo-1a178de287fbeab48b20c1294f53a58e24893e6e.tar.gz gentoo-1a178de287fbeab48b20c1294f53a58e24893e6e.tar.bz2 gentoo-1a178de287fbeab48b20c1294f53a58e24893e6e.zip |
sci-libs/metis: add 5.2.1
Bug: https://bugs.gentoo.org/905318
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'sci-libs/metis')
-rw-r--r-- | sci-libs/metis/Manifest | 1 | ||||
-rw-r--r-- | sci-libs/metis/files/metis-5.2.1-multilib.patch | 19 | ||||
-rw-r--r-- | sci-libs/metis/files/metis-5.2.1-respect-user-flags.patch | 47 | ||||
-rw-r--r-- | sci-libs/metis/metadata.xml | 3 | ||||
-rw-r--r-- | sci-libs/metis/metis-5.2.1.ebuild | 92 |
5 files changed, 162 insertions, 0 deletions
diff --git a/sci-libs/metis/Manifest b/sci-libs/metis/Manifest index 5686a42c6fc7..39754651ea8d 100644 --- a/sci-libs/metis/Manifest +++ b/sci-libs/metis/Manifest @@ -1 +1,2 @@ DIST metis-5.1.0.tar.gz 4984968 BLAKE2B c5f8ff552fce7e7cc02740e6197c9deb5e05e8bc2e2e56cad0cba85705eec6990b511182930c8758fd16a18015f54c8a4827038039bc3c58ee41df468ea175bc SHA512 deea47749d13bd06fbeaf98a53c6c0b61603ddc17a43dae81d72c8015576f6495fd83c11b0ef68d024879ed5415c14ebdbd87ce49c181bdac680573bea8bdb25 +DIST metis-5.2.1.tar.gz 4838377 BLAKE2B 7f2bb3b4dce71cd05e25d042095c311f814d5d197b1a6ae19994b6bcbb7d948d3a96210cbce5633f39d7bb8ad7cc3f8f4977c6465ec8591934aac00ea9637c94 SHA512 69127b7a777f9ba14cf399a7122000af9d6094a5f44be600a28384cfc0495c024fb0c6eab37c4473a5763ec1077cd9f30d9bcbb3c952462f6c9ead31c6b9e790 diff --git a/sci-libs/metis/files/metis-5.2.1-multilib.patch b/sci-libs/metis/files/metis-5.2.1-multilib.patch new file mode 100644 index 000000000000..fc26f7556f12 --- /dev/null +++ b/sci-libs/metis/files/metis-5.2.1-multilib.patch @@ -0,0 +1,19 @@ +diff --git a/libmetis/CMakeLists.txt b/libmetis/CMakeLists.txt +index fc6cec6..e10a1a1 100644 +--- a/libmetis/CMakeLists.txt ++++ b/libmetis/CMakeLists.txt +@@ -6,10 +6,11 @@ file(GLOB metis_sources *.c) + + # Build libmetis. + add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources}) ++set_target_properties(metis PROPERTIES SOVERSION 0) + + if(METIS_INSTALL) + install(TARGETS metis +- LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib +- ARCHIVE DESTINATION lib) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} ++ RUNTIME DESTINATION lib${LIB_SUFFIX} ++ ARCHIVE DESTINATION lib${LIB_SUFFIX}) + endif() diff --git a/sci-libs/metis/files/metis-5.2.1-respect-user-flags.patch b/sci-libs/metis/files/metis-5.2.1-respect-user-flags.patch new file mode 100644 index 000000000000..acdf17df5090 --- /dev/null +++ b/sci-libs/metis/files/metis-5.2.1-respect-user-flags.patch @@ -0,0 +1,47 @@ +diff --git a/conf/gkbuild.cmake b/conf/gkbuild.cmake +index 0e70a8e..d005f84 100644 +--- a/conf/gkbuild.cmake ++++ b/conf/gkbuild.cmake +@@ -29,16 +29,7 @@ endif(CYGWIN) + if(CMAKE_COMPILER_IS_GNUCC) + # GCC opts. + set(GK_COPTIONS "${GK_COPTIONS} -std=c99 -fno-strict-aliasing") +-if(VALGRIND) +- set(GK_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic") +-else() +- set(GK_COPTIONS "${GK_COPTIONS} -march=native") +-endif(VALGRIND) +- if(NOT MINGW) +- set(GK_COPTIONS "${GK_COPTIONS} -fPIC") +- endif(NOT MINGW) +-# GCC warnings. +- set(GK_COPTIONS "${GK_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") ++ + elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") + # Sun insists on -xc99. + set(GK_COPTIONS "${GK_COPTIONS} -xc99") +@@ -65,24 +56,10 @@ if(OPENMP) + endif(OPENMP) + + +-# Add various definitions. +-if(GDB) +- set(GK_COPTS "${GK_COPTS} -g") +- set(GK_COPTIONS "${GK_COPTIONS} -Werror") +-else() +- set(GK_COPTS "-O3") +-endif(GDB) +- +- + if(DEBUG) +- set(GK_COPTS "-Og") + set(GK_COPTIONS "${GK_COPTIONS} -DDEBUG") + endif(DEBUG) + +-if(GPROF) +- set(GK_COPTS "-pg") +-endif(GPROF) +- + if(NOT ASSERT) + set(GK_COPTIONS "${GK_COPTIONS} -DNDEBUG") + endif(NOT ASSERT) diff --git a/sci-libs/metis/metadata.xml b/sci-libs/metis/metadata.xml index 6415e7e43b5c..3daf0ce6b84d 100644 --- a/sci-libs/metis/metadata.xml +++ b/sci-libs/metis/metadata.xml @@ -16,4 +16,7 @@ <flag name="double-precision">Use double- rather than single-precision floating-point representation</flag> <flag name="int64">Use 64- rather than 32-bit integer representation (needed for > 2^31 vertices)</flag> </use> + <upstream> + <remote-id type="github">KarypisLab/METIS</remote-id> + </upstream> </pkgmetadata> diff --git a/sci-libs/metis/metis-5.2.1.ebuild b/sci-libs/metis/metis-5.2.1.ebuild new file mode 100644 index 000000000000..a31ce9ab612c --- /dev/null +++ b/sci-libs/metis/metis-5.2.1.ebuild @@ -0,0 +1,92 @@ +# 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 ~amd64-linux" +IUSE="double-precision examples int64 openmp" + +PATCHES=( + "${FILESDIR}"/${P}-multilib.patch + "${FILESDIR}"/${P}-respect-user-flags.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}/metis + Libs: -L\${libdir} -lmetis + EOF + insinto /usr/$(get_libdir)/pkgconfig + doins "${T}"/metis.pc +} |