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: oasis.eclass
Description: Binary data

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: fieldslib-0.1.2.ebuild
Description: Binary data

Reply via email to