| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sci-physics/camfr/camfr-20070717-r3.ebuild,v 1.4 2012/10/16 19:06:44 jlec Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
PYTHON_DEPEND="2"
|
| 8 |
PYTHON_USE_WITH="tk"
|
| 9 |
SUPPORT_PYTHON_ABIS="1"
|
| 10 |
|
| 11 |
inherit eutils fortran-2 distutils toolchain-funcs
|
| 12 |
|
| 13 |
DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="true"
|
| 14 |
|
| 15 |
DESCRIPTION="Full vectorial Maxwell solver based on eigenmode expansion"
|
| 16 |
HOMEPAGE="http://camfr.sourceforge.net/"
|
| 17 |
SRC_URI="mirror://sourceforge/camfr/${P}.tgz"
|
| 18 |
|
| 19 |
SLOT="0"
|
| 20 |
LICENSE="GPL-2"
|
| 21 |
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
|
| 22 |
IUSE=""
|
| 23 |
|
| 24 |
RDEPEND="
|
| 25 |
dev-libs/blitz
|
| 26 |
>=dev-libs/boost-1.48[python]
|
| 27 |
dev-python/imaging[tk]
|
| 28 |
dev-python/matplotlib
|
| 29 |
sci-libs/scipy
|
| 30 |
virtual/lapack"
|
| 31 |
DEPEND="${RDEPEND}
|
| 32 |
virtual/pkgconfig
|
| 33 |
dev-util/scons"
|
| 34 |
|
| 35 |
RESTRICT_PYTHON_ABIS="3.*"
|
| 36 |
|
| 37 |
S="${WORKDIR}/${P/-/_}"
|
| 38 |
|
| 39 |
src_prepare() {
|
| 40 |
epatch \
|
| 41 |
"${FILESDIR}"/${P}-gcc43.patch \
|
| 42 |
"${FILESDIR}"/${P}-python.patch
|
| 43 |
|
| 44 |
cp "${FILESDIR}"/machine_cfg.py.gentoo machine_cfg.py || die
|
| 45 |
python_copy_sources
|
| 46 |
|
| 47 |
preparation() {
|
| 48 |
local libfort lapack_libs lapack_libdirs
|
| 49 |
# Configure to compile against selected python version
|
| 50 |
cat <<-EOF >> machine_cfg.py
|
| 51 |
include_dirs = []
|
| 52 |
include_dirs.append("${EPREFIX}/$(python_get_includedir)")
|
| 53 |
include_dirs.append("${EPREFIX}/$(python_get_sitedir)")
|
| 54 |
EOF
|
| 55 |
local x
|
| 56 |
for x in $($(tc-getPKG_CONFIG) --libs-only-l lapack); do
|
| 57 |
lapack_libs="${lapack_libs}, \"${x#-l}\""
|
| 58 |
done
|
| 59 |
for x in $($(tc-getPKG_CONFIG) --libs-only-L lapack); do
|
| 60 |
lapack_libdirs="${lapack_libdirs}, \"${x#-L}\""
|
| 61 |
done
|
| 62 |
cat <<-EOF >> machine_cfg.py
|
| 63 |
library_dirs = [${lapack_libdirs#,}]
|
| 64 |
libs = ["boost_python-${PYTHON_ABI}-mt", "blitz"${lapack_libs}]
|
| 65 |
EOF
|
| 66 |
}
|
| 67 |
python_execute_function -s preparation
|
| 68 |
}
|
| 69 |
|
| 70 |
src_test() {
|
| 71 |
testing() {
|
| 72 |
# trick to avoid X in testing (bug #229753)
|
| 73 |
echo "backend : Agg" > matplotlibrc
|
| 74 |
PYTHONPATH=".:visualisation" "$(PYTHON)" testsuite/camfr_test.py
|
| 75 |
rm -f matplotlibrc
|
| 76 |
}
|
| 77 |
python_execute_function -s testing
|
| 78 |
}
|
| 79 |
|
| 80 |
src_install() {
|
| 81 |
distutils_src_install
|
| 82 |
dodoc docs/camfr.pdf
|
| 83 |
}
|