Merge pull request #8296 from vbgl/ocamlp4
OCaml-4.02: fix ocamlbuild rules for camlp4
This commit is contained in:
@@ -9,6 +9,10 @@ assert useX11 -> !stdenv.isArm && !stdenv.isMips;
|
||||
let
|
||||
useNativeCompilers = !stdenv.isMips;
|
||||
inherit (stdenv.lib) optionals optionalString;
|
||||
patchOcamlBuild = fetchurl {
|
||||
url = https://github.com/ocaml/ocaml/pull/117.patch;
|
||||
sha256 = "0x2cdn2sgzq29qzqg5y2ial0jqy8gjg5a7jf8qqch55dc4vkyjw0";
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -24,6 +28,8 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1p7lqvh64xpykh99014mz21q8fs3qyjym2qazhhbq8scwldv1i38";
|
||||
};
|
||||
|
||||
patches = [ patchOcamlBuild ];
|
||||
|
||||
prefixKey = "-prefix ";
|
||||
configureFlags = optionals useX11 [ "-x11lib" x11lib
|
||||
"-x11include" x11inc ];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, ocaml, findlib, which }:
|
||||
{ stdenv, fetchurl, ocaml, findlib, which, camlp4 }:
|
||||
|
||||
let inherit (stdenv.lib) getVersion versionAtLeast; in
|
||||
|
||||
@@ -14,7 +14,20 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib which ];
|
||||
buildInputs = [ ocaml findlib which camlp4 ];
|
||||
|
||||
patchPhase = ''
|
||||
patch myocamlbuild.ml <<EOF
|
||||
70,74c70
|
||||
< let camlp4of =
|
||||
< try
|
||||
< let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in
|
||||
< Filename.concat path_bin "camlp4of"
|
||||
< with _ -> "camlp4of" in
|
||||
---
|
||||
> let camlp4of = "camlp4of" in
|
||||
EOF
|
||||
'';
|
||||
|
||||
# The custom `configure` script does not expect the --prefix
|
||||
# option. Installation is handled by ocamlfind.
|
||||
|
||||
24
pkgs/development/ocaml-modules/eliom/camlp4.patch
Normal file
24
pkgs/development/ocaml-modules/eliom/camlp4.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
--- a/src/_tags 2014-10-01 16:19:35.000000000 +0100
|
||||
+++ b/src/_tags 2014-11-09 16:55:34.470663377 +0000
|
||||
@@ -39,7 +39,7 @@
|
||||
<lib/server/monitor/*.ml{,i}>:I(src/lib/server)
|
||||
|
||||
<syntax/pa_*.ml{,i}>: syntax(camlp4o),package(camlp4.quotations.o,camlp4.extend)
|
||||
-<syntax/pa_*.ml{,i}>: I(+camlp4/Camlp4Parsers)
|
||||
+<syntax/pa_*.ml{,i}>: use_camlp4_full
|
||||
|
||||
|
||||
<ocamlbuild/ocamlbuild_eliom.ml{,i}>: package(ocamlbuild,js_of_ocaml.ocamlbuild)
|
||||
|
||||
--- a/src/lib/eliom_registration.server.ml 2014-10-01 16:19:35.000000000 +0100
|
||||
+++ b/src/lib/eliom_registration.server.ml 2014-11-09 17:26:16.093198699 +0000
|
||||
@@ -2440,7 +2440,7 @@
|
||||
(Ocaml.register_post_coservice'
|
||||
?scope ?options ?charset ?code ?content_type ?headers ?secure_session ?name
|
||||
?csrf_safe ?csrf_scope ?csrf_secure ?max_use ?timeout ?https ?error_handler
|
||||
- ~post_params:Eliom_parameter.(ocaml "argument" argument_type)
|
||||
+ ~post_params:(Eliom_parameter.ocaml "argument" argument_type)
|
||||
(fun () argument -> f argument))
|
||||
(Eliom_wrap.create_unwrapper
|
||||
(Eliom_wrap.id_of_int Eliom_common_base.server_function_unwrap_id_int))
|
||||
|
||||
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec
|
||||
sha256 = "10v7mrq3zsbxdlg8k8xif777mbvcdpabvnd1g7p2yqivr7f1qm24";
|
||||
};
|
||||
|
||||
patches = [ ./camlp4.patch ];
|
||||
|
||||
buildInputs = [ocaml which ocsigen_server findlib ocsigen_deriving
|
||||
js_of_ocaml ocaml_optcomp opam];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{stdenv, fetchurl, ocaml, findlib, pkgconfig, gtk, libgnomecanvas, libglade, gtksourceview}:
|
||||
{ stdenv, fetchurl, ocaml, findlib, pkgconfig, gtk, libgnomecanvas, libglade, gtksourceview, camlp4 }:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
@@ -14,7 +14,7 @@ stdenv.mkDerivation (rec {
|
||||
sha256 = "1fnh0amm7lwgyjdhmlqgsp62gwlar1140425yc1j6inwmgnsp0a9";
|
||||
};
|
||||
|
||||
buildInputs = [ocaml findlib pkgconfig gtk libgnomecanvas libglade gtksourceview];
|
||||
buildInputs = [ ocaml findlib pkgconfig gtk libgnomecanvas libglade gtksourceview camlp4 ];
|
||||
|
||||
configureFlags = "--with-libdir=$(out)/lib/ocaml/${ocaml_version}/site-lib";
|
||||
buildFlags = "world";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{stdenv, fetchurl, ocaml, findlib, mysql}:
|
||||
{ stdenv, fetchurl, ocaml, findlib, mysql, camlp4 }:
|
||||
|
||||
# TODO: la versione stabile da' un errore di compilazione dovuto a
|
||||
# qualche cambiamento negli header .h
|
||||
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
|
||||
"--libdir=$out/lib/ocaml/${ocaml_version}/site-lib/mysql"
|
||||
];
|
||||
|
||||
buildInputs = [ocaml findlib mysql.lib ];
|
||||
buildInputs = [ocaml findlib mysql.lib camlp4 ];
|
||||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{stdenv, fetchurl, ocaml, findlib }:
|
||||
{ stdenv, fetchurl, ocaml, findlib, camlp4 }:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
@@ -17,7 +17,8 @@ stdenv.mkDerivation {
|
||||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
buildInputs = [ocaml findlib];
|
||||
buildInputs = [ ocaml findlib ];
|
||||
propagatedBuildInputs = [ camlp4 ];
|
||||
|
||||
buildFlags = "all all.opt";
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ stdenv.mkDerivation {
|
||||
};
|
||||
|
||||
buildInputs = [ocaml findlib menhir ocsigen_deriving
|
||||
cmdliner tyxml camlp4 reactivedata];
|
||||
propagatedBuildInputs = [ ocaml_lwt ];
|
||||
cmdliner tyxml reactivedata];
|
||||
propagatedBuildInputs = [ ocaml_lwt camlp4 ];
|
||||
|
||||
patches = [ ./Makefile.conf.diff ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user