public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
@ 2012-03-23  8:15 Alexis Ballier
  2012-03-23 15:58 ` Mike Gilbert
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Alexis Ballier @ 2012-03-23  8:15 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

Hi,

Oasis [1] is becoming the de factor standard for ocaml packages. I've
been bored of copy/pasting always the same code from ebuilds to ebuilds
and thus decided to write an eclass simplifying everything.

Attached: said eclass, a diff of a random dev-ml package I've
converted to illustrate and said random ebuild now.

Comments welcome,

Alexis.

[1] http://oasis.forge.ocamlcore.org/

[-- Attachment #2: oasis.eclass --]
[-- Type: application/octet-stream, Size: 2724 bytes --]

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: oasis.eclass
# @MAINTAINER: 
# ml@gentoo.org
# @AUTHOR:
# Original Author: Alexis Ballier <aballier@gentoo.org>
# @BLURB: Provides common ebuild phases for oasis-based packages.
# @DESCRIPTION:
# Provides common ebuild phases for oasis-based packages.
# Most of these packages will just have to inherit the eclass, set their
# dependencies and the DOCS variable for base.eclass to install it and be done.
#
# It inherits multilib, findlib and base eclasses.
# Ebuilds using oasis.eclass must be EAPI>=2.
#

inherit multilib findlib base

case ${EAPI:-0} in
	0|1) die "You need at least EAPI-2 to use oasis.eclass";;
esac

IUSE="debug +ocamlopt"

DEPEND=">=dev-lang/ocaml-3.12[ocamlopt?]"
DEPEND="${RDEPEND}"

# @FUNCTION: oasis_use_enable
# @USAGE: < useflag > < variable >
# @DESCRIPTION:
# A use_enable-like function for oasis configure variables.
# Outputs variable=(true|false), whether useflag is enabled or not.
# Typical usage: $(oasis_use_enable ocamlopt is_native) as an oasis configure
# argument.
oasis_use_enable() {
	    echo "--override $2 `use $1 && echo \"true\" || echo \"false\"`"
}

# @FUNCTION: oasis_src_configure
# @DESCRIPTION:
# src_configure phase shared by oasis-based ebuilds.
# Extra arguments may be passed via oasis_configure_opts.
oasis_src_configure() {
	ocaml setup.ml -configure \
		--prefix usr \
		--libdir /usr/$(get_libdir) \
		--docdir /usr/share/doc/${PF}/html \
		--destdir "${D}" \
		$(oasis_use_enable debug debug) \
		$(oasis_use_enable ocamlopt is_native) \
		${oasis_configure_opts} \
		|| die
}

# @FUNCTION: oasis_src_compile_no_doc
# @DESCRIPTION:
# Build the package.
# oasis_src_compile will build documentation if doc is in IUSE and enabled, this
# function may be used to override this behavior.
oasis_src_compile_no_doc() {
	ocaml setup.ml -build || die
}

# @FUNCTION: oasis_src_compile
# @DESCRIPTION:
# Builds an oasis-based package.
# Will build documentation if doc is in IUSE and enabled.
oasis_src_compile() {
	oasis_src_compile_no_doc
	if has doc ${IUSE} && use doc; then
		ocaml setup.ml -doc || die
	fi
}

# @FUNCTION: oasis_src_test
# @DESCRIPTION:
# Runs the testsuite of an oasis-based package.
oasis_src_test() {
	 LD_LIBRARY_PATH="${S}/_build/lib" ocaml setup.ml -test || die
}

# @FUNCTION: oasis_src_install
# @DESCRIPTION:
# Installs an oasis-based package.
# It calls base_src_install_docs, so will install documentation declared in the
# DOCS variable.
oasis_src_install() {
	findlib_src_preinst
	ocaml setup.ml -install || die
	base_src_install_docs
}

EXPORT_FUNCTIONS src_configure src_compile src_test src_install

