| 1 |
# Copyright 1999-2008 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/eclass/go-mono.eclass,v 1.6 2009/05/03 12:19:35 loki_val Exp $ |
| 4 |
|
| 5 |
# @ECLASS: go-mono.eclass |
| 6 |
# @MAINTAINER: |
| 7 |
# dotnet@gentoo.org |
| 8 |
# @BLURB: Common functionality for go-mono.org apps |
| 9 |
# @DESCRIPTION: |
| 10 |
# Common functionality needed by all go-mono.org apps. |
| 11 |
|
| 12 |
|
| 13 |
inherit base versionator mono |
| 14 |
|
| 15 |
|
| 16 |
PRE_URI="http://mono.ximian.com/monobuild/preview/sources" |
| 17 |
|
| 18 |
SVN_PN="${PN/mono-debugger/debugger}" |
| 19 |
|
| 20 |
ESVN_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/svn-src/mono" |
| 21 |
|
| 22 |
GO_MONO_SUB_BRANCH=${GO_MONO_SUB_BRANCH} |
| 23 |
|
| 24 |
if [[ "${PV%_rc*}" != "${PV}" ]] |
| 25 |
then |
| 26 |
GO_MONO_P="${P%_rc*}" |
| 27 |
SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P}.tar.bz2 -> ${P}.tar.bz2" |
| 28 |
S="${WORKDIR}/${GO_MONO_P}" |
| 29 |
elif [[ "${PV%_pre*}" != "${PV}" ]] |
| 30 |
then |
| 31 |
GO_MONO_P="${P%_pre*}" |
| 32 |
SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P}.tar.bz2 -> ${P}.tar.bz2" |
| 33 |
S="${WORKDIR}/${GO_MONO_P}" |
| 34 |
elif [[ "${PV}" == "9999" ]] |
| 35 |
then |
| 36 |
GO_MONO_P=${P} |
| 37 |
ESVN_REPO_URI="svn://anonsvn.mono-project.com/source/trunk/${SVN_PN}" |
| 38 |
SRC_URI="" |
| 39 |
inherit autotools subversion |
| 40 |
elif [[ "${PV%.9999}" != "${PV}" ]] |
| 41 |
then |
| 42 |
GO_MONO_P=${P} |
| 43 |
ESVN_REPO_URI="svn://anonsvn.mono-project.com/source/branches/mono-$(get_version_component_range 1)-$(get_version_component_range 2)${GO_MONO_SUB_BRANCH}/${SVN_PN}" |
| 44 |
SRC_URI="" |
| 45 |
inherit autotools subversion |
| 46 |
else |
| 47 |
GO_MONO_P=${P} |
| 48 |
SRC_URI="http://ftp.novell.com/pub/mono/sources/${PN}/${P}.tar.bz2" |
| 49 |
fi |
| 50 |
|
| 51 |
|
| 52 |
NO_MONO_DEPEND=( "dev-lang/mono" "dev-dotnet/libgdiplus" ) |
| 53 |
|
| 54 |
if [[ "$(get_version_component_range 3)" != "9999" ]] |
| 55 |
then |
| 56 |
GO_MONO_REL_PV="$(get_version_component_range 1-2)" |
| 57 |
|
| 58 |
else |
| 59 |
GO_MONO_REL_PV="${PV}" |
| 60 |
fi |
| 61 |
|
| 62 |
if ! has "${CATEGORY}/${PN}" "${NO_MONO_DEPEND[@]}" |
| 63 |
then |
| 64 |
RDEPEND="=dev-lang/mono-${GO_MONO_REL_PV}*" |
| 65 |
DEPEND="${RDEPEND}" |
| 66 |
fi |
| 67 |
|
| 68 |
DEPEND="${DEPEND} |
| 69 |
>=dev-util/pkgconfig-0.23 |
| 70 |
userland_GNU? ( >=sys-apps/findutils-4.4.0 )" |
| 71 |
|
| 72 |
# @FUNCTION: go-mono_src_unpack |
| 73 |
# @DESCRIPTION: Runs default() |
| 74 |
go-mono_src_unpack() { |
| 75 |
if [[ "${PV%.9999}" != "${PV}" || "${PV}" == "9999" ]] |
| 76 |
then |
| 77 |
default |
| 78 |
subversion_src_unpack |
| 79 |
else |
| 80 |
default |
| 81 |
fi |
| 82 |
} |
| 83 |
|
| 84 |
# @FUNCTION: go-mono_src_prepare |
| 85 |
# @DESCRIPTION: Runs autopatch from base.eclass, if PATCHES is set. |
| 86 |
go-mono_src_prepare() { |
| 87 |
if [[ "${PV%.9999}" != "${PV}" || "${PV}" == "9999" ]] |
| 88 |
then |
| 89 |
base_src_util autopatch |
| 90 |
[[ "$EAUTOBOOTSTRAP" != "no" ]] && eautoreconf |
| 91 |
else |
| 92 |
base_src_util autopatch |
| 93 |
fi |
| 94 |
} |
| 95 |
|
| 96 |
# @FUNCTION: go-mono_src_configure |
| 97 |
# @DESCRIPTION: Runs econf, disabling static libraries and dependency-tracking. |
| 98 |
go-mono_src_configure() { |
| 99 |
econf --disable-dependency-tracking \ |
| 100 |
--disable-static \ |
| 101 |
"$@" |
| 102 |
} |
| 103 |
|
| 104 |
# @FUNCTION: go-mono_src_configure |
| 105 |
# @DESCRIPTION: Runs default() |
| 106 |
go-mono_src_compile() { |
| 107 |
emake "$@" || die "emake failed" |
| 108 |
} |
| 109 |
|
| 110 |
# @ECLASS-VARIABLE: DOCS |
| 111 |
# @DESCRIPTION: Insert path of docs you want installed. If more than one, |
| 112 |
# consider using an array. |
| 113 |
|
| 114 |
# @FUNCTION: go-mono_src_install |
| 115 |
# @DESCRIPTION: Rune emake, installs common doc files, if DOCS is |
| 116 |
# set, installs those. Gets rid of .la files. |
| 117 |
go-mono_src_install () { |
| 118 |
emake -j1 DESTDIR="${D}" "$@" install || die "install failed" |
| 119 |
mono_multilib_comply |
| 120 |
local commondoc=( AUTHORS ChangeLog README TODO ) |
| 121 |
for docfile in "${commondoc[@]}" |
| 122 |
do |
| 123 |
[[ -e "${docfile}" ]] && dodoc "${docfile}" |
| 124 |
done |
| 125 |
if [[ "${DOCS[@]}" ]] |
| 126 |
then |
| 127 |
dodoc "${DOCS[@]}" || die "dodoc DOCS failed" |
| 128 |
fi |
| 129 |
find "${D}" -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed" |
| 130 |
} |
| 131 |
|
| 132 |
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install |