dev-perl/Encode-Locale: amd64 stable wrt bug #657574
[gentoo.git] / sci-chemistry / votca-csg / votca-csg-9999.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 CMAKE_MAKEFILE_GENERATOR="ninja"
7
8 inherit bash-completion-r1 cmake-utils multilib
9
10 IUSE="doc examples extras +gromacs hdf5"
11 PDEPEND="extras? ( =sci-chemistry/${PN}apps-${PV} )"
12 if [ "${PV}" != "9999" ]; then
13         SRC_URI="https://github.com/${PN/-//}/archive/v${PV}.tar.gz -> ${P}.tar.gz
14                 doc? ( https://github.com/${PN/-//}-manual/releases/download/v${PV}/${PN}-manual-${PV}.pdf )
15                 examples? (     https://github.com/${PN/-//}-tutorials/archive/v${PV}.tar.gz -> ${PN}-tutorials-${PV}.tar.gz )"
16         KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-macos"
17         S="${WORKDIR}/${P#votca-}"
18 else
19         inherit git-r3
20         EGIT_REPO_URI="https://github.com/${PN/-//}.git"
21         KEYWORDS=""
22         PDEPEND="${PDEPEND} doc? ( =app-doc/${PN}-manual-${PV} )"
23 fi
24
25 DESCRIPTION="Votca coarse-graining engine"
26 HOMEPAGE="http://www.votca.org"
27
28 LICENSE="Apache-2.0"
29 SLOT="0"
30
31 RDEPEND="
32         =sci-libs/votca-tools-${PV}
33         gromacs? ( sci-chemistry/gromacs:= )
34         hdf5? ( sci-libs/hdf5 )
35         dev-lang/perl
36         app-shells/bash:*"
37
38 DEPEND="${RDEPEND}
39         doc? (
40                 app-doc/doxygen[dot]
41                 dev-texlive/texlive-latexextra
42                 virtual/latex-base
43                 dev-tex/pgf
44         )
45         >=app-text/txt2tags-2.5
46         virtual/pkgconfig"
47
48 DOCS=( README.md NOTICE CHANGELOG.md )
49
50 src_unpack() {
51         if [[ ${PV} != *9999 ]]; then
52                 default
53         else
54                 git-r3_src_unpack
55                 if use examples; then
56                         EGIT_REPO_URI="https://github.com/${PN/-//}-tutorials.git"
57                         EGIT_BRANCH="master"
58                         EGIT_CHECKOUT_DIR="${WORKDIR}/${PN#votca-}-tutorials"\
59                                 git-r3_src_unpack
60                 fi
61         fi
62 }
63
64 src_configure() {
65         mycmakeargs=(
66                 -DWITH_GMX=$(usex gromacs)
67                 -DWITH_H5MD=$(usex hdf5)
68                 -DWITH_RC_FILES=OFF
69                 -DLIB=$(get_libdir)
70         )
71         cmake-utils_src_configure
72 }
73
74 src_install() {
75         cmake-utils_src_install
76         newbashcomp scripts/csg-completion.bash csg_call
77         for i in "${ED}"/usr/bin/csg_*; do
78                 [[ ${i} = *csg_call ]] && continue
79                 bashcomp_alias csg_call "${i##*/}"
80         done
81         if use doc; then
82                 [[ ${PV} != *9999* ]] && dodoc "${DISTDIR}/${PN}-manual-${PV}.pdf"
83                 cmake-utils_src_make -C "${CMAKE_BUILD_DIR}" html
84                 dodoc -r "${CMAKE_BUILD_DIR}"/share/doc/html
85         fi
86         if use examples; then
87                 insinto "/usr/share/doc/${PF}/tutorials"
88                 docompress -x "/usr/share/doc/${PF}/tutorials"
89                 rm -rf "${WORKDIR}/${PN#votca-}"-tutorials*/CMake*
90                 doins -r "${WORKDIR}/${PN#votca-}"-tutorials*/*
91         fi
92 }
93
94 pkg_postinst() {
95         einfo
96         einfo "Please read and cite:"
97         einfo "VOTCA, J. Chem. Theory Comput. 5, 3211 (2009). "
98         einfo "https://dx.doi.org/10.1021/ct900369w"
99         einfo
100 }