diff options
author | 2018-11-26 00:44:07 +0000 | |
---|---|---|
committer | 2018-11-26 00:44:07 +0000 | |
commit | 46cb122d6dd503555b0f2d08a1144b4ce8634071 (patch) | |
tree | a92cad0ddd3f8686c335f7651c1994ecf9dda088 | |
parent | 2018-11-26 00:04:45 UTC (diff) | |
parent | sci-libs/mumps: update metis dependencies (again) (diff) | |
download | gentoo-46cb122d6dd503555b0f2d08a1144b4ce8634071.tar.gz gentoo-46cb122d6dd503555b0f2d08a1144b4ce8634071.tar.bz2 gentoo-46cb122d6dd503555b0f2d08a1144b4ce8634071.zip |
Merge updates from master
-rw-r--r-- | mail-filter/amavisd-new/amavisd-new-2.11.1-r2.ebuild (renamed from mail-filter/amavisd-new/amavisd-new-2.11.1.ebuild) | 26 | ||||
-rw-r--r-- | mail-filter/amavisd-new/files/amavis-mc.initd-r1 | 18 | ||||
-rw-r--r-- | mail-filter/amavisd-new/files/amavisd-snmp-subagent-zmq.initd | 26 | ||||
-rw-r--r-- | mail-filter/amavisd-new/files/amavisd-snmp-subagent.initd | 25 | ||||
-rw-r--r-- | profiles/package.mask | 4 | ||||
-rw-r--r-- | sci-libs/mumps/Manifest | 1 | ||||
-rw-r--r-- | sci-libs/mumps/mumps-4.10.0-r1.ebuild | 184 | ||||
-rw-r--r-- | sci-libs/mumps/mumps-5.1.2.ebuild | 4 | ||||
-rw-r--r-- | sci-libs/parmetis/Manifest | 2 | ||||
-rw-r--r-- | sci-libs/parmetis/metadata.xml | 26 | ||||
-rw-r--r-- | sci-libs/parmetis/parmetis-4.0.3.ebuild | 151 |
11 files changed, 256 insertions, 211 deletions
diff --git a/mail-filter/amavisd-new/amavisd-new-2.11.1.ebuild b/mail-filter/amavisd-new/amavisd-new-2.11.1-r2.ebuild index 3b4205bb331d..1767bdefc4a6 100644 --- a/mail-filter/amavisd-new/amavisd-new-2.11.1.ebuild +++ b/mail-filter/amavisd-new/amavisd-new-2.11.1-r2.ebuild @@ -7,7 +7,6 @@ inherit systemd user DESCRIPTION="High-performance interface between the MTA and content checkers" HOMEPAGE="https://gitlab.com/amavis/amavis" SRC_URI="${HOMEPAGE}/-/archive/${P}/amavis-${P}.tar.gz" -PORTAGE_DOHTML_WARN_ON_SKIPPED_FILES=yes LICENSE="GPL-2 BSD-2" SLOT="0" @@ -91,10 +90,14 @@ src_prepare() { eapply -p0 amavisd-new-qmqpqq.patch fi + # We need to fix the daemon_user and daemon_group in amavis-mc even + # though we're going to run it in the foreground, because it calls + # "drop_priv" unconditionally and will crash if its user/group + # doesn't exist. sed -i \ -e '/daemon/s/vscan/amavis/' \ -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \ - "${S}/amavisd.conf" "${S}/amavis-mc" || die "missing conf file" + "${S}/amavisd.conf" "${S}/amavis-mc" || die "missing conf file" if ! use dkim ; then sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \ @@ -116,26 +119,31 @@ src_prepare() { } src_install() { - dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \ - amavisd-signer amavisd-status + dosbin amavisd{,-agent,-nanny,-release,-signer,-status} dobin p0f-analyzer.pl amavisd-submit if use snmp ; then dosbin amavisd-snmp-subagent - use zmq && dosbin amavisd-snmp-subagent-zmq + newinitd "${FILESDIR}/amavisd-snmp-subagent.initd" \ + amavisd-snmp-subagent dodoc AMAVIS-MIB.txt - newinitd "${FILESDIR}"/amavisd-snmp.initd amavisd-snmp + + if use zmq ; then + dosbin amavisd-snmp-subagent-zmq + newinitd "${FILESDIR}/amavisd-snmp-subagent-zmq.initd" \ + amavisd-snmp-subagent-zmq + fi fi if use zmq ; then dosbin amavis-services amavis-mc - newinitd "${FILESDIR}"/amavis-mc.initd amavis-mc + newinitd "${FILESDIR}/amavis-mc.initd-r1" amavis-mc fi if use ldap ; then dodir /etc/openldap/schema insinto /etc/openldap/schema - newins LDAP.schema ${PN}.schema || die + newins LDAP.schema "${PN}.schema" fi # The config file should be root:amavis so that the amavis user can @@ -157,7 +165,7 @@ src_install() { newinitd "${FILESDIR}/amavisd.initd-r2" amavisd - systemd_dounit "${FILESDIR}/amavisd.service-r1" + systemd_newunit "${FILESDIR}/amavisd.service-r1" amavisd.service dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \ amavisd.conf-default amavisd-custom.conf diff --git a/mail-filter/amavisd-new/files/amavis-mc.initd-r1 b/mail-filter/amavisd-new/files/amavis-mc.initd-r1 new file mode 100644 index 000000000000..6343d4255c4c --- /dev/null +++ b/mail-filter/amavisd-new/files/amavis-mc.initd-r1 @@ -0,0 +1,18 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/sbin/amavis-mc" +pidfile="/run/${RC_SVCNAME}.pid" + +# Let OpenRC background this, because otherwise it will write its PID +# file after dropping privileges which presents a security issue when +# we go to `kill` the thing as root. +command_args="-f" +command_background="true" +command_user="amavis:amavis" + +depend() { + use logger + before amavisd-new snmpd +} diff --git a/mail-filter/amavisd-new/files/amavisd-snmp-subagent-zmq.initd b/mail-filter/amavisd-new/files/amavisd-snmp-subagent-zmq.initd new file mode 100644 index 000000000000..7482a3f1d20b --- /dev/null +++ b/mail-filter/amavisd-new/files/amavisd-snmp-subagent-zmq.initd @@ -0,0 +1,26 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/sbin/amavisd-snmp-subagent-zmq" +pidfile="/run/${RC_SVCNAME}.pid" + +# The RELEASE_NOTES say "it is safe to run it as root, although +# perhaps not necessary." I'm not in a position to test, but I bet +# it's safe to run this as amavis:amavis. Since the program itself +# doesn't have the ability to drop privileges, we'd have to let OpenRC +# do that; and in that case, the easiest way to deal with the PID file +# is to let OpenRC handle that, too. +# +# Thus as a means of future-proofing, we run $command in the +# foreground, and let OpenRC background it and write a PID file. So +# if somebody wants to try command_user="amavis:amavis" here, it might +# just work. +command_args="-f" +command_background="true" + +depend() { + use logger + before amavisd-new snmpd + need amavis-mc +} diff --git a/mail-filter/amavisd-new/files/amavisd-snmp-subagent.initd b/mail-filter/amavisd-new/files/amavisd-snmp-subagent.initd new file mode 100644 index 000000000000..84784b619e2b --- /dev/null +++ b/mail-filter/amavisd-new/files/amavisd-snmp-subagent.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/sbin/amavisd-snmp-subagent" +pidfile="/run/${RC_SVCNAME}.pid" + +# The RELEASE_NOTES say "it is safe to run it as root, although +# perhaps not necessary." I'm not in a position to test, but I bet +# it's safe to run this as amavis:amavis. Since the program itself +# doesn't have the ability to drop privileges, we'd have to let OpenRC +# do that; and in that case, the easiest way to deal with the PID file +# is to let OpenRC handle that, too. +# +# Thus as a means of future-proofing, we run $command in the +# foreground, and let OpenRC background it and write a PID file. So +# if somebody wants to try command_user="amavis:amavis" here, it might +# just work. +command_args="-f" +command_background="true" + +depend() { + use logger + before amavisd-new snmpd +} diff --git a/profiles/package.mask b/profiles/package.mask index 3d93f6860504..c3b2dddb000f 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -983,10 +983,6 @@ app-eselect/eselect-lua # experimental features and accept a more unstable release. www-plugins/chrome-binary-plugins:unstable -# Justin Lecher <jlec@gentoo.org> (14 Oct 2013) -# Seems to break all deps - API change? ->=sci-libs/metis-5 - # Michael Weber <xmw@gentoo.org> (17 Jul 2013) # Upstream next versions >=sys-boot/raspberrypi-firmware-1_pre diff --git a/sci-libs/mumps/Manifest b/sci-libs/mumps/Manifest index 973e51a036a0..bc722d542673 100644 --- a/sci-libs/mumps/Manifest +++ b/sci-libs/mumps/Manifest @@ -1,2 +1 @@ -DIST MUMPS_4.10.0.tar.gz 2481516 BLAKE2B ddd3f28bf9627806e9bb5597adc94e2b8f504adf220a8a64ea50630edbde75358bd97e91a53ebd341132a34db5d7248d32a892a060bdf8f205c8aac3b9c88722 SHA512 348df048618ea2086fbe805a90f2e31f57e0db4aa6f4843a0e3c7142bac80fe45e54768e65921657c970bc286b59c2bca91e5006ed8000678f26ba2efe2bfda8 DIST MUMPS_5.1.2.tar.gz 3351215 BLAKE2B 1c77c2a217c101245a9a96a59be6b9bfd67ceffa603d807b5a7173026c5c33e2c4de78c14833d7b7f0a90130b9ebc0ac9c7d4ebfbf881d0bd2210a542887c239 SHA512 38a63b14a8df835be68b5fa310b39aa1815799220d56c176e4005797800959e9e08c9a6bf11d308ab82ea40b6f34d36072cebe7c1de39e0c314eb138b93f1b74 diff --git a/sci-libs/mumps/mumps-4.10.0-r1.ebuild b/sci-libs/mumps/mumps-4.10.0-r1.ebuild deleted file mode 100644 index d57d19e1d13d..000000000000 --- a/sci-libs/mumps/mumps-4.10.0-r1.ebuild +++ /dev/null @@ -1,184 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 - -inherit eutils toolchain-funcs flag-o-matic versionator fortran-2 multilib - -MYP=MUMPS_${PV} - -DESCRIPTION="MUltifrontal Massively Parallel sparse direct matrix Solver" -HOMEPAGE="http://mumps.enseeiht.fr/" -SRC_URI="${HOMEPAGE}${MYP}.tar.gz" - -LICENSE="public-domain" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" -IUSE="doc examples metis mpi +scotch static-libs" - -RDEPEND=" - virtual/blas - metis? ( || ( sci-libs/metis <sci-libs/parmetis-4 ) - mpi? ( <sci-libs/parmetis-4 ) ) - scotch? ( <sci-libs/scotch-6[mpi=] ) - mpi? ( sci-libs/scalapack )" - -DEPEND="${RDEPEND} - virtual/pkgconfig" - -S="${WORKDIR}/${MYP}" - -static_to_shared() { - local libstatic=${1}; shift - local libname=$(basename ${libstatic%.a}) - local soname=${libname}$(get_libname $(get_version_component_range 1-2)) - local libdir=$(dirname ${libstatic}) - - einfo "Making ${soname} from ${libstatic}" - if [[ ${CHOST} == *-darwin* ]] ; then - ${LINK:-$(tc-getCC)} ${LDFLAGS} \ - -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \ - -Wl,-all_load -Wl,${libstatic} \ - "$@" -o ${libdir}/${soname} || die "${soname} failed" - else - ${LINK:-$(tc-getCC)} ${LDFLAGS} \ - -shared -Wl,-soname=${soname} \ - -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \ - "$@" -o ${libdir}/${soname} || die "${soname} failed" - [[ $(get_version_component_count) -gt 1 ]] && \ - ln -s ${soname} ${libdir}/${libname}$(get_libname $(get_major_version)) - ln -s ${soname} ${libdir}/${libname}$(get_libname) - fi -} - -src_prepare() { - sed -e "s:^\(CC\s*=\).*:\1$(tc-getCC):" \ - -e "s:^\(FC\s*=\).*:\1$(tc-getFC):" \ - -e "s:^\(FL\s*=\).*:\1$(tc-getFC):" \ - -e "s:^\(AR\s*=\).*:\1$(tc-getAR) cr :" \ - -e "s:^\(RANLIB\s*=\).*:\1$(tc-getRANLIB):" \ - -e "s:^\(LIBBLAS\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs blas):" \ - -e "s:^\(INCPAR\s*=\).*:\1:" \ - -e 's:^\(LIBPAR\s*=\).*:\1$(SCALAP):' \ - -e "s:^\(OPTF\s*=\).*:\1${FFLAGS} -DALLOW_NON_INIT \$(PIC):" \ - -e "s:^\(OPTC\s*=\).*:\1${CFLAGS} \$(PIC):" \ - -e "s:^\(OPTL\s*=\).*:\1${LDFLAGS}:" \ - Make.inc/Makefile.inc.generic > Makefile.inc || die - # fixed a missing copy of libseq to libdir -} - -src_configure() { - LIBADD="$($(tc-getPKG_CONFIG) --libs blas) -Llib -lpord" - local ord="-Dpord" - if use metis && use mpi; then - sed -i \ - -e "s:#\s*\(LMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs parmetis):" \ - -e "s:#\s*\(IMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --cflags parmetis):" \ - Makefile.inc || die - LIBADD="${LIBADD} $($(tc-getPKG_CONFIG) --libs parmetis)" - ord="${ord} -Dparmetis" - elif use metis; then - sed -i \ - -e "s:#\s*\(LMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs metis):" \ - -e "s:#\s*\(IMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --cflags metis):" \ - Makefile.inc || die - LIBADD="${LIBADD} $($(tc-getPKG_CONFIG) --libs metis)" - ord="${ord} -Dmetis" - fi - if use scotch && use mpi; then - sed -i \ - -e "s:#\s*\(LSCOTCH\s*=\).*:\1-lptesmumps -lptscotch -lptscotcherr:" \ - -e "s:#\s*\(ISCOTCH\s*=\).*:\1-I${EROOT}usr/include/scotch:" \ - Makefile.inc || die - LIBADD="${LIBADD} -lptesmumps -lptscotch -lptscotcherr" - ord="${ord} -Dptscotch" - elif use scotch; then - sed -i \ - -e "s:#\s*\(LSCOTCH\s*=\).*:\1-lesmumps -lscotch -lscotcherr:" \ - -e "s:#\s*\(ISCOTCH\s*=\).*:\1-I${EROOT}usr/include/scotch:" \ - Makefile.inc || die - LIBADD="${LIBADD} -lesmumps -lscotch -lscotcherr" - ord="${ord} -Dscotch" - fi - if use mpi; then - sed -i \ - -e "s:^\(CC\s*=\).*:\1mpicc:" \ - -e "s:^\(FC\s*=\).*:\1mpif90:" \ - -e "s:^\(FL\s*=\).*:\1mpif90:" \ - -e "s:^\(SCALAP\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs scalapack):" \ - Makefile.inc || die - export LINK=mpif90 - LIBADD="${LIBADD} $($(tc-getPKG_CONFIG) --libs scalapack)" - else - sed -i \ - -e 's:-Llibseq:-L$(topdir)/libseq:' \ - -e 's:PAR):SEQ):g' \ - -e "s:^\(SCALAP\s*=\).*:\1:" \ - -e 's:^LIBSEQNEEDED =:LIBSEQNEEDED = libseqneeded:g' \ - Makefile.inc || die - export LINK="$(tc-getFC)" - fi - sed -i -e "s:^\s*\(ORDERINGSF\s*=\).*:\1 ${ord}:" Makefile.inc || die -} - -src_compile() { - # Workaround #462602 - export FAKEROOTKEY=1 - - # -j1 because of static archive race - emake -j1 alllib PIC="-fPIC" - if ! use mpi; then - #$(tc-getAR) crs lib/libmumps_common.a libseq/*.o || die - LIBADD+=" -Llibseq -lmpiseq" - static_to_shared libseq/libmpiseq.a - fi - static_to_shared lib/libpord.a ${LIBADD} - static_to_shared lib/libmumps_common.a ${LIBADD} - - local i - for i in c d s z; do - static_to_shared lib/lib${i}mumps.a -Llib -lmumps_common ${LIBADD} - done - if use static-libs; then - emake clean - emake -j1 alllib - fi -} - -src_test() { - emake all - local dotest - if use mpi; then - dotest="mpirun -np 2" - else - export LD_LIBRARY_PATH="${S}/libseq:${LD_LIBRARY_PATH}" - fi - cd examples - ${dotest} ./ssimpletest < input_simpletest_real || die - ${dotest} ./dsimpletest < input_simpletest_real || die - ${dotest} ./csimpletest < input_simpletest_cmplx || die - ${dotest} ./zsimpletest < input_simpletest_cmplx || die - einfo "The solutions should be close to (1,2,3,4,5)" - ${dotest} ./c_example || die - einfo "The solution should be close to (1,2)" - make clean -} - -src_install() { - dolib.so lib/lib*$(get_libname)* - use static-libs && dolib.a lib/lib*.a - insinto /usr - doins -r include - if ! use mpi; then - dolib.so libseq/lib*$(get_libname)* - insinto /usr/include/mpiseq - doins libseq/*.h - use static-libs && dolib.a libseq/libmpiseq.a - fi - dodoc README ChangeLog VERSION - use doc && dodoc doc/*.pdf - if use examples; then - insinto /usr/share/doc/${PF} - doins -r examples - fi -} diff --git a/sci-libs/mumps/mumps-5.1.2.ebuild b/sci-libs/mumps/mumps-5.1.2.ebuild index 725e1ab60e64..e5251550f248 100644 --- a/sci-libs/mumps/mumps-5.1.2.ebuild +++ b/sci-libs/mumps/mumps-5.1.2.ebuild @@ -18,8 +18,8 @@ IUSE="doc examples metis mpi +scotch static-libs" RDEPEND=" virtual/blas - metis? ( || ( sci-libs/metis <sci-libs/parmetis-4 ) - mpi? ( <sci-libs/parmetis-4 ) ) + metis? ( || ( >=sci-libs/metis-5 >=sci-libs/parmetis-4 ) + mpi? ( >=sci-libs/parmetis-4 ) ) scotch? ( <sci-libs/scotch-6[mpi=] ) mpi? ( sci-libs/scalapack )" diff --git a/sci-libs/parmetis/Manifest b/sci-libs/parmetis/Manifest index d0d2f3741930..a8a041b62e72 100644 --- a/sci-libs/parmetis/Manifest +++ b/sci-libs/parmetis/Manifest @@ -1 +1,3 @@ DIST ParMetis-3.2.0.tar.gz 5291841 BLAKE2B f18b5144f2814a83c3a0b945b1bdbad812cce204e61e762498a98f380d33d79bdb6a4c58f25ebbd44401c7f76edbac602899d4fe8c05ca92f22a91d98f8f7607 SHA512 be7e5affa6ed687c7e8cbef51c5f4838e6302aa7632796f337ed079f15361569d77aa73fc61b876b5c9973e974575571fd1e3e6c73505480b1ecdb7cf801a0d0 +DIST metis-5.1.0.tar.gz 4984968 BLAKE2B c5f8ff552fce7e7cc02740e6197c9deb5e05e8bc2e2e56cad0cba85705eec6990b511182930c8758fd16a18015f54c8a4827038039bc3c58ee41df468ea175bc SHA512 deea47749d13bd06fbeaf98a53c6c0b61603ddc17a43dae81d72c8015576f6495fd83c11b0ef68d024879ed5415c14ebdbd87ce49c181bdac680573bea8bdb25 +DIST parmetis-4.0.3.tar.gz 5567670 BLAKE2B 69a44ea8e50d8fd78046a342807b994220d03da3ab1695533d92772b1840302917a7d5d6f9eb020d9ff8ab7e5372bff0386d6354b662f58495b74f8f596c45f9 SHA512 454a91921ca35c981df11c9846a11963ff8fd8407a25179453af33f8fe69493f6dd7f2a0b8feed9a7d3f121e45b715749dd7a94873eaac2bae4cad1e535ca132 diff --git a/sci-libs/parmetis/metadata.xml b/sci-libs/parmetis/metadata.xml index 744c4ff57d0c..cf1b66e81268 100644 --- a/sci-libs/parmetis/metadata.xml +++ b/sci-libs/parmetis/metadata.xml @@ -1,16 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <maintainer type="project"> - <email>sci@gentoo.org</email> - <name>Gentoo Science Project</name> - </maintainer> - <longdescription lang="en"> - ParMETIS is an MPI-based parallel library that implements a variety - of algorithms for partitioning unstructured graphs and for computing - fill-reducing orderings of sparse matrices. ParMETIS extends the - functionality provided by METIS and includes routines that are - especially suited for parallel AMR computations and large scale - numerical simulations. + <maintainer type="project"> + <email>sci@gentoo.org</email> + <name>Gentoo Science Project</name> + </maintainer> + <longdescription lang="en"> +ParMETIS is an MPI-based parallel library that implements a variety +of algorithms for partitioning unstructured graphs and for computing +fill-reducing orderings of sparse matrices. ParMETIS extends the +functionality provided by METIS and includes routines that are +especially suited for parallel AMR computations and large scale +numerical simulations. </longdescription> + <use> + <flag name="int64">Build the 64 bits integer library (needed for > 2^31 vertices)</flag> + <flag name="double-precision">Floating-point operation done as double precision</flag> + </use> </pkgmetadata> diff --git a/sci-libs/parmetis/parmetis-4.0.3.ebuild b/sci-libs/parmetis/parmetis-4.0.3.ebuild new file mode 100644 index 000000000000..71ee81fcbc9d --- /dev/null +++ b/sci-libs/parmetis/parmetis-4.0.3.ebuild @@ -0,0 +1,151 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils cmake-utils toolchain-funcs + +# Check metis version bundled in parmetis tar ball +# by diff of metis and parmetis tar ball +METISPV=5.1.0 +METISP=metis-${METISPV} + +DESCRIPTION="Parallel (MPI) unstructured graph partitioning library" +HOMEPAGE="http://www-users.cs.umn.edu/~karypis/metis/parmetis/" +SRC_URI=" + http://glaros.dtc.umn.edu/gkhome/fetch/sw/${PN}/${P}.tar.gz + doc? ( http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/${METISP}.tar.gz ) + examples? ( http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/${METISP}.tar.gz )" + +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +LICENSE="free-noncomm" +IUSE="doc double-precision examples int64 mpi openmp pcre static-libs" + +DEPEND="mpi? ( virtual/mpi )" +RDEPEND="${DEPEND} + !<sci-libs/metis-5" + +pkg_setup() { + if use openmp; then + if [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp; then + ewarn "You are using gcc but openmp is not available" + die "Need an OpenMP capable compiler" + fi + fi +} + +src_prepare() { + # libdir love + sed -i \ + -e '/DESTINATION/s/lib/lib${LIB_SUFFIX}/g' \ + libparmetis/CMakeLists.txt metis/libmetis/CMakeLists.txt || die + # set metis as separate shared lib + sed -i \ + -e 's/METIS_LIB/ParMETIS_LIB/g' \ + metis/libmetis/CMakeLists.txt || die + sed -i \ + -e '/programs/d' \ + CMakeLists.txt metis/CMakeLists.txt || die + use static-libs && mkdir "${WORKDIR}/${PN}_static" + + if use mpi; then + export CC=mpicc CXX=mpicxx + else + sed -i \ + -e '/add_subdirectory(include/d' \ + -e '/add_subdirectory(libparmetis/d' \ + CMakeLists.txt || die + + fi + + use int64 && \ + sed -i -e '/IDXTYPEWIDTH/s/32/64/' metis/include/metis.h + + use double-precision && \ + sed -i -e '/REALTYPEWIDTH/s/32/64/' metis/include/metis.h +} + +src_configure() { + parmetis_configure() { + local mycmakeargs=( + -DGKLIB_PATH="${S}/metis/GKlib" + -DMETIS_PATH="${S}/metis" + -DGKRAND=ON + -DMETIS_INSTALL=ON + $(cmake-utils_use openmp OPENMP) + $(cmake-utils_use pcre PCRE) + $@ + ) + cmake-utils_src_configure + } + parmetis_configure -DSHARED=ON + use static-libs && \ + sed -i -e '/fPIC/d' metis/GKlib/GKlibSystem.cmake && \ + BUILD_DIR="${WORKDIR}/${PN}_static" parmetis_configure +} + +src_compile() { + cmake-utils_src_compile + use static-libs && \ + BUILD_DIR="${WORKDIR}/${PN}_static" cmake-utils_src_compile +} + +src_install() { + cmake-utils_src_install + use static-libs && \ + BUILD_DIR="${WORKDIR}/${PN}_static" cmake-utils_src_install + insinto /usr/include + doins metis/include/metis.h + + newdoc metis/Changelog Changelog.metis} + use doc && dodoc "${WORKDIR}/${METISP}"/manual/manual.pdf + if use examples; then + insinto /usr/share/doc/${PF}/examples/metis + doins "${WORKDIR}/${METISP}"/{programs,graphs}/* + fi + # alternative stuff + cat > metis.pc <<-EOF + prefix=${EPREFIX}/usr + libdir=\${prefix}/$(get_libdir) + includedir=\${prefix}/include + Name: metis + Description: Unstructured graph partitioning library + Version: ${METISPV} + URL: ${HOMEPAGE/parmetis/metis} + Libs: -L\${libdir} -lmetis + Cflags: -I\${includedir}/metis + EOF + insinto /usr/$(get_libdir)/pkgconfig + doins metis.pc + # change if scotch is actually an alternative to metis + #alternatives_for metis metis 0 \ + # /usr/$(get_libdir)/pkgconfig/metis.pc refmetis.pc + + if use mpi; then + dodoc Changelog + use doc && dodoc manual/manual.pdf + if use examples; then + insinto /usr/share/doc/${PF}/examples/${PN} + doins {programs,Graphs}/* + fi + # alternative stuff + 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 + # change if scotch is actually an alternative to parmetis + #alternatives_for metis-mpi ${PN} 0 \ + # /usr/$(get_libdir)/pkgconfig/metis-mpi.pc ${PN}.pc + fi +} |