[-- Attachment #3: fieldslib.diff --]
[-- Type: text/x-patch, Size: 1277 bytes --]

Index: fieldslib-0.1.2.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-ml/fieldslib/fieldslib-0.1.2.ebuild,v
retrieving revision 1.1
diff -u -B -r1.1 fieldslib-0.1.2.ebuild
--- fieldslib-0.1.2.ebuild	25 Jun 2011 18:56:36 -0000	1.1
+++ fieldslib-0.1.2.ebuild	23 Mar 2012 08:13:31 -0000
@@ -3,7 +3,7 @@
 # $Header: /var/cvsroot/gentoo-x86/dev-ml/fieldslib/fieldslib-0.1.2.ebuild,v 1.1 2011/06/25 18:56:36 aballier Exp $
 
 EAPI="2"
-inherit findlib multilib
+inherit oasis
 
 DESCRIPTION="Folding over record fields"
 HOMEPAGE="http://www.janestreet.com/ocaml"
@@ -12,28 +12,9 @@
 LICENSE="LGPL-2.1-linking-exception"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="debug +ocamlopt"
+IUSE=""
 
-DEPEND=">=dev-lang/ocaml-3.12[ocamlopt?]
-	>=dev-ml/type-conv-2.3.0"
+DEPEND=">=dev-ml/type-conv-2.3.0"
 RDEPEND="${DEPEND}"
 
-oasis_use_enable() {
-	echo "--override $2 `use $1 && echo \"true\" || echo \"false\"`"
-}
-
-src_configure() {
-	./configure --prefix usr \
-		--libdir /usr/$(get_libdir) \
-		--destdir "${D}" \
-		$(oasis_use_enable debug debug) \
-		$(oasis_use_enable ocamlopt is_native) \
-		|| die
-}
-
-src_install() {
-	findlib_src_install
-
-	# install documentation
-	dodoc README || die
-}
+DOCS=( "README" )

[-- Attachment #4: fieldslib-0.1.2.ebuild --]
[-- Type: application/octet-stream, Size: 533 bytes --]

# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ml/fieldslib/fieldslib-0.1.2.ebuild,v 1.1 2011/06/25 18:56:36 aballier Exp $

EAPI="2"
inherit oasis

DESCRIPTION="Folding over record fields"
HOMEPAGE="http://www.janestreet.com/ocaml"
SRC_URI="http://www.janestreet.com/ocaml/${P}.tar.gz"

LICENSE="LGPL-2.1-linking-exception"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND=">=dev-ml/type-conv-2.3.0"
RDEPEND="${DEPEND}"

DOCS=( "README" )

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23  8:15 [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages Alexis Ballier
@ 2012-03-23 15:58 ` Mike Gilbert
  2012-03-23 16:02   ` Ciaran McCreesh
  2012-03-23 18:03   ` Alexis Ballier
  2012-03-23 20:11 ` Sergei Trofimovich
  2012-03-24 13:44 ` Alexis Ballier
  2 siblings, 2 replies; 24+ messages in thread
From: Mike Gilbert @ 2012-03-23 15:58 UTC (permalink / raw
  To: gentoo-dev

On Fri, Mar 23, 2012 at 4:15 AM, Alexis Ballier <aballier@gentoo.org> wrote:

> DEPEND=">=dev-lang/ocaml-3.12[ocamlopt?]"
> DEPEND="${RDEPEND}"

That looks like a typo.

> oasis_src_compile() {
> 	oasis_src_compile_no_doc
> 	if has doc ${IUSE} && use doc; then
> 		ocaml setup.ml -doc || die
> 	fi
> }

This should probably call use_if_iuse from eutils.eclass, which
handles IUSE="[+-]doc".



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 15:58 ` Mike Gilbert
@ 2012-03-23 16:02   ` Ciaran McCreesh
  2012-03-23 16:14     ` Ian Stakenvicius
  2012-03-23 16:50     ` Mike Gilbert
  2012-03-23 18:03   ` Alexis Ballier
  1 sibling, 2 replies; 24+ messages in thread
From: Ciaran McCreesh @ 2012-03-23 16:02 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

On Fri, 23 Mar 2012 11:58:47 -0400
Mike Gilbert <floppym@gentoo.org> wrote:
> > oasis_src_compile() {
> > 	oasis_src_compile_no_doc
> > 	if has doc ${IUSE} && use doc; then
> > 		ocaml setup.ml -doc || die
> > 	fi
> > }
> 
> This should probably call use_if_iuse from eutils.eclass, which
> handles IUSE="[+-]doc".

Actually, neither way works. The spec says:

    Global variables must only contain invariant values
    (see~\ref{sec:metadata-invariance}). If a global variable's value is
    invariant, it may have the value that would be generated at any
    given point in the build sequence.

So you can't rely upon IUSE having the "merged" value in an eclass.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:02   ` Ciaran McCreesh
@ 2012-03-23 16:14     ` Ian Stakenvicius
  2012-03-23 16:19       ` Ciaran McCreesh
  2012-03-23 16:50     ` Mike Gilbert
  1 sibling, 1 reply; 24+ messages in thread
From: Ian Stakenvicius @ 2012-03-23 16:14 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 23/03/12 12:02 PM, Ciaran McCreesh wrote:
> On Fri, 23 Mar 2012 11:58:47 -0400 Mike Gilbert
> <floppym@gentoo.org> wrote:
>>> oasis_src_compile() { oasis_src_compile_no_doc if has doc
>>> ${IUSE} && use doc; then ocaml setup.ml -doc || die fi }
>> 
>> This should probably call use_if_iuse from eutils.eclass, which 
>> handles IUSE="[+-]doc".
> 
> Actually, neither way works. The spec says:
> 
> Global variables must only contain invariant values 
> (see~\ref{sec:metadata-invariance}). If a global variable's value
> is invariant, it may have the value that would be generated at any 
> given point in the build sequence.
> 
> So you can't rely upon IUSE having the "merged" value in an
> eclass.
> 

I don't know if I follow this one or not.  When inheriting an eclass,
all entities within the eclass get merged into the ebuild.  As long as
there aren't any special conditional tricks being used to assign to
global variables like IUSE, it would still be invariant wouldn't it?

I think 'any point in the build sequence' is still
post-eclass-inheritance isn't it?



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iF4EAREIAAYFAk9soW8ACgkQAJxUfCtlWe1UJQEAuTQriXmsu6YKcpeADGusTNdZ
k8Vr99LdEFwyXicZHMsBAN2bo95GvLvdrpVEj8h1THQ4HMZDvPRx0o/yrWzjxGNZ
=+e3P
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:14     ` Ian Stakenvicius
@ 2012-03-23 16:19       ` Ciaran McCreesh
  2012-03-23 16:32         ` Ian Stakenvicius
  0 siblings, 1 reply; 24+ messages in thread
From: Ciaran McCreesh @ 2012-03-23 16:19 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 23 Mar 2012 12:14:39 -0400
Ian Stakenvicius <axs@gentoo.org> wrote:
> I don't know if I follow this one or not.  When inheriting an eclass,
> all entities within the eclass get merged into the ebuild.  As long as
> there aren't any special conditional tricks being used to assign to
> global variables like IUSE, it would still be invariant wouldn't it?

The point is that the merging might be done inside the package manager
(not in bash code) on the IUSE metadata variable, and the changes don't
have to be reflected in the IUSE environment variable inside the ebuild.

> I think 'any point in the build sequence' is still
> post-eclass-inheritance isn't it?

Nope. It's also at any point during the sourcing of any of the files.

- -- 
Ciaran McCreesh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEARECAAYFAk9sonsACgkQ96zL6DUtXhEtFgCgyT/pUwKQIaLE8e28U8P0uS3x
HF8An1frYjZvoNYSC2/Qs1eNzqdlgVzT
=Kj+k
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:19       ` Ciaran McCreesh
@ 2012-03-23 16:32         ` Ian Stakenvicius
  2012-03-23 16:36           ` Ian Stakenvicius
  2012-03-23 16:43           ` Ciaran McCreesh
  0 siblings, 2 replies; 24+ messages in thread
From: Ian Stakenvicius @ 2012-03-23 16:32 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 23/03/12 12:19 PM, Ciaran McCreesh wrote:
> On Fri, 23 Mar 2012 12:14:39 -0400 Ian Stakenvicius
> <axs@gentoo.org> wrote:
>> I don't know if I follow this one or not.  When inheriting an
>> eclass, all entities within the eclass get merged into the
>> ebuild.  As long as there aren't any special conditional tricks
>> being used to assign to global variables like IUSE, it would
>> still be invariant wouldn't it?
> 
> The point is that the merging might be done inside the package
> manager (not in bash code) on the IUSE metadata variable, and the
> changes don't have to be reflected in the IUSE environment variable
> inside the ebuild.

If that was the case, then eclasses could no longer append deps to
(R)DEPEND, either .....?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iF4EAREIAAYFAk9spYUACgkQAJxUfCtlWe1g+QEA1NAl+nl3zCEOmTIjCN1271r7
pCJNO7aCW/iNrXniCQUA/3j1xktcStPmQL8rXPRLSjMy+vqBsclWQwFHa4eytu6B
=g3Dz
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:32         ` Ian Stakenvicius
@ 2012-03-23 16:36           ` Ian Stakenvicius
  2012-03-23 16:43           ` Ciaran McCreesh
  1 sibling, 0 replies; 24+ messages in thread
From: Ian Stakenvicius @ 2012-03-23 16:36 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 23/03/12 12:32 PM, Ian Stakenvicius wrote:
> On 23/03/12 12:19 PM, Ciaran McCreesh wrote:
>> On Fri, 23 Mar 2012 12:14:39 -0400 Ian Stakenvicius 
>> <axs@gentoo.org> wrote:
>>> I don't know if I follow this one or not.  When inheriting an 
>>> eclass, all entities within the eclass get merged into the 
>>> ebuild.  As long as there aren't any special conditional
>>> tricks being used to assign to global variables like IUSE, it
>>> would still be invariant wouldn't it?
> 
>> The point is that the merging might be done inside the package 
>> manager (not in bash code) on the IUSE metadata variable, and
>> the changes don't have to be reflected in the IUSE environment
>> variable inside the ebuild.
> 
> If that was the case, then eclasses could no longer append deps to 
> (R)DEPEND, either .....?

Err, nvm..  i think i'm following the difference now.  functions like
has_version and so forth don't actually work on the value(s) of
*DEPEND themselves, so in the case of (R)DEPEND it wouldn't matter of
the package manager didn't expose the merge.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iF4EAREIAAYFAk9spp8ACgkQAJxUfCtlWe1a2wD/YsHDM1hYik+d46fJ90yckI/U
OKr1ThK6hhJTbjmqGpgBAMekpXzx8NFIPerRPm037FgWQiCuUPDezAhmj8S73EPV
=CNHZ
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:32         ` Ian Stakenvicius
  2012-03-23 16:36           ` Ian Stakenvicius
@ 2012-03-23 16:43           ` Ciaran McCreesh
  1 sibling, 0 replies; 24+ messages in thread
From: Ciaran McCreesh @ 2012-03-23 16:43 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 23 Mar 2012 12:32:05 -0400
Ian Stakenvicius <axs@gentoo.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> On 23/03/12 12:19 PM, Ciaran McCreesh wrote:
> > On Fri, 23 Mar 2012 12:14:39 -0400 Ian Stakenvicius
> > <axs@gentoo.org> wrote:
> >> I don't know if I follow this one or not.  When inheriting an
> >> eclass, all entities within the eclass get merged into the
> >> ebuild.  As long as there aren't any special conditional tricks
> >> being used to assign to global variables like IUSE, it would
> >> still be invariant wouldn't it?
> > 
> > The point is that the merging might be done inside the package
> > manager (not in bash code) on the IUSE metadata variable, and the
> > changes don't have to be reflected in the IUSE environment variable
> > inside the ebuild.
> 
> If that was the case, then eclasses could no longer append deps to
> (R)DEPEND, either .....?

The point of the wording is to allow an eclass to do this:

    DEPEND="cat/two"

and an ebuild do this:

    DEPEND="cat/one"

and to have the package manager, but not necessarily bash code, know
that there are two dependencies. It also makes the annoying RDEPEND
value behaviour that older EAPIs specify possible.

So yes, you *could* argue that with the way it's worded, this in an
eclass isn't guaranteed to work:

    DEPEND="cat/three"
    DEPEND="${DEPEND} cat/four"

What the wording is supposed to imply is that if some bash code looks
at DEPEND, it could contain either "cat/three cat/four", or "cat/one
cat/three cat/four". If the first DEPEND looked like the second, then
it would also be allowed to contain "cat/one cat/one cat/three
cat/four" and similar.

What this really comes down to is that bash is the wrong tool for doing
what we're doing, and that we can't have this work "the way we want
it to" since bash doesn't provide the interfaces we need to get it
to work, and every time we try to be clever it breaks on newer bash
releases...

- -- 
Ciaran McCreesh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEARECAAYFAk9sqFAACgkQ96zL6DUtXhFnJgCfZhLF1/UsWWCARATI2I9pg5Yv
ATMAn3exnOUWgwQTt84v1q9mE9ptOiH/
=BQ2n
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:02   ` Ciaran McCreesh
  2012-03-23 16:14     ` Ian Stakenvicius
@ 2012-03-23 16:50     ` Mike Gilbert
  2012-03-23 16:52       ` Ciaran McCreesh
  2012-03-23 17:09       ` Alexandre Rostovtsev
  1 sibling, 2 replies; 24+ messages in thread
From: Mike Gilbert @ 2012-03-23 16:50 UTC (permalink / raw
  To: gentoo-dev

On Fri, Mar 23, 2012 at 12:02 PM, Ciaran McCreesh
<ciaran.mccreesh@googlemail.com> wrote:
> On Fri, 23 Mar 2012 11:58:47 -0400
> Mike Gilbert <floppym@gentoo.org> wrote:
>> > oasis_src_compile() {
>> >     oasis_src_compile_no_doc
>> >     if has doc ${IUSE} && use doc; then
>> >             ocaml setup.ml -doc || die
>> >     fi
>> > }
>>
>> This should probably call use_if_iuse from eutils.eclass, which
>> handles IUSE="[+-]doc".
>
> Actually, neither way works. The spec says:
>
>    Global variables must only contain invariant values
>    (see~\ref{sec:metadata-invariance}). If a global variable's value is
>    invariant, it may have the value that would be generated at any
>    given point in the build sequence.
>
> So you can't rely upon IUSE having the "merged" value in an eclass.
>

use_if_iuse is called from functions in several eclasses already in
the tree. See chromium, kde4-base, qt4-build, and toolchain.

Are all of these usages incorrect? Do you have an alternate solution?



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:50     ` Mike Gilbert
@ 2012-03-23 16:52       ` Ciaran McCreesh
  2012-03-23 16:58         ` Mike Gilbert
  2012-03-23 17:09       ` Alexandre Rostovtsev
  1 sibling, 1 reply; 24+ messages in thread
From: Ciaran McCreesh @ 2012-03-23 16:52 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

On Fri, 23 Mar 2012 12:50:51 -0400
Mike Gilbert <floppym@gentoo.org> wrote:
> use_if_iuse is called from functions in several eclasses already in
> the tree. See chromium, kde4-base, qt4-build, and toolchain.
> 
> Are all of these usages incorrect? Do you have an alternate solution?

We had this discussion when the function was introduced, and we were
assured that it "would only be used correctly"... The correct solution
is probably to have ebuilds define a variable like "OASIS_WANT_DOCS",
and to use that.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:52       ` Ciaran McCreesh
@ 2012-03-23 16:58         ` Mike Gilbert
  0 siblings, 0 replies; 24+ messages in thread
From: Mike Gilbert @ 2012-03-23 16:58 UTC (permalink / raw
  To: gentoo-dev

On Fri, Mar 23, 2012 at 12:52 PM, Ciaran McCreesh
<ciaran.mccreesh@googlemail.com> wrote:
> On Fri, 23 Mar 2012 12:50:51 -0400
> Mike Gilbert <floppym@gentoo.org> wrote:
>> use_if_iuse is called from functions in several eclasses already in
>> the tree. See chromium, kde4-base, qt4-build, and toolchain.
>>
>> Are all of these usages incorrect? Do you have an alternate solution?
>
> We had this discussion when the function was introduced, and we were
> assured that it "would only be used correctly"... The correct solution
> is probably to have ebuilds define a variable like "OASIS_WANT_DOCS",
> and to use that.
>

Ah. I'll have to review chromium.eclass then; I think I'm doing it wrong.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 16:50     ` Mike Gilbert
  2012-03-23 16:52       ` Ciaran McCreesh
@ 2012-03-23 17:09       ` Alexandre Rostovtsev
  2012-03-23 18:17         ` Alec Warner
  1 sibling, 1 reply; 24+ messages in thread
From: Alexandre Rostovtsev @ 2012-03-23 17:09 UTC (permalink / raw
  To: gentoo-dev

On Fri, 2012-03-23 at 12:50 -0400, Mike Gilbert wrote:
> On Fri, Mar 23, 2012 at 12:02 PM, Ciaran McCreesh
> <ciaran.mccreesh@googlemail.com> wrote:
> > On Fri, 23 Mar 2012 11:58:47 -0400
> > Mike Gilbert <floppym@gentoo.org> wrote:
> >> > oasis_src_compile() {
> >> >     oasis_src_compile_no_doc
> >> >     if has doc ${IUSE} && use doc; then
> >> >             ocaml setup.ml -doc || die
> >> >     fi
> >> > }
> >>
> >> This should probably call use_if_iuse from eutils.eclass, which
> >> handles IUSE="[+-]doc".
> >
> > Actually, neither way works. The spec says:
> >
> >    Global variables must only contain invariant values
> >    (see~\ref{sec:metadata-invariance}). If a global variable's value is
> >    invariant, it may have the value that would be generated at any
> >    given point in the build sequence.
> >
> > So you can't rely upon IUSE having the "merged" value in an eclass.
> >
> 
> use_if_iuse is called from functions in several eclasses already in
> the tree. See chromium, kde4-base, qt4-build, and toolchain.
> 
> Are all of these usages incorrect? Do you have an alternate solution?

By my count, there are already at least 19 eclasses in the tree that
access an ebuild's IUSE from eclass code (autotools-utils, chromium,
clutter, db, enlightenment, eutils, gnome2, gnome-python-common,
java-ant-2, java-pkg-2, java-utils-2, mozconfig-3, pam, qt4-build,
qt4-r2, ruby-ng, xfconf, x-modular, and xorg-2).

-Alexandre Rostovtsev.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 15:58 ` Mike Gilbert
  2012-03-23 16:02   ` Ciaran McCreesh
@ 2012-03-23 18:03   ` Alexis Ballier
  1 sibling, 0 replies; 24+ messages in thread
From: Alexis Ballier @ 2012-03-23 18:03 UTC (permalink / raw
  To: gentoo-dev

On Fri, 23 Mar 2012 11:58:47 -0400
Mike Gilbert <floppym@gentoo.org> wrote:

> On Fri, Mar 23, 2012 at 4:15 AM, Alexis Ballier <aballier@gentoo.org>
> wrote:
> 
> > DEPEND=">=dev-lang/ocaml-3.12[ocamlopt?]"
> > DEPEND="${RDEPEND}"
> 
> That looks like a typo.

yes, thanks for spotting

> 
> > oasis_src_compile() {
> > 	oasis_src_compile_no_doc
> > 	if has doc ${IUSE} && use doc; then
> > 		ocaml setup.ml -doc || die
> > 	fi
> > }
> 
> This should probably call use_if_iuse from eutils.eclass, which
> handles IUSE="[+-]doc".
> 

hmm, actually, I like the idea of something like OASIS_WANT_DOCS as
suggested by Ciaran, this sounds simpler and, as a side effect, will
allow me to kill the useless oasis_src_compile_no_doc function.

I'll come back with something like this and post an update, most likely
next week, pilling up the reviews :=)


A.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 17:09       ` Alexandre Rostovtsev
@ 2012-03-23 18:17         ` Alec Warner
  2012-03-23 19:37           ` Ciaran McCreesh
  0 siblings, 1 reply; 24+ messages in thread
From: Alec Warner @ 2012-03-23 18:17 UTC (permalink / raw
  To: gentoo-dev

On Fri, Mar 23, 2012 at 10:09 AM, Alexandre Rostovtsev
<tetromino@gentoo.org> wrote:
> On Fri, 2012-03-23 at 12:50 -0400, Mike Gilbert wrote:
>> On Fri, Mar 23, 2012 at 12:02 PM, Ciaran McCreesh
>> <ciaran.mccreesh@googlemail.com> wrote:
>> > On Fri, 23 Mar 2012 11:58:47 -0400
>> > Mike Gilbert <floppym@gentoo.org> wrote:
>> >> > oasis_src_compile() {
>> >> >     oasis_src_compile_no_doc
>> >> >     if has doc ${IUSE} && use doc; then
>> >> >             ocaml setup.ml -doc || die
>> >> >     fi
>> >> > }
>> >>
>> >> This should probably call use_if_iuse from eutils.eclass, which
>> >> handles IUSE="[+-]doc".
>> >
>> > Actually, neither way works. The spec says:
>> >
>> >    Global variables must only contain invariant values
>> >    (see~\ref{sec:metadata-invariance}). If a global variable's value is
>> >    invariant, it may have the value that would be generated at any
>> >    given point in the build sequence.
>> >
>> > So you can't rely upon IUSE having the "merged" value in an eclass.
>> >
>>
>> use_if_iuse is called from functions in several eclasses already in
>> the tree. See chromium, kde4-base, qt4-build, and toolchain.
>>
>> Are all of these usages incorrect? Do you have an alternate solution?
>
> By my count, there are already at least 19 eclasses in the tree that
> access an ebuild's IUSE from eclass code (autotools-utils, chromium,
> clutter, db, enlightenment, eutils, gnome2, gnome-python-common,
> java-ant-2, java-pkg-2, java-utils-2, mozconfig-3, pam, qt4-build,
> qt4-r2, ruby-ng, xfconf, x-modular, and xorg-2).

Lets be clear here. Just because we do already it does not mean we
should keep doing it.

In general if you are going to say 'this usage is wrong' then you need
some kind of tool to detect and report on it; otherwise a subset of
developers will get it wrong. Don't make it easy to do the wrong
thing, make it easy to do the right thing.

-A

>
> -Alexandre Rostovtsev.
>
>



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 18:17         ` Alec Warner
@ 2012-03-23 19:37           ` Ciaran McCreesh
  2012-03-23 20:11             ` Alec Warner
  0 siblings, 1 reply; 24+ messages in thread
From: Ciaran McCreesh @ 2012-03-23 19:37 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]

On Fri, 23 Mar 2012 11:17:56 -0700
Alec Warner <antarus@gentoo.org> wrote:
> In general if you are going to say 'this usage is wrong' then you need
> some kind of tool to detect and report on it; otherwise a subset of
> developers will get it wrong. Don't make it easy to do the wrong
> thing, make it easy to do the right thing.

Unfortunately, bash really doesn't make it easy for us to do that sort
of thing...

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 19:37           ` Ciaran McCreesh
@ 2012-03-23 20:11             ` Alec Warner
  0 siblings, 0 replies; 24+ messages in thread
From: Alec Warner @ 2012-03-23 20:11 UTC (permalink / raw
  To: gentoo-dev

On Fri, Mar 23, 2012 at 12:37 PM, Ciaran McCreesh
<ciaran.mccreesh@googlemail.com> wrote:
> On Fri, 23 Mar 2012 11:17:56 -0700
> Alec Warner <antarus@gentoo.org> wrote:
>> In general if you are going to say 'this usage is wrong' then you need
>> some kind of tool to detect and report on it; otherwise a subset of
>> developers will get it wrong. Don't make it easy to do the wrong
>> thing, make it easy to do the right thing.
>
> Unfortunately, bash really doesn't make it easy for us to do that sort
> of thing...

Its more a dig at the process in general. I don't aim for perfect
checks (bash is hard, waa waa waa), but arguably we don't even try to
write checks that are non-perfect. We end up in situations where one
guy does it the wrong way, then people copy and paste his code and
suddenly it is done wrong in dozens of places. QA warnings help let
people know that what they are doing is likely wrong.

-A

>
> --
> Ciaran McCreesh



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23  8:15 [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages Alexis Ballier
  2012-03-23 15:58 ` Mike Gilbert
@ 2012-03-23 20:11 ` Sergei Trofimovich
  2012-03-23 20:24   ` Alexis Ballier
  2012-03-24 13:44 ` Alexis Ballier
  2 siblings, 1 reply; 24+ messages in thread
From: Sergei Trofimovich @ 2012-03-23 20:11 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

> oasis_use_enable() {
> 	    echo "--override $2 `use $1 && echo \"true\" || echo \"false\"`"
> }

Mike added 'usex' to 'eutils.eclass' recently, so you might like to use it:
(UNTESTED)
    echo "--override $2 $(usex $1 true false)"

> oasis_src_configure() {
> 	ocaml setup.ml -configure \
> 		--prefix usr \
> 		--libdir /usr/$(get_libdir) \
> 		--docdir /usr/share/doc/${PF}/html \
> 		--destdir "${D}" \
> 		$(oasis_use_enable debug debug) \
> 		$(oasis_use_enable ocamlopt is_native) \
> 		${oasis_configure_opts} \
> 		|| die
> }

This configure hates gentoo prefix, right?
Might worth sprinkling "${EPREFIX}" around absolute paths.

-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 20:11 ` Sergei Trofimovich
@ 2012-03-23 20:24   ` Alexis Ballier
  2012-03-23 20:41     ` Alexandre Rostovtsev
  2012-03-23 21:02     ` Sergei Trofimovich
  0 siblings, 2 replies; 24+ messages in thread
From: Alexis Ballier @ 2012-03-23 20:24 UTC (permalink / raw
  To: gentoo-dev

On Fri, 23 Mar 2012 23:11:46 +0300
Sergei Trofimovich <slyfox@gentoo.org> wrote:

> > oasis_use_enable() {
> > 	    echo "--override $2 `use $1 && echo \"true\" || echo
> > \"false\"`" }
> 
> Mike added 'usex' to 'eutils.eclass' recently, so you might like to
> use it: (UNTESTED)
>     echo "--override $2 $(usex $1 true false)"

it needs to print the quotes too, so this wont work

i've been copy/pasting this 'formula' for a while, i know it works, and
i am too lazy to try to rewrite it to usex just for the sake of it :)

> 
> > oasis_src_configure() {
> > 	ocaml setup.ml -configure \
> > 		--prefix usr \
> > 		--libdir /usr/$(get_libdir) \
> > 		--docdir /usr/share/doc/${PF}/html \
> > 		--destdir "${D}" \
> > 		$(oasis_use_enable debug debug) \
> > 		$(oasis_use_enable ocamlopt is_native) \
> > 		${oasis_configure_opts} \
> > 		|| die
> > }
> 
> This configure hates gentoo prefix, right?
> Might worth sprinkling "${EPREFIX}" around absolute paths.
> 

well, this will imply not supporting eapi2, i can live with it

however, usually, i prefer prefix guys that need it to submit patches
instead of trying to support it without testing.
eg: shall it be EPREFIX before the /usr's ? shall it be ED instead of
D? both ?

A.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 20:24   ` Alexis Ballier
@ 2012-03-23 20:41     ` Alexandre Rostovtsev
  2012-03-24 13:22       ` Alexis Ballier
  2012-03-23 21:02     ` Sergei Trofimovich
  1 sibling, 1 reply; 24+ messages in thread
From: Alexandre Rostovtsev @ 2012-03-23 20:41 UTC (permalink / raw
  To: gentoo-dev

On Fri, Mar 23, 2012 at 4:24 PM, Alexis Ballier <aballier@gentoo.org> wrote:
> On Fri, 23 Mar 2012 23:11:46 +0300
> Sergei Trofimovich <slyfox@gentoo.org> wrote:
>> > oasis_src_configure() {
>> >     ocaml setup.ml -configure \
>> >             --prefix usr \
>> >             --libdir /usr/$(get_libdir) \
>> >             --docdir /usr/share/doc/${PF}/html \
>> >             --destdir "${D}" \
>> >             $(oasis_use_enable debug debug) \
>> >             $(oasis_use_enable ocamlopt is_native) \
>> >             ${oasis_configure_opts} \
>> >             || die
>> > }
>>
>> This configure hates gentoo prefix, right?
>> Might worth sprinkling "${EPREFIX}" around absolute paths.
>>
>
> well, this will imply not supporting eapi2, i can live with it
>
> however, usually, i prefer prefix guys that need it to submit patches
> instead of trying to support it without testing.
> eg: shall it be EPREFIX before the /usr's?shall it be ED instead of
> D? both ?

You probably want ${EPREFIX} in front of every /usr passed to
configure. In other words,

ocaml setup.ml -configure --prefix "${EPREFIX}/usr" --libdir
"${EPREFIX}/blah" --docdir "${EPREFIX}/blargh" etc.

However, destdir should still be ${D}. That way, in src_install() your
package's files will be copied to ${D}${EPREFIX}/usr, better known as
${ED}usr.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 20:24   ` Alexis Ballier
  2012-03-23 20:41     ` Alexandre Rostovtsev
@ 2012-03-23 21:02     ` Sergei Trofimovich
  2012-03-24 13:19       ` Alexis Ballier
  1 sibling, 1 reply; 24+ messages in thread
From: Sergei Trofimovich @ 2012-03-23 21:02 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]

> > > oasis_use_enable() {
> > > 	    echo "--override $2 `use $1 && echo \"true\" || echo
> > > \"false\"`" }
> > 
> > Mike added 'usex' to 'eutils.eclass' recently, so you might like to
> > use it: (UNTESTED)
> >     echo "--override $2 $(usex $1 true false)"
> 
> it needs to print the quotes too, so this wont work

It did not print quotes:
    $ echo "--override bazz `true && echo \"true\" || echo \"false\"`"
    --override bazz true

> i've been copy/pasting this 'formula' for a while, i know it works, and
> i am too lazy to try to rewrite it to usex just for the sake of it :)
> 
> > 
> > > oasis_src_configure() {
> > > 	ocaml setup.ml -configure \
> > > 		--prefix usr \
> > > 		--libdir /usr/$(get_libdir) \
> > > 		--docdir /usr/share/doc/${PF}/html \
> > > 		--destdir "${D}" \
> > > 		$(oasis_use_enable debug debug) \
> > > 		$(oasis_use_enable ocamlopt is_native) \
> > > 		${oasis_configure_opts} \
> > > 		|| die
> > > }
> > 
> > This configure hates gentoo prefix, right?
> > Might worth sprinkling "${EPREFIX}" around absolute paths.
> > 
> 
> well, this will imply not supporting eapi2, i can live with it

Oh, right. I've forgot. Each EPREFIX usage would require something like the following:

    has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=

> however, usually, i prefer prefix guys that need it to submit patches
> instead of trying to support it without testing.

Yeah, sounds fair.

-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 21:02     ` Sergei Trofimovich
@ 2012-03-24 13:19       ` Alexis Ballier
  0 siblings, 0 replies; 24+ messages in thread
From: Alexis Ballier @ 2012-03-24 13:19 UTC (permalink / raw
  To: gentoo-dev

On Sat, 24 Mar 2012 00:02:15 +0300
Sergei Trofimovich <slyfox@gentoo.org> wrote:

> > > > oasis_use_enable() {
> > > > 	    echo "--override $2 `use $1 && echo \"true\" || echo
> > > > \"false\"`" }
> > > 
> > > Mike added 'usex' to 'eutils.eclass' recently, so you might like
> > > to use it: (UNTESTED)
> > >     echo "--override $2 $(usex $1 true false)"
> > 
> > it needs to print the quotes too, so this wont work
> 
> It did not print quotes:
>     $ echo "--override bazz `true && echo \"true\" || echo \"false\"`"
>     --override bazz true

hu? i was pretty sure it was needed, but you're right, i dont know what
i was trying to achieve with those escaped quotes in there... i've
converted to your usex formula which is equivalent, thanks :)


> > > This configure hates gentoo prefix, right?
> > > Might worth sprinkling "${EPREFIX}" around absolute paths.
> > > 
> > 
> > well, this will imply not supporting eapi2, i can live with it
> 
> Oh, right. I've forgot. Each EPREFIX usage would require something
> like the following:
> 
>     has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=

not worth it, ocaml ebuilds are all eapi2 and the eapi2->3 migration is
quite straightforward, so there's no point in supporting <eapi3.

A.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23 20:41     ` Alexandre Rostovtsev
@ 2012-03-24 13:22       ` Alexis Ballier
  0 siblings, 0 replies; 24+ messages in thread
From: Alexis Ballier @ 2012-03-24 13:22 UTC (permalink / raw
  To: gentoo-dev

On Fri, 23 Mar 2012 16:41:35 -0400
Alexandre Rostovtsev <tetromino@gentoo.org> wrote:

> On Fri, Mar 23, 2012 at 4:24 PM, Alexis Ballier <aballier@gentoo.org>
> wrote:
> > On Fri, 23 Mar 2012 23:11:46 +0300
> > Sergei Trofimovich <slyfox@gentoo.org> wrote:
> >> > oasis_src_configure() {
> >> >     ocaml setup.ml -configure \
> >> >             --prefix usr \
> >> >             --libdir /usr/$(get_libdir) \
> >> >             --docdir /usr/share/doc/${PF}/html \
> >> >             --destdir "${D}" \
> >> >             $(oasis_use_enable debug debug) \
> >> >             $(oasis_use_enable ocamlopt is_native) \
> >> >             ${oasis_configure_opts} \
> >> >             || die
> >> > }
> >>
> >> This configure hates gentoo prefix, right?
> >> Might worth sprinkling "${EPREFIX}" around absolute paths.
> >>
> >
> > well, this will imply not supporting eapi2, i can live with it
> >
> > however, usually, i prefer prefix guys that need it to submit
> > patches instead of trying to support it without testing.
> > eg: shall it be EPREFIX before the /usr's?shall it be ED instead of
> > D? both ?
> 
> You probably want ${EPREFIX} in front of every /usr passed to
> configure. In other words,
> 
> ocaml setup.ml -configure --prefix "${EPREFIX}/usr" --libdir
> "${EPREFIX}/blah" --docdir "${EPREFIX}/blargh" etc.
> 
> However, destdir should still be ${D}. That way, in src_install() your
> package's files will be copied to ${D}${EPREFIX}/usr, better known as
> ${ED}usr.

will do that since it doesnt hurt, but it'll require testing anyway.
thanks for the explanations, but then beware of the findlib_src_preinst
call in src_install, which sets a variable so that findlib installs
stuff in $D; if at some point this will be changed to $ED for some
reason then oasis+findlib packages may go in a double prefix...



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-23  8:15 [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages Alexis Ballier
  2012-03-23 15:58 ` Mike Gilbert
  2012-03-23 20:11 ` Sergei Trofimovich
@ 2012-03-24 13:44 ` Alexis Ballier
  2012-03-27 21:01   ` Alexis Ballier
  2 siblings, 1 reply; 24+ messages in thread
From: Alexis Ballier @ 2012-03-24 13:44 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

eclass version 2.0, i hope i haven't forgotten any comment

I improved some comments/description after a second read also.

[-- Attachment #2: oasis.eclass --]
[-- Type: application/octet-stream, Size: 2928 bytes --]

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: oasis.eclass
# @MAINTAINER: 
# ml@gentoo.org
# @AUTHOR:
# Original Author: Alexis Ballier <aballier@gentoo.org>
# @BLURB: Provides common ebuild phases for oasis-based packages.
# @DESCRIPTION:
# Provides common ebuild phases for oasis-based packages.
# Most of these packages will just have to inherit the eclass, set their
# dependencies and the DOCS variable for base.eclass to install it and be done.
#
# It inherits multilib, findlib, eutils and base eclasses.
# Ebuilds using oasis.eclass must be EAPI>=3.

# @ECLASS-VARIABLE: OASIS_BUILD_DOCS
# @DESCRIPTION:
# Will make oasis_src_compile build the documentation if this variable is
# defined and the doc useflag is enabled.
# The eclass takes care of setting doc in IUSE but the ebuild should take care
# of the extra dependencies it may need.
# Set before inheriting the eclass.

inherit multilib findlib eutils base

case ${EAPI:-0} in
	0|1|2) die "You need at least EAPI-3 to use oasis.eclass";;
esac

IUSE="debug +ocamlopt"
[ -n "${OASIS_BUILD_DOCS}" ] && IUSE="${IUSE} doc"

RDEPEND=">=dev-lang/ocaml-3.12[ocamlopt?]"
DEPEND="${RDEPEND}"

# @FUNCTION: oasis_use_enable
# @USAGE: < useflag > < variable >
# @DESCRIPTION:
# A use_enable-like function for oasis configure variables.
# Outputs '--override variable (true|false)', whether useflag is enabled or
# not.
# Typical usage: $(oasis_use_enable ocamlopt is_native) as an oasis configure
# argument.
oasis_use_enable() {
	echo "--override $2 $(usex $1 true false)"
}

# @FUNCTION: oasis_src_configure
# @DESCRIPTION:
# src_configure phase shared by oasis-based packages.
# Extra arguments may be passed via oasis_configure_opts.
oasis_src_configure() {
	ocaml setup.ml -configure \
		--prefix "${EPREFIX}/usr" \
		--libdir "${EPREFIX}/usr/$(get_libdir)" \
		--docdir "${EPREFIX}/usr/share/doc/${PF}/html" \
		--destdir "${D}" \
		$(oasis_use_enable debug debug) \
		$(oasis_use_enable ocamlopt is_native) \
		${oasis_configure_opts} \
		|| die
}

# @FUNCTION: oasis_src_compile
# @DESCRIPTION:
# Builds an oasis-based package.
# Will build documentation if OASIS_BUILD_DOCS is defined and the doc useflag is
# enabled. 
oasis_src_compile() {
	ocaml setup.ml -build || die
	if [ -n "${OASIS_BUILD_DOCS}" ] && use doc; then
		ocaml setup.ml -doc || die
	fi
}

# @FUNCTION: oasis_src_test
# @DESCRIPTION:
# Runs the testsuite of an oasis-based package.
oasis_src_test() {
	 LD_LIBRARY_PATH="${S}/_build/lib" ocaml setup.ml -test || die
}

# @FUNCTION: oasis_src_install
# @DESCRIPTION:
# Installs an oasis-based package.
# It calls base_src_install_docs, so will install documentation declared in the
# DOCS variable.
oasis_src_install() {
	findlib_src_preinst
	ocaml setup.ml -install || die
	base_src_install_docs
}

EXPORT_FUNCTIONS src_configure src_compile src_test src_install

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
  2012-03-24 13:44 ` Alexis Ballier
@ 2012-03-27 21:01   ` Alexis Ballier
  0 siblings, 0 replies; 24+ messages in thread
From: Alexis Ballier @ 2012-03-27 21:01 UTC (permalink / raw
  To: gentoo-dev

On Sat, 24 Mar 2012 10:44:03 -0300
Alexis Ballier <aballier@gentoo.org> wrote:

> eclass version 2.0, i hope i haven't forgotten any comment
> 
> I improved some comments/description after a second read also.

since there were no more comments: eclass committed, thanks all



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-03-27 21:02 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23  8:15 [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages Alexis Ballier
2012-03-23 15:58 ` Mike Gilbert
2012-03-23 16:02   ` Ciaran McCreesh
2012-03-23 16:14     ` Ian Stakenvicius
2012-03-23 16:19       ` Ciaran McCreesh
2012-03-23 16:32         ` Ian Stakenvicius
2012-03-23 16:36           ` Ian Stakenvicius
2012-03-23 16:43           ` Ciaran McCreesh
2012-03-23 16:50     ` Mike Gilbert
2012-03-23 16:52       ` Ciaran McCreesh
2012-03-23 16:58         ` Mike Gilbert
2012-03-23 17:09       ` Alexandre Rostovtsev
2012-03-23 18:17         ` Alec Warner
2012-03-23 19:37           ` Ciaran McCreesh
2012-03-23 20:11             ` Alec Warner
2012-03-23 18:03   ` Alexis Ballier
2012-03-23 20:11 ` Sergei Trofimovich
2012-03-23 20:24   ` Alexis Ballier
2012-03-23 20:41     ` Alexandre Rostovtsev
2012-03-24 13:22       ` Alexis Ballier
2012-03-23 21:02     ` Sergei Trofimovich
2012-03-24 13:19       ` Alexis Ballier
2012-03-24 13:44 ` Alexis Ballier
2012-03-27 21:01   ` Alexis Ballier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox