summaryrefslogtreecommitdiff
path: root/dev-ml
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2016-11-28 21:27:17 +0100
committerAlexis Ballier <aballier@gentoo.org>2016-11-28 21:27:33 +0100
commit99a0680520e735a19f88fc2937a1c4ccd241442c (patch)
treec2c91d470e6f85c004c2b04c3fc241824d1dac7a /dev-ml
parentdev-ml/markup: fix build with uutf 1.0 (diff)
downloadgentoo-99a0680520e735a19f88fc2937a1c4ccd241442c.tar.gz
gentoo-99a0680520e735a19f88fc2937a1c4ccd241442c.tar.bz2
gentoo-99a0680520e735a19f88fc2937a1c4ccd241442c.zip
dev-ml/tyxml: fix build with uutf 1.0
Package-Manager: portage-2.3.2
Diffstat (limited to 'dev-ml')
-rw-r--r--dev-ml/tyxml/files/uutf.patch53
-rw-r--r--dev-ml/tyxml/tyxml-4.0.0.ebuild3
2 files changed, 55 insertions, 1 deletions
diff --git a/dev-ml/tyxml/files/uutf.patch b/dev-ml/tyxml/files/uutf.patch
new file mode 100644
index 00000000000..e7d0a3fa10c
--- /dev/null
+++ b/dev-ml/tyxml/files/uutf.patch
@@ -0,0 +1,53 @@
+Index: tyxml-4.0.0/lib/xml_print.ml
+===================================================================
+--- tyxml-4.0.0.orig/lib/xml_print.ml
++++ tyxml-4.0.0/lib/xml_print.ml
+@@ -154,15 +154,14 @@ module Utf8 = struct
+ Uutf.String.fold_utf_8
+ (fun _ _ d ->
+ match d with
+- | `Uchar 34 ->
+- Buffer.add_string buffer "&quot;"
+- | `Uchar 38 ->
+- Buffer.add_string buffer "&amp;"
+- | `Uchar 60 ->
+- Buffer.add_string buffer "&lt;"
+- | `Uchar 62 ->
+- Buffer.add_string buffer "&gt;"
+- | `Uchar code ->
++ | `Uchar ucode ->
++ begin
++ match Uchar.to_int ucode with
++ | 34 -> Buffer.add_string buffer "&quot;"
++ | 38 -> Buffer.add_string buffer "&amp;"
++ | 60 -> Buffer.add_string buffer "&lt;"
++ | 62 -> Buffer.add_string buffer "&gt;"
++ | code ->
+ let u =
+ (* Illegal characters in html
+ http://en.wikipedia.org/wiki/Character_encodings_in_HTML
+@@ -181,9 +180,10 @@ module Utf8 = struct
+ || code land 0xFFFF = 0xFFFE
+ || code land 0xFFFF = 0xFFFF
+ then (warn:=true; Uutf.u_rep)
+- else code
++ else ucode
+ in
+ Uutf.Buffer.add_utf_8 buffer u
++ end
+ | `Malformed _ ->
+ Uutf.Buffer.add_utf_8 buffer Uutf.u_rep;
+ warn:=true)
+Index: tyxml-4.0.0/ppx/ppx_attribute_value.ml
+===================================================================
+--- tyxml-4.0.0.orig/ppx/ppx_attribute_value.ml
++++ tyxml-4.0.0/ppx/ppx_attribute_value.ml
+@@ -160,7 +160,7 @@ let char ?separated_by:_ ?default:_ loc
+ let c =
+ match next decoded with
+ | None -> Ppx_common.error loc "No character in attribute %s" name
+- | Some i when i <= 255 -> Char.chr i
++ | Some i when Uchar.to_int i <= 255 -> Char.chr (Uchar.to_int i)
+ | Some _ ->
+ Ppx_common.error loc "Character out of range in attribute %s" name
+ in
diff --git a/dev-ml/tyxml/tyxml-4.0.0.ebuild b/dev-ml/tyxml/tyxml-4.0.0.ebuild
index 756ecbffc79..f18fea8aa6f 100644
--- a/dev-ml/tyxml/tyxml-4.0.0.ebuild
+++ b/dev-ml/tyxml/tyxml-4.0.0.ebuild
@@ -18,13 +18,14 @@ KEYWORDS="~amd64"
IUSE="+ppx +camlp4"
DEPEND="
- dev-ml/uutf:=
+ >=dev-ml/uutf-1.0:=
dev-ml/ocaml-re:=
ppx? ( >=dev-ml/ppx_tools-5:= dev-ml/markup:= )
camlp4? ( dev-ml/camlp4:= )"
RDEPEND="${DEPEND}"
DOCS=( CHANGES README.md )
+PATCHES=( "${FILESDIR}/uutf.patch" )
src_configure() {
oasis_configure_opts="