aboutsummaryrefslogtreecommitdiff
blob: 0d9e5d6e3f100de298e065fed2d2ebf32c197843 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

PYTHON_COMPAT=( python{2_6,2_7} )

inherit autotools-utils python-any-r1 savedconfig

DESCRIPTION="Extensible Simulation Package for Research on Soft matter"
HOMEPAGE="http://www.espressomd.org"

if [[ ${PV} = 9999 ]]; then
	EGIT_REPO_URI="git://git.savannah.nongnu.org/espressomd.git"
	EGIT_BRANCH="master"
	AUTOTOOLS_AUTORECONF=1
	inherit git-r3
else
	SRC_URI="mirror://nongnu/${PN}md/${P}.tar.gz"
fi

LICENSE="GPL-3"
SLOT="0"
KEYWORDS=""
IUSE="X doc examples fftw mpi packages test -tk"

REQUIRED_USE="
	${PYTHON_REQUIRED_USE}
	tk? ( X )"

RESTRICT="tk? ( test )"

RDEPEND="${PYTHON_DEPS}
	dev-lang/tcl
	fftw? ( sci-libs/fftw:3.0 )
	mpi? ( virtual/mpi )
	packages? ( dev-tcltk/tcllib )
	tk? ( >=dev-lang/tk-8.4.18-r1 )
	X? ( x11-libs/libX11 )"

DEPEND="${RDEPEND}
	doc? (
		|| ( <app-doc/doxygen-1.7.6.1[-nodot] >=app-doc/doxygen-1.7.6.1[dot] )
		dev-texlive/texlive-latexextra
		virtual/latex-base )"

DOCS=( AUTHORS NEWS README ChangeLog )

src_configure() {
	myeconfargs=(
		$(use_with fftw) \
		$(use_with mpi) \
		$(use_with tk) \
		$(use_with X x)
	)
	autotools-utils_src_configure
	restore_config myconfig.h
}

src_compile() {
	autotools-utils_src_compile
	use doc && autotools-utils_src_compile doxygen
	[[ ${PV} = 9999 ]] && use doc && autotools-utils_src_compile ug dg tutorials
}

src_install() {
	local i

	autotools-utils_src_install

	insinto /usr/share/${PN}
	doins ${AUTOTOOLS_BUILD_DIR}/myconfig-sample.h

	save_config ${AUTOTOOLS_BUILD_DIR}/src/myconfig-final.h

	if use doc; then
		if [[ ${PV} = 9999 ]] ; then
			newdoc "${AUTOTOOLS_BUILD_DIR}"/doc/dg/dg.pdf developer_guide.pdf
			newdoc "${AUTOTOOLS_BUILD_DIR}"/doc/ug/ug.pdf user_guide.pdf
			for i in "${AUTOTOOLS_BUILD_DIR}"/doc/tutorials/*/[0-9]*.pdf; do
				newdoc "${i}" "tutorial_${i##*/}"
			done
		else
			newdoc "${S}"/doc/ug/ug.pdf user_guide.pdf
			for i in "${S}"/doc/tutorials/*/[0-9]*.pdf; do
				newdoc "${i}" "tutorial_${i##*/}"
			done
		fi
		dohtml -r "${AUTOTOOLS_BUILD_DIR}"/doc/doxygen/html/*
	fi

	if use examples; then
		insinto /usr/share/${PN}/examples
		doins -r samples/*
	fi

	if use packages; then
		insinto /usr/share/${PN}/packages
		doins -r packages/*
	fi
}

pkg_postinst() {
	echo
	elog "Please read and cite:"
	elog "ESPResSo, Comput. Phys. Commun. 174(9) ,704, 2006."
	elog "http://dx.doi.org/10.1016/j.cpc.2005.10.005"
	echo
	elog "If you need more features, change"
	elog "/etc/portage/savedconfig/${CATEGORY}/${PF}"
	elog "and reemerge with USE=savedconfig"
	echo
	elog "For a full feature list see:"
	elog "/usr/share/${PN}/myconfig-sample.h"
	echo
}