1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: go-mono.eclass
7 # @BLURB: Common functionality for go-mono.org apps
9 # Common functionality needed by all go-mono.org apps.
11 inherit base versionator mono
13 PRE_URI="http://mono.ximian.com/monobuild/preview/sources"
15 GIT_PN="${PN/mono-debugger/debugger}"
17 ESVN_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/svn-src/mono"
19 GO_MONO_SUB_BRANCH=${GO_MONO_SUB_BRANCH}
21 if [[ "${PV%_rc*}" != "${PV}" ]]
24 SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P}.tar.bz2 -> ${P}.tar.bz2"
25 S="${WORKDIR}/${GO_MONO_P}"
26 elif [[ "${PV%_pre*}" != "${PV}" ]]
28 GO_MONO_P="${P%_pre*}"
29 SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P}.tar.bz2 -> ${P}.tar.bz2"
30 S="${WORKDIR}/${GO_MONO_P}"
31 elif [[ "${PV}" == "9999" ]]
34 EGIT_REPO_URI="https://github.com/mono/${GIT_PN}.git"
37 elif [[ "${PV%.9999}" != "${PV}" ]]
40 EGIT_REPO_URI="https://github.com/mono/${GIT_PN}.git"
41 EGIT_BRANCH="mono-$(get_version_component_range 1)-$(get_version_component_range 2)${GO_MONO_SUB_BRANCH}"
46 SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2"
50 NO_MONO_DEPEND=( "dev-lang/mono" "dev-dotnet/libgdiplus" "dev-dotnet/gluezilla" )
52 if [[ "$(get_version_component_range 3)" != "9999" ]]
54 GO_MONO_REL_PV="$(get_version_component_range 1-2)"
57 GO_MONO_REL_PV="${PV}"
60 if ! has "${CATEGORY}/${PN}" "${NO_MONO_DEPEND[@]}"
62 RDEPEND=">=dev-lang/mono-${GO_MONO_REL_PV}"
69 # @FUNCTION: go-mono_src_unpack
72 go-mono_src_unpack() {
73 if [[ "${PV%.9999}" != "${PV}" || "${PV}" == "9999" ]]
82 # @FUNCTION: go-mono_src_prepare
84 # Runs autopatch from base.eclass, if PATCHES is set.
85 go-mono_src_prepare() {
86 if [[ "${PV%.9999}" != "${PV}" || "${PV}" == "9999" ]]
89 [[ "$EAUTOBOOTSTRAP" != "no" ]] && eautoreconf
95 # @FUNCTION: go-mono_src_configure
97 # Runs econf, disabling static libraries and dependency-tracking.
98 go-mono_src_configure() {
99 econf --disable-dependency-tracking \
104 # @FUNCTION: go-mono_src_compile
107 go-mono_src_compile() {
108 emake "$@" || die "emake failed"
111 # @ECLASS-VARIABLE: DOCS
113 # Insert path of docs you want installed. If more than one,
114 # consider using an array.
116 # @FUNCTION: go-mono_src_install
118 # Rune emake, installs common doc files, if DOCS is
119 # set, installs those. Gets rid of .la files.
120 go-mono_src_install () {
121 emake -j1 DESTDIR="${D}" "$@" install || die "install failed"
123 local commondoc=( AUTHORS ChangeLog README TODO )
124 for docfile in "${commondoc[@]}"
126 [[ -e "${docfile}" ]] && dodoc "${docfile}"
128 if [[ "${DOCS[@]}" ]]
130 dodoc "${DOCS[@]}" || die "dodoc DOCS failed"
132 find "${D}" -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed"
135 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install