From 16150e1f1efbd6df345bd30fb5a66e28d991c595 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 23 Oct 2014 23:45:58 +0100 Subject: ocamlscript: new derivation Ocamlscript compiles scripts, i.e. one-file programs, into natively-compiled binaries, and executes them. Homepage: http://mjambon.com/ocamlscript.html --- .../tools/ocaml/ocamlscript/Makefile.patch | 25 +++++++++++++++++++++ .../tools/ocaml/ocamlscript/default.nix | 26 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/tools/ocaml/ocamlscript/Makefile.patch create mode 100644 pkgs/development/tools/ocaml/ocamlscript/default.nix (limited to 'pkgs/development/tools/ocaml/ocamlscript') diff --git a/pkgs/development/tools/ocaml/ocamlscript/Makefile.patch b/pkgs/development/tools/ocaml/ocamlscript/Makefile.patch new file mode 100644 index 000000000000..1a4a6a225a49 --- /dev/null +++ b/pkgs/development/tools/ocaml/ocamlscript/Makefile.patch @@ -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 + diff --git a/pkgs/development/tools/ocaml/ocamlscript/default.nix b/pkgs/development/tools/ocaml/ocamlscript/default.nix new file mode 100644 index 000000000000..50b9c496abaf --- /dev/null +++ b/pkgs/development/tools/ocaml/ocamlscript/default.nix @@ -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 ]; + }; +} -- cgit 1.4.1