ocamlscript: new derivation

Ocamlscript compiles scripts, i.e. one-file programs, into
natively-compiled binaries, and executes them.

Homepage: http://mjambon.com/ocamlscript.html
This commit is contained in:
Vincent Laporte 2014-10-23 23:45:58 +01:00
parent 38b46ffceb
commit 16150e1f1e
3 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,25 @@
--- a/Makefile 2012-02-04 01:24:21.000000000 +0000
+++ b/Makefile 2014-10-29 14:42:08.690188302 +0000
@@ -4,6 +4,8 @@
version.ml pipeline.mli pipeline.ml common.mli common.ml \
utils.mli utils.ml ocaml.mli ocaml.ml
+CAMLP4 := $(shell ocamlfind query camlp4)
+
STDBIN = $(shell dirname `which ocamlfind`)
ifndef PREFIX
PREFIX = $(shell dirname $(STDBIN))
@@ -36,11 +38,11 @@
common: version.ml
ocamlc -pp 'camlp4orf -loc _loc' -c \
- -I +camlp4 pa_opt310.ml && \
+ -I $(CAMLP4) pa_opt310.ml && \
cp pa_opt310.cmo pa_opt.cmo && \
cp pa_opt310.cmi pa_opt.cmi
ocamlc -pp 'camlp4orf -loc _loc' -c \
- -I +camlp4 pa_tryfinally310.ml && \
+ -I $(CAMLP4) pa_tryfinally310.ml && \
cp pa_tryfinally310.cmo pa_tryfinally.cmo && \
cp pa_tryfinally310.cmi pa_tryfinally.cmi

View file

@ -0,0 +1,26 @@
{stdenv, fetchurl, ocaml, findlib, camlp4}:
stdenv.mkDerivation {
name = "ocamlscript-2.0.3";
src = fetchurl {
url = http://mjambon.com/releases/ocamlscript/ocamlscript-2.0.3.tar.gz;
sha256 = "1v1i24gijxwris8w4hi95r9swld6dm7jbry0zp72767a3g5ivlrd";
};
buildInputs = [ ocaml findlib camlp4 ];
patches = [ ./Makefile.patch ];
buildFlags = "PREFIX=$(out)";
installFlags = "PREFIX=$(out)";
preInstall = "mkdir $out/bin";
createFindlibDestdir = true;
meta = with stdenv.lib; {
homepage = http://martin.jambon.free.fr/ocamlscript.html;
license = licenses.boost;
platforms = ocaml.meta.platforms;
description = "Natively-compiled OCaml scripts";
maintainers = [ maintainers.vbgl ];
};
}

View file

@ -3645,6 +3645,8 @@ let
ocaml_react = callPackage ../development/ocaml-modules/react { };
reactivedata = callPackage ../development/ocaml-modules/reactivedata {};
ocamlscript = callPackage ../development/tools/ocaml/ocamlscript { };
ocamlsdl= callPackage ../development/ocaml-modules/ocamlsdl { };
ocaml_sqlite3 = callPackage ../development/ocaml-modules/sqlite3 { };