summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ml/js_of_ocaml')
-rw-r--r--dev-ml/js_of_ocaml/files/tyxml36-2.patch30
-rw-r--r--dev-ml/js_of_ocaml/files/tyxml36.patch158
-rw-r--r--dev-ml/js_of_ocaml/js_of_ocaml-2.6.ebuild10
3 files changed, 196 insertions, 2 deletions
diff --git a/dev-ml/js_of_ocaml/files/tyxml36-2.patch b/dev-ml/js_of_ocaml/files/tyxml36-2.patch
new file mode 100644
index 000000000000..0f7771c98604
--- /dev/null
+++ b/dev-ml/js_of_ocaml/files/tyxml36-2.patch
@@ -0,0 +1,30 @@
+commit f11959da5a630a7dca47497c9543231d9698b406
+Author: Vasilis Papavasileiou <git@vasilis.airpost.net>
+Date: Fri Aug 7 11:16:20 2015 +0200
+
+ Tyxml_js: ft constructor in Xml_wrap (forward-compatibility)
+
+diff --git a/lib/tyxml/tyxml_js.ml b/lib/tyxml/tyxml_js.ml
+index 4799600..cdf7cd2 100644
+--- a/lib/tyxml/tyxml_js.ml
++++ b/lib/tyxml/tyxml_js.ml
+@@ -164,6 +164,7 @@ module Html5 = Html5_f.Make(Xml)(Svg)
+ module Xml_wrap = struct
+ type 'a t = 'a React.signal
+ type 'a tlist = 'a ReactiveData.RList.t
++ type ('a, 'b) ft = 'a -> 'b
+ let return = React.S.const
+ let fmap f = React.S.map f
+ let nil () = ReactiveData.RList.nil
+diff --git a/lib/tyxml/tyxml_js.mli b/lib/tyxml/tyxml_js.mli
+index 8cb33c5..db2183e 100644
+--- a/lib/tyxml/tyxml_js.mli
++++ b/lib/tyxml/tyxml_js.mli
+@@ -50,6 +50,7 @@ module Xml : XML with module W = Xml_wrap.NoWrap
+ module Xml_wrap : Xml_wrap.T
+ with type 'a t = 'a React.signal
+ and type 'a tlist = 'a ReactiveData.RList.t
++ and type ('a, 'b) ft = 'a -> 'b
+
+ module Util : sig
+ val update_children : Dom.node Js.t -> Dom.node Js.t ReactiveData.RList.t -> unit
diff --git a/dev-ml/js_of_ocaml/files/tyxml36.patch b/dev-ml/js_of_ocaml/files/tyxml36.patch
new file mode 100644
index 000000000000..34a2aabf87fc
--- /dev/null
+++ b/dev-ml/js_of_ocaml/files/tyxml36.patch
@@ -0,0 +1,158 @@
+commit ebf7150f41c64ac0e18e9f89d1e565b6c3115414
+Author: Vasilis Papavasileiou <git@vasilis.airpost.net>
+Date: Thu Aug 6 11:52:11 2015 +0200
+
+ up-to-date version of @drup's new-style wrapping (ocsigen/tyxml#58)
+
+diff --git a/lib/tyxml/tyxml_js.ml b/lib/tyxml/tyxml_js.ml
+index 0143219..4799600 100644
+--- a/lib/tyxml/tyxml_js.ml
++++ b/lib/tyxml/tyxml_js.ml
+@@ -20,8 +20,19 @@
+ let js_string_of_float f = (Js.number_of_float f)##toString()
+ let js_string_of_int i = (Js.number_of_float (float_of_int i))##toString()
+
++
++module type XML =
++ Xml_sigs.T
++ with type uri = string
++ and type event_handler = Dom_html.event Js.t -> bool
++ and type mouse_event_handler = Dom_html.mouseEvent Js.t -> bool
++ and type keyboard_event_handler = Dom_html.keyboardEvent Js.t -> bool
++ and type elt = Dom.node Js.t
++
++
+ module Xml = struct
+
++ module W = Xml_wrap.NoWrap
+ type 'a wrap = 'a
+ type 'a list_wrap = 'a list
+
+@@ -162,7 +173,6 @@ module Xml_wrap = struct
+ let append x y = ReactiveData.RList.concat x y
+ end
+
+-
+ module Util = struct
+ open ReactiveData
+ open RList
+@@ -226,9 +236,23 @@ end
+
+
+ module R = struct
+- module Xml_wed = struct
+- type 'a wrap = 'a Xml_wrap.t
+- type 'a list_wrap = 'a Xml_wrap.tlist
++
++ let filter_attrib (name,a) on =
++ match a with
++ | Xml.Event _ ->
++ raise (Invalid_argument "filter_attrib not implemented for event handler")
++ | Xml.Attr a ->
++ name,
++ Xml.Attr
++ (React.S.l2
++ (fun on a -> if on then a else None) on a)
++
++ let attach_attribs = Xml.attach_attribs
++
++ module Xml = struct
++ module W = Xml_wrap
++ type 'a wrap = 'a W.t
++ type 'a list_wrap = 'a W.tlist
+ type uri = Xml.uri
+ let string_of_uri = Xml.string_of_uri
+ let uri_of_string = Xml.uri_of_string
+@@ -239,7 +263,7 @@ module R = struct
+ type attrib = Xml.attrib
+
+ let attr name f s =
+- let a = Xml_wrap.fmap f s in
++ let a = W.fmap f s in
+ name,Xml.Attr a
+
+ let float_attrib name s = attr name (fun f -> Some (js_string_of_float f)) s
+@@ -267,7 +291,7 @@ module R = struct
+ let leaf = Xml.leaf
+ let node ?(a=[]) name l =
+ let e = Dom_html.document##createElement(Js.string name) in
+- Xml.attach_attribs e a;
++ attach_attribs e a;
+ Util.update_children (e :> Dom.node Js.t) l;
+ (e :> Dom.node Js.t)
+ let cdata = Xml.cdata
+@@ -275,30 +299,22 @@ module R = struct
+ let cdata_style = Xml.cdata_style
+ end
+
+- module Xml_wed_svg = struct
+- include Xml_wed
++ module Xml_Svg = struct
++ include Xml
+
+ let leaf = Xml_Svg.leaf
+
+ let node ?(a = []) name l =
+ let e =
+ Dom_html.document##createElementNS(Dom_svg.xmlns,Js.string name) in
+- Xml.attach_attribs e a;
++ attach_attribs e a;
+ Util.update_children (e :> Dom.node Js.t) l;
+ (e :> Dom.node Js.t)
+ end
+
+- module Svg = Svg_f.MakeWrapped(Xml_wrap)(Xml_wed_svg)
+- module Html5 = Html5_f.MakeWrapped(Xml_wrap)(Xml_wed)(Svg)
+- let filter_attrib (name,a) on =
+- match a with
+- | Xml.Event _ ->
+- raise (Invalid_argument "filter_attrib not implemented for event handler")
+- | Xml.Attr a ->
+- name,
+- Xml.Attr
+- (React.S.l2
+- (fun on a -> if on then a else None) on a)
++ module Svg = Svg_f.Make(Xml_Svg)
++ module Html5 = Html5_f.Make(Xml)(Svg)
++
+ end
+
+ module To_dom = Tyxml_cast.MakeTo(struct
+diff --git a/lib/tyxml/tyxml_js.mli b/lib/tyxml/tyxml_js.mli
+index b3323cc..8cb33c5 100644
+--- a/lib/tyxml/tyxml_js.mli
++++ b/lib/tyxml/tyxml_js.mli
+@@ -37,13 +37,16 @@
+ @see <https://ocsigen.org/tyxml/dev/api/Html5_sigs.T> Html5_sigs.T to have a list of available functions to build HTML.
+ *)
+
+-module Xml : Xml_sigs.T
++module type XML =
++ Xml_sigs.T
+ with type uri = string
+ and type event_handler = Dom_html.event Js.t -> bool
+ and type mouse_event_handler = Dom_html.mouseEvent Js.t -> bool
+ and type keyboard_event_handler = Dom_html.keyboardEvent Js.t -> bool
+ and type elt = Dom.node Js.t
+
++module Xml : XML with module W = Xml_wrap.NoWrap
++
+ module Xml_wrap : Xml_wrap.T
+ with type 'a t = 'a React.signal
+ and type 'a tlist = 'a ReactiveData.RList.t
+@@ -57,10 +60,13 @@ module Svg : Svg_sigs.Make(Xml).T
+ module Html5 : Html5_sigs.Make(Xml)(Svg).T
+
+ module R : sig
+- module Svg : Svg_sigs.MakeWrapped(Xml_wrap)(Xml).T
++ module Xml : XML with module W = Xml_wrap
++
++ module Svg : Svg_sigs.Make(Xml).T
+ with type +'a elt = 'a Svg.elt
+ and type +'a attrib = 'a Svg.attrib
+- module Html5 : Html5_sigs.MakeWrapped(Xml_wrap)(Xml)(Svg).T
++
++ module Html5 : Html5_sigs.Make(Xml)(Svg).T
+ with type +'a elt = 'a Html5.elt
+ and type +'a attrib = 'a Html5.attrib
+ val filter_attrib : 'a Html5.attrib -> bool React.signal -> 'a Html5.attrib
diff --git a/dev-ml/js_of_ocaml/js_of_ocaml-2.6.ebuild b/dev-ml/js_of_ocaml/js_of_ocaml-2.6.ebuild
index 04c22b5edb6b..b7fe9c9838fb 100644
--- a/dev-ml/js_of_ocaml/js_of_ocaml-2.6.ebuild
+++ b/dev-ml/js_of_ocaml/js_of_ocaml-2.6.ebuild
@@ -4,7 +4,7 @@
EAPI=5
-inherit findlib
+inherit findlib eutils
DESCRIPTION="A compiler from OCaml bytecode to javascript"
HOMEPAGE="http://ocsigen.org/js_of_ocaml/"
@@ -19,7 +19,7 @@ DEPEND=">=dev-lang/ocaml-3.12:=[ocamlopt?]
>=dev-ml/lwt-2.4.4:=
dev-ml/react:=
dev-ml/reactiveData:=
- >=dev-ml/tyxml-3.3:=
+ >=dev-ml/tyxml-3.6:=
dev-ml/cmdliner:=
dev-ml/menhir:=
dev-ml/ocaml-base64:=
@@ -28,6 +28,12 @@ DEPEND=">=dev-lang/ocaml-3.12:=[ocamlopt?]
deriving? ( >=dev-ml/deriving-0.6:= )"
RDEPEND="${DEPEND}"
+src_prepare() {
+ epatch \
+ "${FILESDIR}/tyxml36.patch" \
+ "${FILESDIR}/tyxml36-2.patch"
+}
+
src_configure() {
use ocamlopt || echo "BEST := byte" >> Makefile.conf
use deriving || echo "WITH_DERIVING := NO" >> Makefile.conf