summaryrefslogtreecommitdiff
blob: cede29ad96909892dbba2935e3ba0e51f7d68c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-libs/metis/metis-5.0_pre2-r1.ebuild,v 1.6 2011/08/09 21:29:39 bicatali Exp $

EAPI=4

inherit autotools eutils fortran-2

MY_PV=${PV/_/}

DESCRIPTION="A package for unstructured serial graph partitioning"
HOMEPAGE="http://www-users.cs.umn.edu/~karypis/metis/metis/index.html"
SRC_URI="http://glaros.dtc.umn.edu/gkhome/fetch/sw/${PN}/OLD/${PN}-${MY_PV}.tar.gz"

SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos"
LICENSE="free-noncomm"
IUSE="int64 openmp pcre threads"

DEPEND="
	virtual/fortran
	pcre? ( dev-libs/libpcre )"
RDEPEND="${DEPEND}
	!sci-libs/parmetis"

S="${WORKDIR}/metis-${MY_PV}"

pkg_setup() {
	if use openmp; then
		tc-has-openmp || \
			die "Please select an OPENMP capable compiler"
		FORTRAN_NEED_OPENMP=1
	fi
	fortran-2_pkg_setup
}

src_prepare() {
	epatch "${FILESDIR}"/${P}-autotools.patch
	if use int64; then
		sed -e 's/\(#define IDXTYPEWIDTH\).*32/\1 64/' \
			-i include/metis.h \
			|| die "sed for int64 failed"
	fi
	if use threads; then
		sed -e 's/\(#define HAVE_THREADLOCALSTORAGE\).*0/\1 1/' \
			-i include/metis.h \
			|| die "sed for threads failed"
	fi
	eautoreconf
}

src_configure() {
	econf \
		$(use_enable pcre) \
		$(use_enable openmp)
}