* [gentoo-dev] New eclass: go-mono.eclass
@ 2009-01-16 20:03 Peter Alfredsen
2009-01-17 12:04 ` Petteri Räty
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Peter Alfredsen @ 2009-01-16 20:03 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 431 bytes --]
Below is a copy of the eclass I intend to use for all apps from
go-mono.com (AKA mono-project.com). Pretty standard fare. The affected
ebuilds are:
www-apache/mod_mono
dev-dotnet/xsp
dev-dotnet/libgdiplus
dev-dotnet/gluezilla
dev-lang/mono
dev-lang/mono-basic
dev-util/mono-debugger
dev-util/mono-tools
I'll be committing it tomorrow together with version 2.2 of the mono
stack unless anybody has a good reason not to.
--
/PA
[-- Attachment #2: go-mono.eclass --]
[-- Type: text/plain, Size: 2705 bytes --]
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/mono.eclass,v 1.9 2008/12/13 13:59:02 loki_val Exp $
# @ECLASS: go-mono.eclass
# @MAINTAINER:
# dotnet@gentoo.org
# @BLURB: Common functionality for go-mono.org apps
# @DESCRIPTION:
# Common functionality needed by all go-mono.org apps.
inherit base versionator mono
NO_MONO_DEPEND=(
"dev-lang/mono"
"dev-dotnet/libgdiplus"
"dev-dotnet/gluezilla"
)
GO_MONO_REL_PV="$(get_version_component_range 1-2)"
if ! has "${CATEGORY}/${PN}" "${NO_MONO_DEPEND[@]}"
then
RDEPEND="=dev-lang/mono-${GO_MONO_REL_PV}*"
DEPEND="${RDEPEND}"
fi
# @ECLASS-VARIABLE: PRE_URI
# @DESCRIPTION: If installing a preview, set this variable to the base
# path on ximians's servers from which to install.
DEPEND="${DEPEND}
>=dev-util/pkgconfig-0.23"
if [[ "${GO_MONO_REL_PV}" = "2.2" ]]
then
PRE_URI="http://mono.ximian.com/monobuild/preview/sources"
fi
if [[ "${PV%_rc*}" != "${PV}" ]]
then
GO_MONO_P="${P%_rc*}"
SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P} -> ${P}.tar.bz2"
S="${WORKDIR}/${GO_MONO_P}"
elif [[ "${PV%_pre*}" != "${PV}" ]]
then
GO_MONO_P="${P%_pre*}"
SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P} -> ${P}.tar.bz2"
S="${WORKDIR}/${GO_MONO_P}"
else
GO_MONO_P=${P}
SRC_URI="http://ftp.novell.com/pub/mono/sources/${PN}/${P}.tar.bz2"
fi
# @FUNCTION: go-mono_src_unpack
# @DESCRIPTION: Runs default()
go-mono_src_unpack() {
default
}
# @FUNCTION: go-mono_src_prepare
# @DESCRIPTION: Runs autopatch from base.eclass, if PATCHES is set.
go-mono_src_prepare() {
base_src_util autopatch
}
# @FUNCTION: go-mono_src_configure
# @DESCRIPTION: Runs econf, disabling static libraries and dependency-tracking.
go-mono_src_configure() {
econf --disable-dependency-tracking \
--disable-static \
"$@"
}
# @FUNCTION: go-mono_src_configure
# @DESCRIPTION: Runs default()
go-mono_src_compile() {
default
}
# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION: Insert path of docs you want installed. If more than one,
# consider using an array.
# @FUNCTION: go-mono_src_install
# @DESCRIPTION: Rune emake, installs common doc files, if DOCS is
# set, installs those. Gets rid of .la files.
go-mono_src_install () {
emake -j1 DESTDIR="${D}" install || die "install failed"
mono_multilib_comply
local COMMONDOC=( AUTHORS ChangeLog README TODO )
for docfile in "${COMMONDOC[@]}"
do
[[ -e "${docfile}" ]] && dodoc "${docfile}"
done
if [[ "${DOCS[@]}" ]]
then
dodoc "${DOCS[@]}" || die "dodoc DOCS failed"
fi
find "${D}" -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed"
}
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] New eclass: go-mono.eclass
2009-01-16 20:03 [gentoo-dev] New eclass: go-mono.eclass Peter Alfredsen
@ 2009-01-17 12:04 ` Petteri Räty
2009-01-17 12:41 ` Peter Alfredsen
2009-01-17 13:31 ` Peter Volkov
2009-01-19 3:02 ` Donnie Berkholz
2 siblings, 1 reply; 6+ messages in thread
From: Petteri Räty @ 2009-01-17 12:04 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 875 bytes --]
Peter Alfredsen wrote:
> Below is a copy of the eclass I intend to use for all apps from
> go-mono.com (AKA mono-project.com). Pretty standard fare. The affected
> ebuilds are:
> www-apache/mod_mono
> dev-dotnet/xsp
> dev-dotnet/libgdiplus
> dev-dotnet/gluezilla
> dev-lang/mono
> dev-lang/mono-basic
> dev-util/mono-debugger
> dev-util/mono-tools
>
> I'll be committing it tomorrow together with version 2.2 of the mono
> stack unless anybody has a good reason not to.
>
# @FUNCTION: go-mono_src_unpack
# @DESCRIPTION: Runs default()
go-mono_src_unpack() {
default
}
What's the point? The ones from base.eclass should be doing the same
thing as the default ones any way.
The same goes for src_compile.
local COMMONDOC=( AUTHORS ChangeLog README TODO )
I wouldn't write local variables with capital letters.
Regards,
Petteri
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] New eclass: go-mono.eclass
2009-01-17 12:04 ` Petteri Räty
@ 2009-01-17 12:41 ` Peter Alfredsen
0 siblings, 0 replies; 6+ messages in thread
From: Peter Alfredsen @ 2009-01-17 12:41 UTC (permalink / raw
To: gentoo-dev
On Sat, 17 Jan 2009 14:04:28 +0200
Petteri Räty <betelgeuse@gentoo.org> wrote:
> # @FUNCTION: go-mono_src_unpack
> # @DESCRIPTION: Runs default()
> go-mono_src_unpack() {
> default
> }
>
> What's the point? The ones from base.eclass should be doing the same
> thing as the default ones any way.
>
> The same goes for src_compile.
To make sure we know what we are getting and don't have to go searching
through more than one eclass to see exactly what a function does.
> local COMMONDOC=( AUTHORS ChangeLog README TODO )
>
> I wouldn't write local variables with capital letters.
Sure, we can paint the bikeshed green :-)
/PA
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] New eclass: go-mono.eclass
2009-01-16 20:03 [gentoo-dev] New eclass: go-mono.eclass Peter Alfredsen
2009-01-17 12:04 ` Petteri Räty
@ 2009-01-17 13:31 ` Peter Volkov
2009-01-17 13:48 ` Peter Alfredsen
2009-01-19 3:02 ` Donnie Berkholz
2 siblings, 1 reply; 6+ messages in thread
From: Peter Volkov @ 2009-01-17 13:31 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 391 bytes --]
Hi Peter.
> NO_MONO_DEPEND=(
> "dev-lang/mono"
> "dev-dotnet/libgdiplus"
> "dev-dotnet/gluezilla"
> )
Just curious. What are the reasons to use array here?
> go-mono_src_install () {
> emake -j1 DESTDIR="${D}" install || die "install failed"
Is parallel make broken everywhere? :O This is real pain since smp
systems became much more common these days.
--
Peter.
[-- Attachment #2: Эта часть сообщения подписана цифровой подписью --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] New eclass: go-mono.eclass
2009-01-17 13:31 ` Peter Volkov
@ 2009-01-17 13:48 ` Peter Alfredsen
0 siblings, 0 replies; 6+ messages in thread
From: Peter Alfredsen @ 2009-01-17 13:48 UTC (permalink / raw
To: gentoo-dev
On Sat, 17 Jan 2009 16:31:30 +0300
Peter Volkov <pva@gentoo.org> wrote:
> Hi Peter.
>
> > NO_MONO_DEPEND=(
> > "dev-lang/mono"
> > "dev-dotnet/libgdiplus"
> > "dev-dotnet/gluezilla"
> > )
>
> Just curious. What are the reasons to use array here?
I try to use arrays as often as possible, so I don't have to worry
about the shortcomings of variables. In the above example, you're
correct that there's no reason to use them over variables.
> > go-mono_src_install () {
> > emake -j1 DESTDIR="${D}" install || die "install failed"
>
> Is parallel make broken everywhere? :O This is real pain since smp
> systems became much more common these days.
It's only the install phase, and yes, it's generally broken. But that's
not really newsworthy, is it?
/PA
BTW
--jobs combined with --load-average rocks for smp systems. Total system
rebuild of 1200 packages in <12 hours.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] New eclass: go-mono.eclass
2009-01-16 20:03 [gentoo-dev] New eclass: go-mono.eclass Peter Alfredsen
2009-01-17 12:04 ` Petteri Räty
2009-01-17 13:31 ` Peter Volkov
@ 2009-01-19 3:02 ` Donnie Berkholz
2 siblings, 0 replies; 6+ messages in thread
From: Donnie Berkholz @ 2009-01-19 3:02 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]
On 21:03 Fri 16 Jan , Peter Alfredsen wrote:
> NO_MONO_DEPEND=(
> "dev-lang/mono"
> "dev-dotnet/libgdiplus"
> "dev-dotnet/gluezilla"
> )
I'm not a huge fan of having package-specific logic in eclasses. This
would be nicer to see as a variable set in the packages like
MONO_DEPEND="no". That would also get rid of the double-negative logic
below:
> if ! has "${CATEGORY}/${PN}" "${NO_MONO_DEPEND[@]}"
> then
> RDEPEND="=dev-lang/mono-${GO_MONO_REL_PV}*"
> DEPEND="${RDEPEND}"
> fi
> if [[ "${PV%_rc*}" != "${PV}" ]]
> then
> GO_MONO_P="${P%_rc*}"
> SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P} -> ${P}.tar.bz2"
> S="${WORKDIR}/${GO_MONO_P}"
> elif [[ "${PV%_pre*}" != "${PV}" ]]
> then
> GO_MONO_P="${P%_pre*}"
> SRC_URI="${PRE_URI}/${PN}/${GO_MONO_P} -> ${P}.tar.bz2"
> S="${WORKDIR}/${GO_MONO_P}"
> else
> GO_MONO_P=${P}
> SRC_URI="http://ftp.novell.com/pub/mono/sources/${PN}/${P}.tar.bz2"
> fi
How about GO_MONO_P=${P%_[a-z]*} -- doesn't that work in all cases?
--
Thanks,
Donnie
Donnie Berkholz
Developer, Gentoo Linux
Blog: http://dberkholz.wordpress.com
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-19 3:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-16 20:03 [gentoo-dev] New eclass: go-mono.eclass Peter Alfredsen
2009-01-17 12:04 ` Petteri Räty
2009-01-17 12:41 ` Peter Alfredsen
2009-01-17 13:31 ` Peter Volkov
2009-01-17 13:48 ` Peter Alfredsen
2009-01-19 3:02 ` Donnie Berkholz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox