1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: go-mono.eclass
8 # @BLURB: Common functionality for go-mono.org apps
10 # Common functionality needed by all go-mono.org apps.
12 inherit base versionator mono
14 PRE_URI="http://mono.ximian.com/monobuild/preview/sources"
16 GIT_PN="${PN/mono-debugger/debugger}"
18 ESVN_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/svn-src/mono"
20 GO_MONO_SUB_BRANCH=${GO_MONO_SUB_BRANCH}
22 if [[ "${PV%_rc*}" != "${PV}" ]]
25 SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P}.tar.bz2 -> ${P}.tar.bz2"
26 S="${WORKDIR}/${GO_MONO_P}"
27 elif [[ "${PV%_pre*}" != "${PV}" ]]
29 GO_MONO_P="${P%_pre*}"
30 SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P}.tar.bz2 -> ${P}.tar.bz2"
31 S="${WORKDIR}/${GO_MONO_P}"
32 elif [[ "${PV}" == "9999" ]]
35 EGIT_REPO_URI="http://github.com/mono/${GIT_PN}.git"
38 elif [[ "${PV%.9999}" != "${PV}" ]]
41 EGIT_REPO_URI="http://github.com/mono/${GIT_PN}.git"
42 EGIT_BRANCH="mono-$(get_version_component_range 1)-$(get_version_component_range 2)${GO_MONO_SUB_BRANCH}"
47 SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2"
51 NO_MONO_DEPEND=( "dev-lang/mono" "dev-dotnet/libgdiplus" "dev-dotnet/gluezilla" )
53 if [[ "$(get_version_component_range 3)" != "9999" ]]
55 GO_MONO_REL_PV="$(get_version_component_range 1-2)"
58 GO_MONO_REL_PV="${PV}"
61 if ! has "${CATEGORY}/${PN}" "${NO_MONO_DEPEND[@]}"
63 RDEPEND=">=dev-lang/mono-${GO_MONO_REL_PV}"
69 userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
71 # @FUNCTION: go-mono_src_unpack
74 go-mono_src_unpack() {
75 if [[ "${PV%.9999}" != "${PV}" || "${PV}" == "9999" ]]
84 # @FUNCTION: go-mono_src_prepare
86 # Runs autopatch from base.eclass, if PATCHES is set.
87 go-mono_src_prepare() {
88 if [[ "${PV%.9999}" != "${PV}" || "${PV}" == "9999" ]]
91 [[ "$EAUTOBOOTSTRAP" != "no" ]] && eautoreconf
97 # @FUNCTION: go-mono_src_configure
99 # Runs econf, disabling static libraries and dependency-tracking.
100 go-mono_src_configure() {
101 econf --disable-dependency-tracking \
106 # @FUNCTION: go-mono_src_compile
109 go-mono_src_compile() {
110 emake "$@" || die "emake failed"
113 # @ECLASS-VARIABLE: DOCS
115 # Insert path of docs you want installed. If more than one,
116 # consider using an array.
118 # @FUNCTION: go-mono_src_install
120 # Rune emake, installs common doc files, if DOCS is
121 # set, installs those. Gets rid of .la files.
122 go-mono_src_install () {
123 emake -j1 DESTDIR="${D}" "$@" install || die "install failed"
125 local commondoc=( AUTHORS ChangeLog README TODO )
126 for docfile in "${commondoc[@]}"
128 [[ -e "${docfile}" ]] && dodoc "${docfile}"
130 if [[ "${DOCS[@]}" ]]
132 dodoc "${DOCS[@]}" || die "dodoc DOCS failed"
134 find "${D}" -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed"
137 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install