From e7accaf8d36247216678c5f4870000a4a50236da Mon Sep 17 00:00:00 2001 From: Marco Maggesi Date: Mon, 20 Dec 2010 10:32:22 +0000 Subject: [PATCH] * Update camlp5 svn path=/nixpkgs/trunk/; revision=25206 --- .../science/logic/coq/default.nix | 16 ++-- pkgs/development/tools/ocaml/camlp5/META | 94 +++++++++++++++++++ .../tools/ocaml/camlp5/default.nix | 15 ++- pkgs/top-level/all-packages.nix | 21 +++-- 4 files changed, 127 insertions(+), 19 deletions(-) create mode 100644 pkgs/development/tools/ocaml/camlp5/META diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index d72a2104370c..741b780a2377 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -1,7 +1,7 @@ # TODO: # - coqide compilation should be optional or (better) separate; -{stdenv, fetchurl, ocaml, camlp5, lablgtk, ncurses}: +{stdenv, fetchurl, ocaml, findlib, camlp5, lablgtk, ncurses}: let version = "8.3"; @@ -15,15 +15,17 @@ stdenv.mkDerivation { sha256 = "02iy4rxz1n1kc85fb3vs4xpxqfxjw87y2gvmi39fxrj8742qx0dx"; }; - buildInputs = [ ocaml camlp5 ncurses lablgtk ]; + buildInputs = [ ocaml findlib camlp5 ncurses lablgtk ]; prefixKey = "-prefix "; - configureFlags = - "-camldir ${ocaml}/bin " + - "-camlp5dir ${camlp5}/lib/ocaml/camlp5 " + - "-lablgtkdir ${lablgtk}/lib/ocaml/lablgtk2 " + - "-opt -coqide opt"; + preConfigure = '' + configureFlagsArray=( + -camldir ${ocaml}/bin + -camlp5dir $(ocamlfind query camlp5) + -lablgtkdir ${lablgtk}/lib/ocaml/lablgtk2 -opt -coqide opt + ) + ''; buildFlags = "world"; # Debug with "world VERBOSE=1"; diff --git a/pkgs/development/tools/ocaml/camlp5/META b/pkgs/development/tools/ocaml/camlp5/META new file mode 100644 index 000000000000..e13b108ff247 --- /dev/null +++ b/pkgs/development/tools/ocaml/camlp5/META @@ -0,0 +1,94 @@ +# Specifications for the "camlp5" preprocessor: +requires = "" +version = "[distributed with Ocaml]" +description = "Base for camlp5 syntax extensions" + +# For the toploop: +archive(byte,toploop,camlp5o) = "camlp5o.cma" +archive(byte,toploop,camlp5r) = "camlp5r.cma" + +# Scheme-like syntax: +# Do #predicates "syntax,camlp5scheme", followed by #require "camlp5" +archive(byte,toploop,camlp5scheme) = "camlp5sch.cma" + +# Standard ML-like syntax: +# Do #predicates "syntax,camlp5sml", followed by #require "camlp5" +archive(byte,toploop,camlp5sml) = "gramlib.cma camlp5_top.cma pa_sml.cmo" + +# Lisp-like syntax: +# Do #predicates "syntax,camlp5lisp", followed by #require "camlp5" +archive(byte,toploop,camlp5lisp) = "gramlib.cma camlp5_top.cma pa_lisp.cmo" + +# For the preprocessor itself: +archive(syntax,preprocessor,camlp5o) = "pa_o.cmo pa_op.cmo pr_dump.cmo" +archive(syntax,preprocessor,camlp5r) = "pa_r.cmo pa_rp.cmo pr_dump.cmo" +archive(syntax,preprocessor,camlp5sml) = "pa_sml.cmo pr_dump.cmo" +archive(syntax,preprocessor,camlp5scheme) = "pa_scheme.cmo pr_dump.cmo" +archive(syntax,preprocessor,camlp5lisp) = "pa_lisp.cmo pr_dump.cmo" +preprocessor = "camlp5 -nolib" + +package "gramlib" ( + requires(toploop) = "camlp5" + version = "[distributed with Ocaml]" + description = "Grammar library to create syntax extensions" + archive(byte) = "gramlib.cma" + archive(byte,toploop) = "" # already contained in camlp5*.cma + archive(native) = "gramlib.cmxa" +) + +package "quotations" ( + requires = "camlp5" + version = "[distributed with Ocaml]" + description = "Syntax extension: Quotations to create AST nodes" + archive(syntax,preprocessor) = "q_MLast.cmo" + archive(syntax,toploop) = "q_MLast.cmo" +) + +package "phony_quotations" ( + requires = "camlp5" + version = "[distributed with Ocaml]" + description = "Syntax extension: Phony quotations" + archive(syntax,preprocessor) = "q_phony.cmo" + archive(syntax,toploop) = "q_phony.cmo" +) + +package "extend" ( + requires = "camlp5" + version = "[distributed with Ocaml]" + description = "Syntax extension: EXTEND the camlp5 grammar" + archive(syntax,preprocessor) = "pa_extend.cmo" + archive(syntax,toploop) = "pa_extend.cmo" +) + +package "extfun" ( + requires = "camlp5" + version = "[distributed with Ocaml]" + description = "Syntax extension: Extensible functions" + archive(syntax,preprocessor) = "pa_extfun.cmo" + archive(syntax,toploop) = "pa_extfun.cmo" +) + +package "fstream" ( + requires = "camlp5" + version = "[distributed with Ocaml]" + description = "Syntax extension: Functional stream parsers" + archive(syntax,preprocessor) = "pa_fstream.cmo" + archive(syntax,toploop) = "pa_fstream.cmo" +) + +package "macro" ( + requires = "camlp5" + version = "[distributed with Ocaml]" + description = "Syntax extension: Conditional compilation" + archive(syntax,preprocessor) = "pa_macro.cmo" + archive(syntax,toploop) = "pa_macro.cmo" +) + +package "unit_constraints" ( + requires = "camlp5" + version = "[distributed with Ocaml]" + description = "Syntax extension: Type constraints of type unit (revised syntax only)" + archive(syntax,preprocessor,camlp5r) = "pa_ru.cmo" + archive(syntax,toploop,camlp5r) = "pa_ru.cmo" + error(syntax,-camlp5r) = "Not available" +) diff --git a/pkgs/development/tools/ocaml/camlp5/default.nix b/pkgs/development/tools/ocaml/camlp5/default.nix index 7c87243054bd..7247041cb1d4 100644 --- a/pkgs/development/tools/ocaml/camlp5/default.nix +++ b/pkgs/development/tools/ocaml/camlp5/default.nix @@ -1,9 +1,11 @@ {stdenv, fetchurl, ocaml, transitional ? false}: let + ocaml_version = (builtins.parseDrvName ocaml.name).version; pname = "camlp5"; - version = "5.12"; + version = "5.15"; webpage = http://pauillac.inria.fr/~ddr/camlp5/; + metafile = ./META; in stdenv.mkDerivation { @@ -12,17 +14,20 @@ stdenv.mkDerivation { src = fetchurl { url = "${webpage}/distrib/src/${pname}-${version}.tgz"; - sha256 = "985a5e373ea75f89667e71bc857c868c395769fce664cba88aa76f93b0ad8461"; + sha256 = "1sx5wlfpydqskm97gp7887p3avbl3vanlmrwj35wx5mbzj6kn9nq"; }; buildInputs = [ ocaml ]; prefixKey = "-prefix "; - configureFlags = if transitional then "--transitional" else "--strict"; + preConfigure = "configureFlagsArray=(" + (if transitional then "--transitional" else "--strict") + + " --libdir $out/lib/ocaml/${ocaml_version}/site-lib)"; buildFlags = "world.opt"; + postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml_version}/site-lib/camlp5/META"; + meta = { description = "Preprocessor-pretty-printer for OCaml"; longDescription = '' @@ -31,5 +36,9 @@ stdenv.mkDerivation { ''; homepage = "${webpage}"; license = "BSD"; + platforms = ocaml.meta.platforms; + maintainers = [ + stdenv.lib.maintainers.z77z + ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9dc4e280fa6a..23a52dd1c9da 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1985,6 +1985,12 @@ let mkOcamlPackages = ocaml: self: let callPackage = newScope self; in rec { inherit ocaml; + camlp5_strict = callPackage ../development/tools/ocaml/camlp5 { }; + + camlp5_transitional = callPackage ../development/tools/ocaml/camlp5 { + transitional = true; + }; + camlzip = callPackage ../development/ocaml-modules/camlzip { }; camomile = camomile_0_7_3; @@ -2404,12 +2410,6 @@ let byacc = callPackage ../development/tools/parsing/byacc { }; - camlp5_strict = callPackage ../development/tools/ocaml/camlp5 { }; - - camlp5_transitional = callPackage ../development/tools/ocaml/camlp5 { - transitional = true; - }; - ccache = callPackage ../development/tools/misc/ccache { }; ctags = callPackage ../development/tools/misc/ctags { }; @@ -7012,7 +7012,8 @@ let ### SCIENCE/LOGIC coq = callPackage ../applications/science/logic/coq { - camlp5 = camlp5_transitional; + inherit (ocamlPackages) findlib; + camlp5 = ocamlPackages.camlp5_transitional; }; cvc3 = callPackage ../applications/science/logic/cvc3 {}; @@ -7027,7 +7028,9 @@ let hol = callPackage ../applications/science/logic/hol { }; - hol_light = callPackage ../applications/science/logic/hol_light { }; + hol_light = callPackage ../applications/science/logic/hol_light { + inherit (ocamlPackages) camlp5_transitional; + }; hol_light_sources = callPackage ../applications/science/logic/hol_light/sources.nix { }; @@ -7056,7 +7059,7 @@ let spass = callPackage ../applications/science/logic/spass {}; ssreflect = callPackage ../applications/science/logic/ssreflect { - camlp5 = camlp5_transitional; + camlp5 = ocamlPackages.camlp5_transitional; }; ### SCIENCE / ELECTRONICS