dev-ml/mtime: Initial import. Ebuild by me.
authorAlexis Ballier <aballier@gentoo.org>
Thu, 23 Feb 2017 08:04:53 +0000 (09:04 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Thu, 23 Feb 2017 09:15:49 +0000 (10:15 +0100)
Package-Manager: Portage-2.3.3, Repoman-2.3.1

dev-ml/mtime/Manifest [new file with mode: 0644]
dev-ml/mtime/files/firstinstall.patch [new file with mode: 0644]
dev-ml/mtime/metadata.xml [new file with mode: 0644]
dev-ml/mtime/mtime-0.8.4.ebuild [new file with mode: 0644]

diff --git a/dev-ml/mtime/Manifest b/dev-ml/mtime/Manifest
new file mode 100644 (file)
index 0000000..d4cd096
--- /dev/null
@@ -0,0 +1 @@
+DIST mtime-0.8.4.tbz 11705 SHA256 b0a1eb1fb2d30e413ab24f5261e099881cadbac5af440f53f2544e3a9846b5a9 SHA512 fc08df2abc3500d18db3c4bb9a67336b902483da24056fac2c9f0b4c93ac8860c29a59b47c1ade62f6f5b51ac32c7d16e31d5c9f8cb51900accf73ddeaf6d307 WHIRLPOOL 543168a929e4eaf158cd05420f9139664a4289c5ae1e69bf9081f842d97b08182c99dc3ac82b242afca4067f69b1efc53fb11c116056162871f59b988be2a8d5
diff --git a/dev-ml/mtime/files/firstinstall.patch b/dev-ml/mtime/files/firstinstall.patch
new file mode 100644 (file)
index 0000000..4a7ca69
--- /dev/null
@@ -0,0 +1,13 @@
+Index: mtime-0.8.4/myocamlbuild.ml
+===================================================================
+--- mtime-0.8.4.orig/myocamlbuild.ml
++++ mtime-0.8.4/myocamlbuild.ml
+@@ -34,7 +34,7 @@ let () =
+       flag ["library"; "ocaml"; "byte"; "record_mtime_os_stubs"]
+         (S ([A "-dllib"; A "-lmtime_stubs"] @ system_support_lib));
+       flag ["library"; "ocaml"; (* byte and native *)  "record_mtime_os_stubs"]
+-        (S ([A "-cclib"; A "-lmtime_stubs"] @ system_support_lib));
++      (S ([A "-cclib"; A "-Lsrc-os"; A "-cclib"; A "-lmtime_stubs"] @ system_support_lib));
+       ocaml_lib ~tag_name:"use_mtime_os" ~dir:"src-os" "src-os/mtime";
+       flag ["link"; "ocaml"; "use_mtime_os"] (S [A "-ccopt"; A "-Lsrc-os"]);
diff --git a/dev-ml/mtime/metadata.xml b/dev-ml/mtime/metadata.xml
new file mode 100644 (file)
index 0000000..ffac4d7
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+       <email>ml@gentoo.org</email>
+       <name>Gentoo ML Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-ml/mtime/mtime-0.8.4.ebuild b/dev-ml/mtime/mtime-0.8.4.ebuild
new file mode 100644 (file)
index 0000000..d80d2c8
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="OCaml module to access monotonic wall-clock time"
+HOMEPAGE="http://erratique.ch/software/mtime https://github.com/dbuenzli/mtime"
+SRC_URI="http://erratique.ch/software/mtime/releases/${P}.tbz"
+
+LICENSE="ISC"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="javascript test"
+
+RDEPEND="dev-lang/ocaml:=[ocamlopt]
+       javascript? ( dev-ml/js_of_ocaml:= )
+"
+DEPEND="${RDEPEND}
+       dev-ml/opam
+       dev-ml/topkg
+       dev-ml/ocamlbuild
+       dev-ml/findlib"
+
+src_prepare() {
+       epatch "${FILESDIR}/firstinstall.patch"
+}
+
+src_compile() {
+       ocaml pkg/pkg.ml build \
+               --with-js_of_ocaml $(usex javascript true false) \
+               --tests $(usex test true false) \
+               || die
+}
+
+src_test() {
+       ocaml pkg/pkg.ml test || die
+}
+
+src_install() {
+       opam-installer -i \
+               --prefix="${ED}/usr" \
+               --libdir="${D}/$(ocamlc -where)" \
+               --docdir="${ED}/usr/share/doc/${PF}" \
+               ${PN}.install || die
+       dodoc CHANGES.md README.md
+}