Merge branch 'dev-python/derpconf'
[wtk-overlay.git] / sci-physics / sawsim / sawsim-9999.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="4"
6 PYTHON_DEPEND="2:2.6"
7 PYTHON_MODNAME="pysawsim"
8 SUPPORT_PYTHON_ABIS="1"
9 RESTRICT_PYTHON_ABIS="3.*"
10
11 inherit eutils distutils
12
13 if [[ ${PV} == "9999" ]] ; then
14         inherit git-2
15         EGIT_BRANCH="master"
16         EGIT_REPO_URI="git://tremily.us/${PN}.git http://http-git.tremily.us/${PN}.git"
17         SRC_URI=""
18 else
19         SRC_URI="http://git.tremily.us/?p=${PN}.git;a=snapshot;h=v${PV};sf=tgz"
20 fi
21
22 DESCRIPTION="sawsim force spectroscopy simulator"
23 HOMEPAGE="http://blog.tremily.us/posts/${PN}/"
24
25 LICENSE="GPL-2"
26 SLOT="0"
27 KEYWORDS="~x86 ~amd64"
28 IUSE="mpi pbs doc"
29
30 RDEPEND="dev-lang/python
31         dev-python/nose
32         dev-python/matplotlib
33         dev-python/numpy
34         sci-libs/scipy
35         mpi? ( dev-python/mpi4py )
36         pbs? ( sys-cluster/pbs-python )"
37 DEPEND="${RDEPEND}
38         dev-vcs/git
39         app-text/noweb
40         sci-libs/gsl
41         dev-libs/check
42         doc? ( dev-tex/pgf )"
43
44 src_unpack() {
45         if [[ ${PV} == "9999" ]] ; then
46                 git-2_src_unpack
47         else
48                 unpack ${A}
49         fi
50         cd "${S}"
51 }
52
53 src_prepare() {
54         notangle -Rmakefile src/sawsim.nw | sed 's/        /\t/' > Makefile
55         assert "Failed to generate Makefile"
56         distutils_src_prepare
57 }
58
59 src_compile() {
60         emake all_bin || die "couldn't build binary targets"
61         if use doc ; then
62                 emake all_doc || die "couldn't build documentation"
63         fi
64         distutils_src_compile
65 }
66
67 src_install() {
68         exeinto /usr/bin/
69         doexe bin/sawsim bin/k_model_utils bin/tension_model_utils || die "install failed"
70         dodoc README || die "dodoc failed"
71         if use doc ; then
72                 dodoc doc/sawsim.pdf || die "couldn't install manual"
73         fi
74         distutils_src_install
75 }