aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2012-03-02 00:55:32 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2012-03-02 01:01:21 -0500
commit23afff670e90583ba9206f37e7b7dfc772b585db (patch)
treece9fb5a091cded32ada5d8340bed82e8b1b36e5b
parent[dev-ml/lacaml] version bump (diff)
downloadsci-23afff670e90583ba9206f37e7b7dfc772b585db.tar.gz
sci-23afff670e90583ba9206f37e7b7dfc772b585db.tar.bz2
sci-23afff670e90583ba9206f37e7b7dfc772b585db.zip
[dev-ml/zarith] new ebuild
-rw-r--r--dev-ml/zarith/ChangeLog11
-rw-r--r--dev-ml/zarith/Manifest1
-rw-r--r--dev-ml/zarith/files/zarith-1.0-bytecode.patch31
-rw-r--r--dev-ml/zarith/files/zarith-1.0-optnotrequired.patch22
-rw-r--r--dev-ml/zarith/metadata.xml11
-rw-r--r--dev-ml/zarith/zarith-1.0.ebuild62
6 files changed, 138 insertions, 0 deletions
diff --git a/dev-ml/zarith/ChangeLog b/dev-ml/zarith/ChangeLog
new file mode 100644
index 000000000..7c3b19f2d
--- /dev/null
+++ b/dev-ml/zarith/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for dev-ml/zarith
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*zarith-1.0 (02 Mar 2012)
+
+ 02 Mar 2012; Guillaume Horel <guillaume.horel@gmail.com> +zarith-1.0.ebuild,
+ +files/zarith-1.0-bytecode.patch, +files/zarith-1.0-optnotrequired.patch,
+ +metadata.xml:
+ initial import
+
diff --git a/dev-ml/zarith/Manifest b/dev-ml/zarith/Manifest
new file mode 100644
index 000000000..f8612f14d
--- /dev/null
+++ b/dev-ml/zarith/Manifest
@@ -0,0 +1 @@
+DIST zarith-1.0.tgz 66484 RMD160 468d94aa9ef83ceba313afc5d4b8954d86fe6289 SHA1 11c86c5403f44f596e4785be3ff71f76aa84c28e SHA256 1531680808d79f83869db581bf389e7bc07f7ee9c1eb132c057eb30cf3a8d25c
diff --git a/dev-ml/zarith/files/zarith-1.0-bytecode.patch b/dev-ml/zarith/files/zarith-1.0-bytecode.patch
new file mode 100644
index 000000000..2de677214
--- /dev/null
+++ b/dev-ml/zarith/files/zarith-1.0-bytecode.patch
@@ -0,0 +1,31 @@
+--- project.mak.orig 2011-11-14 18:18:05.702705850 -0500
++++ project.mak 2011-11-14 18:18:58.142704311 -0500
+@@ -23,12 +23,14 @@
+
+ CMIOBJ = $(MLISRC:%.mli=%.cmi)
+ TOINSTALL = zarith.a zarith.cma zarith.cmxa zarith.cmxs libzarith.a $(MLISRC) $(CMIOBJ)
+-
++TOINSTALLbyte = zarith.cma libzarith.a $(MLISRC) $(CMIOBJ)
+
+ # build targets
+ ###############
+
+-all: $(TOINSTALL) test
++all: $(TOINSTALL)
++
++all-byte: $(TOINSTALLbyte)
+
+ zarith.cma: $(MLSRC:%.ml=%.cmo)
+ $(OCAMLMKLIB) -o zarith $+ $(LIBS)
+@@ -80,8 +82,9 @@
+
+ ifeq ($(INSTMETH),findlib)
+ install:
+- $(OCAMLFIND) install -destdir $(INSTALLDIR) zarith META $(TOINSTALL) dllzarith.so
+-
++ $(OCAMLFIND) install zarith META $(TOINSTALL) dllzarith.so
++install-byte:
++ $(OCAMLFIND) install zarith META $(TOINSTALLbyte) dllzarith.so
+ uninstall:
+ $(OCAMLFIND) remove -destdir $(INSTALLDIR) zarith
+ endif
diff --git a/dev-ml/zarith/files/zarith-1.0-optnotrequired.patch b/dev-ml/zarith/files/zarith-1.0-optnotrequired.patch
new file mode 100644
index 000000000..2bd1b4df8
--- /dev/null
+++ b/dev-ml/zarith/files/zarith-1.0-optnotrequired.patch
@@ -0,0 +1,22 @@
+From: Mehdi Dogguy <mehdi@debian.org>
+Date: Sun, 2 Oct 2011 11:53:22 +0200
+Subject: [PATCH] ocamlopt is not really required
+
+---
+ configure | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/configure b/configure
+index 5bd80d3..980aedd 100755
+--- a/configure
++++ b/configure
+@@ -186,7 +186,7 @@ checkcc()
+
+ searchbinreq $ocaml
+ searchbinreq $ocamlc
+-searchbinreq $ocamlopt
++searchbin $ocamlopt
+ searchbinreq $ocamldep
+ searchbinreq $ocamlmklib
+ searchbinreq $ocamldoc
+--
diff --git a/dev-ml/zarith/metadata.xml b/dev-ml/zarith/metadata.xml
new file mode 100644
index 000000000..a87c2ac5f
--- /dev/null
+++ b/dev-ml/zarith/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci</herd>
+<longdescription lang='en'>
+Arithmetic and logic operations over arbitrary-precision integers in Ocaml
+</longdescription>
+<use>
+<flag name='mpir'>Use mpir library instead of gmp</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-ml/zarith/zarith-1.0.ebuild b/dev-ml/zarith/zarith-1.0.ebuild
new file mode 100644
index 000000000..49a1b3c2b
--- /dev/null
+++ b/dev-ml/zarith/zarith-1.0.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+
+inherit findlib eutils
+
+DESCRIPTION="Arithmetic and logic operations over arbitrary-precision integers"
+HOMEPAGE="https://forge.ocamlcore.org/projects/zarith/"
+SRC_URI="http://forge.ocamlcore.org/frs/download.php/683/${P}.tgz"
+
+LICENSE="LGPL-2.1-linking-exception"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc mpir +ocamlopt"
+
+RDEPEND=">=dev-lang/ocaml-3.12.1[ocamlopt?]
+!mpir? ( dev-libs/gmp )
+mpir? ( sci-libs/mpir )"
+
+DEPEND="${DEPEND}
+dev-lang/perl"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-optnotrequired.patch"
+ epatch "${FILESDIR}/${P}-bytecode.patch"
+}
+
+src_configure() {
+ MY_OPTS="-ocamllibdir /usr/$(get_libdir) -installdir ${D}"
+ use mpir && MY_OPTS="${MY_OPTS} -mpir"
+ ./configure ${MY_OPTS}|| die
+}
+
+src_compile() {
+ if use ocamlopt; then
+ emake all
+ else
+ emake all-byte
+ fi
+ use doc && emake doc
+}
+
+src_test() {
+ if use ocamlopt; then
+ emake test;LD_LIBRARY_PATH="." ./test || die
+ else
+ emake test.b;LD_LIBRARY_PATH="." ./test.b || die
+ fi
+}
+
+src_install() {
+ findlib_src_preinst
+ if use ocamlopt; then
+ emake install
+ else
+ emake install-byte
+ fi
+ dodoc README
+ use doc && dodoc -r html/
+}