summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2016-08-12 13:02:07 +0200
committerAlexis Ballier <aballier@gentoo.org>2016-08-12 13:03:53 +0200
commit6a42f01bcca5713a9f6a7c1ed81441c8213af56b (patch)
tree3edc75e590105e8670ff9b58f987c62e8badcb16 /dev-ml/eliom
parentsci-mathematics/coq: drop ocaml 4.03 patch; it is not needed anymore. (diff)
downloadgentoo-6a42f01bcca5713a9f6a7c1ed81441c8213af56b.tar.gz
gentoo-6a42f01bcca5713a9f6a7c1ed81441c8213af56b.tar.bz2
gentoo-6a42f01bcca5713a9f6a7c1ed81441c8213af56b.zip
dev-ml/eliom: fix build with ocaml 4.03 and add missing dep on camlp4
Package-Manager: portage-2.3.0
Diffstat (limited to 'dev-ml/eliom')
-rw-r--r--dev-ml/eliom/eliom-5.0.0-r1.ebuild (renamed from dev-ml/eliom/eliom-5.0.0.ebuild)9
-rw-r--r--dev-ml/eliom/files/camlp4.patch48
-rw-r--r--dev-ml/eliom/files/oc43.patch37
3 files changed, 93 insertions, 1 deletions
diff --git a/dev-ml/eliom/eliom-5.0.0.ebuild b/dev-ml/eliom/eliom-5.0.0-r1.ebuild
index e0d8cb71f0ea..b5103a315483 100644
--- a/dev-ml/eliom/eliom-5.0.0.ebuild
+++ b/dev-ml/eliom/eliom-5.0.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -26,11 +26,18 @@ RDEPEND=">=dev-lang/ocaml-4.00:=[ocamlopt?]
dev-ml/ocaml-ssl:=
>=dev-ml/lwt-2.5.0:=
dev-ml/calendar:=
+ dev-ml/camlp4:=
ppx? ( >=dev-ml/ppx_tools-0.99.3:= )"
DEPEND="${RDEPEND}
dev-ml/ocamlbuild
dev-ml/opam"
+src_prepare() {
+ if has_version '>=dev-lang/ocaml-4.03' ; then
+ epatch "${FILESDIR}/"{camlp4,oc43}.patch
+ fi
+}
+
src_compile() {
if use ocamlopt ; then
emake PPX=$(usex ppx true false) all
diff --git a/dev-ml/eliom/files/camlp4.patch b/dev-ml/eliom/files/camlp4.patch
new file mode 100644
index 000000000000..59e94ab462a2
--- /dev/null
+++ b/dev-ml/eliom/files/camlp4.patch
@@ -0,0 +1,48 @@
+commit f157a5b913451b85e8cfe7549c66e5c98669233b
+Author: Vasilis Papavasileiou <git@vasilis.airpost.net>
+Date: Wed Mar 2 14:23:02 2016 +0100
+
+ Compile against Camlp4 4.02+7
+
+diff --git a/src/syntax/pa_eliom_seed.ml b/src/syntax/pa_eliom_seed.ml
+index c101ff8..dc31caa 100644
+--- a/src/syntax/pa_eliom_seed.ml
++++ b/src/syntax/pa_eliom_seed.ml
+@@ -632,8 +632,26 @@ module Register(Id : sig val name: string end)(Pass : Pass) = struct
+ | None ->
+ Printf.ksprintf (Syntax_error.raise loc) fmt
+
+- module E2 = Camlp4.ErrorHandler.Register(Syntax_error)
+- DELETE_RULE Gram expr: "{"; TRY [label_expr_list; "}"] END;
++ module E2 = Camlp4.ErrorHandler.Register(Syntax_error) ;;
++
++ try
++ DELETE_RULE Gram expr: "{"; TRY [label_expr_list; "}"] END
++ with Camlp4.Struct.Grammar.Delete.Rule_not_found _ ->
++ (let test_record_field =
++ Gram.Entry.of_parser "record_field" (fun strm ->
++ let rec loop = function
++ | [] -> ()
++ | (UIDENT _, _) :: (KEYWORD ".", _) :: rest -> loop rest
++ | (LIDENT _, _) :: (KEYWORD "=", _) :: _ -> ()
++ | (LIDENT _, _) :: (KEYWORD ";", _) :: _ -> ()
++ | [LIDENT _, _] -> ()
++ | _ -> raise Stream.Failure
++ in
++ loop (Stream.npeek 100 strm))
++ in
++ DELETE_RULE Gram expr:
++ "{"; test_record_field; label_expr_list; "}" END) ;;
++
+ DELETE_RULE Gram expr: "{"; TRY [expr LEVEL "."; "with"]; label_expr_list; "}" END;
+
+ (* Extending syntax *)
+@@ -812,7 +830,7 @@ module Register(Id : sig val name: string end)(Pass : Pass) = struct
+ expr: LEVEL "simple"
+
+ [ [ KEYWORD "{"; lel = TRY [lel = label_expr_list; "}" -> lel] ->
+- <:expr< { $lel$ } >>
++ Ast.ExRec (_loc, lel, Ast.ExNil _loc)
+ | KEYWORD "{shared#";
+ typ = TRY [ typ = OPT ctyp; KEYWORD "{" -> typ];
+ opt_lvl = dummy_set_level_shared_value_expr ;
diff --git a/dev-ml/eliom/files/oc43.patch b/dev-ml/eliom/files/oc43.patch
new file mode 100644
index 000000000000..07d2729928a4
--- /dev/null
+++ b/dev-ml/eliom/files/oc43.patch
@@ -0,0 +1,37 @@
+Index: eliom-5.0.0/src/lib/eliom_lib.client.mli
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_lib.client.mli
++++ eliom-5.0.0/src/lib/eliom_lib.client.mli
+@@ -43,7 +43,6 @@ type 'a shared_value = 'a
+
+ val create_shared_value : 'a -> 'a client_value -> 'a shared_value
+
+-exception Eliom_Internal_Error of string
+
+ (** This exception is raised (in Lwt) on the client if a call to a
+ server function {% <<a_api subproject="server"|val
+Index: eliom-5.0.0/src/lib/eliom_lib.server.mli
+===================================================================
+--- eliom-5.0.0.orig/src/lib/eliom_lib.server.mli
++++ eliom-5.0.0/src/lib/eliom_lib.server.mli
+@@ -50,7 +50,6 @@ type +'a shared_value
+ *)
+ exception Client_value_creation_invalid_context of string
+
+-exception Eliom_Internal_Error of string
+
+ type file_info = Ocsigen_extensions.file_info
+
+Index: eliom-5.0.0/src/syntax/pa_include.ml
+===================================================================
+--- eliom-5.0.0.orig/src/syntax/pa_include.ml
++++ eliom-5.0.0/src/syntax/pa_include.ml
+@@ -27,7 +27,7 @@ module Make(Syntax : Camlp4.Sig.Camlp4Sy
+ class subst_type env = object (self)
+ inherit Ast.map as super
+ method sig_item si = match si with
+- | Ast.SgTyp (_loc, (Ast.TyDcl (_, lid, _, Ast.TyNil _, _)))
++ | Ast.SgTyp (_loc, rf, (Ast.TyDcl (_, lid, _, Ast.TyNil _, _)))
+ when List.mem_assoc lid env -> <:sig_item< >>
+ | si -> super#sig_item si
+ method ctyp ty = match ty with