summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Fabbro <bicatali@gentoo.org>2011-05-23 19:35:36 +0100
committerSébastien Fabbro <bicatali@gentoo.org>2011-05-23 19:35:36 +0100
commit39fd3922f60015368e94cd3b36d55d4a05d45721 (patch)
tree7d6c9b2c0ea6dec9fba32771c90fd7c0c7c9142e /sci-libs/scotch/scotch-5.1.11-r1.ebuild
parentbumped stable atlas (diff)
downloadbicatali-39fd3922f60015368e94cd3b36d55d4a05d45721.tar.gz
bicatali-39fd3922f60015368e94cd3b36d55d4a05d45721.tar.bz2
bicatali-39fd3922f60015368e94cd3b36d55d4a05d45721.zip
added scotch for virtual/metis
Diffstat (limited to 'sci-libs/scotch/scotch-5.1.11-r1.ebuild')
-rw-r--r--sci-libs/scotch/scotch-5.1.11-r1.ebuild142
1 files changed, 142 insertions, 0 deletions
diff --git a/sci-libs/scotch/scotch-5.1.11-r1.ebuild b/sci-libs/scotch/scotch-5.1.11-r1.ebuild
new file mode 100644
index 0000000..210e339
--- /dev/null
+++ b/sci-libs/scotch/scotch-5.1.11-r1.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/scotch/scotch-5.1.11.ebuild,v 1.2 2011/03/15 16:58:35 bicatali Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs versionator alternatives-2
+
+# use esmumps version to allow linking with mumps
+MYP="${PN}_${PV}_esmumps"
+# download id on gforge changes every goddamn release
+DID=28044
+
+DESCRIPTION="Software for graph, mesh and hypergraph partitioning"
+HOMEPAGE="http://www.labri.u-bordeaux.fr/perso/pelegrin/scotch/"
+SRC_URI="http://gforge.inria.fr/frs/download.php/${DID}/${MYP}.tgz"
+
+LICENSE="CeCILL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples mpi static-libs tools"
+
+DEPEND="sys-devel/bison
+ sys-libs/zlib
+ mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MYP}/src"
+
+make_shared_lib() {
+ local libstatic=${1}
+ local soname=$(basename "${1%.a}").so.$(get_major_version)
+ shift
+ einfo "Making ${soname}"
+ ${LINK:-$(tc-getCC)} ${LDFLAGS} \
+ -shared -Wl,-soname="${soname}" \
+ -Wl,--whole-archive "${libstatic}" -Wl,--no-whole-archive \
+ "$@" -o $(dirname "${libstatic}")/"${soname}" || die "${soname} failed"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/metis-header.patch
+ epatch "${FILESDIR}"/respect-ldflags.patch
+ sed -e "s/@CFLAGS@/${CFLAGS}/" \
+ -e "s/@CC@/$(tc-getCC)/" \
+ -e "s/@AR@/$(tc-getAR)/" \
+ -e "s/@RANLIB@/$(tc-getRANLIB)/" \
+ "${FILESDIR}"/Makefile.inc.in > Makefile.inc || die
+}
+
+src_compile() {
+ emake PICFLAGS=-fPIC
+ make_shared_lib libscotch/libscotcherr.a
+ make_shared_lib libscotch/libscotcherrexit.a
+ make_shared_lib libscotch/libscotch.a -L. -lscotcherr -lz -lm -lrt
+ make_shared_lib esmumps/libesmumps.a -Llibscotch -lscotch
+ make_shared_lib libscotchmetis/libscotchmetis.a -Llibscotch -lscotch
+
+ if use mpi; then
+ emake PICFLAGS=-fPIC ptscotch
+ export LINK=mpicc
+ make_shared_lib libscotch/libptscotcherr.a
+ make_shared_lib libscotch/libptscotcherrexit.a
+ make_shared_lib libscotch/libptscotch.a -Llibscotch -lptscotcherr -lz -lm -lrt
+ make_shared_lib esmumps/libptesmumps.a -Llibscotch -lptscotch
+ make_shared_lib libscotchmetis/libptscotchparmetis.a -Llibscotch -lptscotch
+ fi
+ if use static-libs; then
+ emake clean
+ emake
+ use mpi && emake ptscotch
+ fi
+}
+
+src_install() {
+ cd ..
+ local l b m
+ for l in $(find . -name \*.so.\*); do
+ dolib.so ${l}
+ dosym $(basename ${l}) /usr/$(get_libdir)/$(basename ${l%.*})
+ done
+ use static-libs && dolib.a $(find . -name \*.a)
+
+ insinto /usr/include/scotch
+ doins include/*
+
+ cat <<-EOF > scotchmetis.pc
+ prefix=${EPREFIX}/usr
+ libdir=\${prefix}/$(get_libdir)
+ includedir=\${prefix}/include
+ Name: ptscotch
+ Description: ${DESCRIPTION}
+ Version: ${PV}
+ URL: ${HOMEPAGE}
+ Libs: -L\${libdir} -lscotchmetis -lscotcherr -lscotch
+ Private: -lm -lz -lrt
+ Cflags: -I\${includedir}/scotch
+ EOF
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins scotchmetis.pc
+ alternatives_for metis scotch 0 \
+ "/usr/$(get_libdir)/pkgconfig/metis.pc" "scotchmetis.pc"
+ cat <<-EOF > ptscotchmetis.pc
+ prefix=${EPREFIX}/usr
+ libdir=\${prefix}/$(get_libdir)
+ includedir=\${prefix}/include
+ Name: ptscotch
+ Description: ${DESCRIPTION}
+ Version: ${PV}
+ URL: ${HOMEPAGE}
+ Libs: -L\${libdir} -lptscotchmetis -lptscotcherr -lptscotch
+ Private: -lm -lz -lrt
+ Cflags: -I\${includedir}/scotch
+ EOF
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins ptscotchmetis.pc
+ alternatives_for metis-mpi scotch 0 \
+ "/usr/$(get_libdir)/pkgconfig/metis-mpi.pc" "ptscotchmetis.pc"
+
+ dodoc README.txt
+
+ if use tools; then
+ pushd bin > /dev/null
+ for b in *; do
+ newbin ${b} scotch_${b}
+ done
+ popd
+
+ pushd man/man1 > /dev/null
+ for m in *; do
+ newman ${m} scotch_${m}
+ done
+ popd > /dev/null
+ fi
+
+ use doc && dodoc doc/*.pdf
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r examples/* tgt grf
+ fi
+}