1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 CMAKE_MAKEFILE_GENERATOR="ninja"
10 inherit cmake-utils python-single-r1 savedconfig
12 DESCRIPTION="Extensible Simulation Package for Research on Soft matter"
13 HOMEPAGE="http://espressomd.org"
15 if [[ ${PV} = 9999 ]]; then
16 EGIT_REPO_URI="git://github.com/espressomd/espresso.git https://github.com/espressomd/espresso.git"
21 SRC_URI="mirror://nongnu/${PN}md/${P}.tar.gz"
22 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-macos"
27 IUSE="cuda doc examples +fftw +hdf5 packages python test -tk"
29 REQUIRED_USE=" python? ( ${PYTHON_REQUIRED_USE} )"
34 >dev-python/cython-0.22[${PYTHON_USEDEP}]
35 dev-python/numpy[${PYTHON_USEDEP}]
38 cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
39 fftw? ( sci-libs/fftw:3.0 )
42 hdf5? ( sci-libs/hdf5 )
43 packages? ( dev-tcltk/tcllib )
44 tk? ( >=dev-lang/tk-8.4.18-r1:0= )"
49 dev-texlive/texlive-latexextra
52 DOCS=( AUTHORS NEWS README ChangeLog )
55 use python && python-single-r1_pkg_setup
59 use cuda && cuda_src_prepare
60 cmake-utils_src_prepare
65 -DWITH_CUDA=$(usex cuda)
66 -DWITH_PYTHON=$(usex python)
67 -DWITH_TESTS=$(usex test)
68 -DWITH_H5MD=$(usex hdf5)
69 -DCMAKE_DISABLE_FIND_PACKAGE_FFTW3=$(usex !fftw)
70 -DCMAKE_DISABLE_FIND_PACKAGE_HDF5=$(usex !hdf5)
71 -DCMAKE_SKIP_RPATH=YES
73 cmake-utils_src_configure
77 cmake-utils_src_compile
78 use doc && cmake-utils_src_make doxygen
79 [[ ${PV} = 9999 ]] && use doc && cmake-utils_src_make ug dg tutorials
85 #https://github.com/espressomd/espresso/issues/733
86 #cmake-utils_src_install
87 dobin ${CMAKE_BUILD_DIR}/Espresso
88 dolib.so "${CMAKE_BUILD_DIR}"/src/core/{,*}/lib*.so
90 insinto $(python_get_sitedir)/${PN}md
91 doins -r "${CMAKE_BUILD_DIR}"/src/python/espressomd
94 insinto /usr/share/${PN}/
95 doins ${CMAKE_BUILD_DIR}/myconfig-sample.hpp
97 save_config ${CMAKE_BUILD_DIR}/src/core/myconfig-final.hpp
100 if [[ ${PV} = 9999 ]] ; then
101 newdoc ${CMAKE_BUILD_DIR}/doc/dg/dg.pdf developer_guide.pdf
102 newdoc ${CMAKE_BUILD_DIR}/doc/ug/ug.pdf user_guide.pdf
103 for i in ${CMAKE_BUILD_DIR}/doc/tutorials/*/*/[0-9]*.pdf; do
104 newdoc "${i}" "tutorial_${i##*/}"
107 newdoc "${S}"/doc/ug/ug.pdf user_guide.pdf
108 for i in "${S}"/doc/tutorials/*/*/[0-9]*.pdf; do
109 newdoc "${i}" "tutorial_${i##*/}"
112 dodoc -r ${CMAKE_BUILD_DIR}/doc/doxygen/html
115 if use examples; then
116 insinto /usr/share/${PN}/examples
120 if use packages; then
121 insinto /usr/share/${PN}/packages
128 elog "Please read and cite:"
129 elog "ESPResSo, Comput. Phys. Commun. 174(9) ,704, 2006."
130 elog "http://dx.doi.org/10.1016/j.cpc.2005.10.005"
132 elog "If you need more features, change"
133 elog "/etc/portage/savedconfig/${CATEGORY}/${PF}"
134 elog "and reemerge with USE=savedconfig"
136 elog "For a full feature list see:"
137 elog "/usr/share/${PN}/myconfig-sample.h"