pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/unison2.40 Fix build with ocaml 4.06.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3ddb3c47623e
branches:  trunk
changeset: 377236:3ddb3c47623e
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Wed Mar 14 11:16:14 2018 +0000

description:
Fix build with ocaml 4.06.

diffstat:

 net/unison2.40/distinfo                                     |   21 +-
 net/unison2.40/patches/patch-bytearray.ml                   |   68 +
 net/unison2.40/patches/patch-bytearray.mli                  |   17 +
 net/unison2.40/patches/patch-bytearray__stubs.c             |   29 +
 net/unison2.40/patches/patch-external.ml                    |   35 +
 net/unison2.40/patches/patch-fileutil.ml                    |   25 +
 net/unison2.40/patches/patch-fingerprint.ml                 |   24 +
 net/unison2.40/patches/patch-fpcache.ml                     |   50 +
 net/unison2.40/patches/patch-fspath.ml                      |   47 +
 net/unison2.40/patches/patch-lwt_generic_lwt__unix__impl.ml |   58 +
 net/unison2.40/patches/patch-lwt_lwt__unix.mli              |   23 +
 net/unison2.40/patches/patch-osx.ml                         |  112 ++
 net/unison2.40/patches/patch-path.ml                        |   35 +
 net/unison2.40/patches/patch-remote.ml                      |   87 +
 net/unison2.40/patches/patch-terminal.ml                    |   49 +
 net/unison2.40/patches/patch-test.ml                        |   18 +
 net/unison2.40/patches/patch-transfer.ml                    |  152 +++
 net/unison2.40/patches/patch-uicommon.ml                    |   27 +
 net/unison2.40/patches/patch-uitext.ml                      |   22 +
 net/unison2.40/patches/patch-unicode.ml                     |  546 ++++++++++++
 20 files changed, 1444 insertions(+), 1 deletions(-)

diffs (truncated from 1533 to 300 lines):

diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/distinfo
--- a/net/unison2.40/distinfo   Wed Mar 14 10:49:00 2018 +0000
+++ b/net/unison2.40/distinfo   Wed Mar 14 11:16:14 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.4 2017/07/14 12:59:23 joerg Exp $
+$NetBSD: distinfo,v 1.5 2018/03/14 11:16:14 dholland Exp $
 
 SHA1 (unison-2.40.128.tar.gz) = 392a573cbf331d71cac8ccb32f5440dceec88470
 RMD160 (unison-2.40.128.tar.gz) = ad3f4191af957aef1084e3ea9b99c17777e35596
@@ -6,4 +6,23 @@
 Size (unison-2.40.128.tar.gz) = 2717593 bytes
 SHA1 (patch-Makefile.OCaml) = 2872f07e323f23375b0b7ea5ec17fe387fe22a0f
 SHA1 (patch-aa) = dd1a001fb7071cd9141615b42a692e6d1d812081
+SHA1 (patch-bytearray.ml) = efe1e039f9f64c204229b0d6d483a480ce13dce7
+SHA1 (patch-bytearray.mli) = a93299b6880159c66b2e3feed2db10b53a99489f
+SHA1 (patch-bytearray__stubs.c) = 6ad17f3c6a581b749f1c6d52149377f908179290
+SHA1 (patch-external.ml) = 11198c37a72ee552e15f394a7f3b005ef1b4d392
+SHA1 (patch-fileutil.ml) = cfa84095f6a3d249d483fcf6aaeb18083ee3593d
+SHA1 (patch-fingerprint.ml) = 709e0ee1fa3ccdc22ac00421d0538e37f35c31b1
+SHA1 (patch-fpcache.ml) = 595791d3f9f40f058c449a361a6439088eed3121
+SHA1 (patch-fspath.ml) = 28b8b95b993c0bc764babe56190472eccadc0269
+SHA1 (patch-lwt_generic_lwt__unix__impl.ml) = f73bbd3a9b25a0fd22b946151b4b18150ad1d5a4
+SHA1 (patch-lwt_lwt__unix.mli) = 22875429a5fb31835f7c8c0a27473ea4d3030456
+SHA1 (patch-osx.ml) = a7bd0c11c7a49ec86fa277a128c6a887ac37f0b7
+SHA1 (patch-path.ml) = f48a08d01e2bfeff405d9a882cf6a4ab30bd48f4
+SHA1 (patch-remote.ml) = e1f6126be4eb784f1b37f61dda2068821d81ff11
 SHA1 (patch-system_system__generic.ml) = 02d4d678b8868a7237b0aecc3f4add74e1011fd0
+SHA1 (patch-terminal.ml) = f3c98c01361be18c97552037dc3b703419251f46
+SHA1 (patch-test.ml) = 989c23bb359fef8e8cee7df0f6cc0614b386f954
+SHA1 (patch-transfer.ml) = 4f7f2eb1621010a05a629809bb6c543a4a6e65af
+SHA1 (patch-uicommon.ml) = 54602d200323fd1d0eb18741fb06572846d434a4
+SHA1 (patch-uitext.ml) = c90c22671b54bdb6e9dd5db32ff6367dc7d4b2b8
+SHA1 (patch-unicode.ml) = 54d1e5e6c2c0c146698f11c558a6421d60f77a0f
diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/patches/patch-bytearray.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.40/patches/patch-bytearray.ml Wed Mar 14 11:16:14 2018 +0000
@@ -0,0 +1,68 @@
+$NetBSD: patch-bytearray.ml,v 1.1 2018/03/14 11:16:15 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- bytearray.ml~      2009-05-29 14:00:18.000000000 +0000
++++ bytearray.ml
+@@ -36,17 +36,20 @@ let unsafe_blit_to_string a i s j l =
+ *)
+ 
+ external unsafe_blit_from_string : string -> int -> t -> int -> int -> unit
+-  = "ml_blit_string_to_bigarray" "noalloc"
++  = "ml_blit_string_to_bigarray" [@@noalloc]
+ 
+-external unsafe_blit_to_string : t -> int -> string -> int -> int -> unit
+-  = "ml_blit_bigarray_to_string" "noalloc"
++external unsafe_blit_from_bytes : bytes -> int -> t -> int -> int -> unit
++  = "ml_blit_bytes_to_bigarray" [@@noalloc]
++
++external unsafe_blit_to_bytes : t -> int -> bytes -> int -> int -> unit
++  = "ml_blit_bigarray_to_bytes" [@@noalloc]
+ 
+ let to_string a =
+   let l = length a in
+   if l > Sys.max_string_length then invalid_arg "Bytearray.to_string" else
+-  let s = String.create l in
+-  unsafe_blit_to_string a 0 s 0 l;
+-  s
++  let s = Bytes.create l in
++  unsafe_blit_to_bytes a 0 s 0 l;
++  Bytes.to_string s
+ 
+ let of_string s =
+   let l = String.length s in
+@@ -60,9 +63,9 @@ let sub a ofs len =
+   then
+     invalid_arg "Bytearray.sub"
+   else begin
+-    let s = String.create len in
+-    unsafe_blit_to_string a ofs s 0 len;
+-    s
++    let s = Bytes.create len in
++    unsafe_blit_to_bytes a ofs s 0 len;
++    Bytes.to_string s
+   end
+ 
+ let rec prefix_rec a i a' i' l =
+@@ -81,11 +84,17 @@ let blit_from_string s i a j l =
+   then invalid_arg "Bytearray.blit_from_string"
+   else unsafe_blit_from_string s i a j l
+ 
+-let blit_to_string a i s j l =
++let blit_from_bytes s i a j l =
++  if l < 0 || i < 0 || i > Bytes.length s - l
++           || j < 0 || j > length a - l
++  then invalid_arg "Bytearray.blit_from_bytes"
++  else unsafe_blit_from_bytes s i a j l
++
++let blit_to_bytes a i s j l =
+   if l < 0 || i < 0 || i > length a - l
+-           || j < 0 || j > String.length s - l
+-  then invalid_arg "Bytearray.blit_to_string"
+-  else unsafe_blit_to_string a i s j l
++           || j < 0 || j > Bytes.length s - l
++  then invalid_arg "Bytearray.blit_to_bytes"
++  else unsafe_blit_to_bytes a i s j l
+ 
+ external marshal : 'a -> Marshal.extern_flags list -> t
+   = "ml_marshal_to_bigarray"
diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/patches/patch-bytearray.mli
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.40/patches/patch-bytearray.mli        Wed Mar 14 11:16:14 2018 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-bytearray.mli,v 1.1 2018/03/14 11:16:15 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- bytearray.mli~     2009-05-29 14:00:18.000000000 +0000
++++ bytearray.mli
+@@ -16,7 +16,9 @@ val sub : t -> int -> int -> string
+ 
+ val blit_from_string : string -> int -> t -> int -> int -> unit
+ 
+-val blit_to_string : t -> int -> string -> int -> int -> unit
++val blit_from_bytes : bytes -> int -> t -> int -> int -> unit
++
++val blit_to_bytes : t -> int -> bytes -> int -> int -> unit
+ 
+ val prefix : t -> t -> int -> bool
+ 
diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/patches/patch-bytearray__stubs.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.40/patches/patch-bytearray__stubs.c   Wed Mar 14 11:16:14 2018 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-bytearray__stubs.c,v 1.1 2018/03/14 11:16:15 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- bytearray_stubs.c~ 2009-05-29 14:00:18.000000000 +0000
++++ bytearray_stubs.c
+@@ -35,11 +35,20 @@ CAMLprim value ml_blit_string_to_bigarra
+   return Val_unit;
+ }
+ 
+-CAMLprim value ml_blit_bigarray_to_string
++CAMLprim value ml_blit_bytes_to_bigarray
++(value s, value i, value a, value j, value l)
++{
++  char *src = Bytes_val(s) + Int_val(i);
++  char *dest = Array_data(Bigarray_val(a), j);
++  memcpy(dest, src, Long_val(l));
++  return Val_unit;
++}
++
++CAMLprim value ml_blit_bigarray_to_bytes
+ (value a, value i, value s, value j, value l)
+ {
+   char *src = Array_data(Bigarray_val(a), i);
+-  char *dest = String_val(s) + Long_val(j);
++  char *dest = Bytes_val(s) + Long_val(j);
+   memcpy(dest, src, Long_val(l));
+   return Val_unit;
+ }
diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/patches/patch-external.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.40/patches/patch-external.ml  Wed Mar 14 11:16:14 2018 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-external.ml,v 1.1 2018/03/14 11:16:15 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- external.ml~       2010-04-15 17:29:31.000000000 +0000
++++ external.ml
+@@ -44,7 +44,7 @@ let readChannelTillEof_lwt c =
+       Some l -> loop (l :: lines)
+     | None   -> lines
+   in
+-  String.concat "\n" (Safelist.rev (loop []))
++  Bytes.concat (Bytes.of_string "\n") (Safelist.rev (loop []))
+ 
+ let readChannelsTillEof l =
+   let rec suckitdry lines c =
+@@ -58,7 +58,7 @@ let readChannelsTillEof l =
+   Lwt_util.map
+     (fun c ->
+        suckitdry [] c
+-       >>= (fun res -> return (String.concat "\n" (Safelist.rev res))))
++       >>= (fun res -> return (Bytes.concat (Bytes.of_string "\n") (Safelist.rev res))))
+     l
+ 
+ let runExternalProgram cmd =
+@@ -82,8 +82,8 @@ let runExternalProgram cmd =
+     readChannelsTillEof [out;err]
+     >>= (function [logOut;logErr] ->
+     let returnValue = System.close_process_full desc in
+-    let logOut = Util.trimWhitespace logOut in
+-    let logErr = Util.trimWhitespace logErr in
++    let logOut = Util.trimWhitespace (Bytes.to_string logOut) in
++    let logErr = Util.trimWhitespace (Bytes.to_string logErr) in
+     return (returnValue, (
+       (*  cmd
+       ^ "\n\n" ^ *)
diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/patches/patch-fileutil.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.40/patches/patch-fileutil.ml  Wed Mar 14 11:16:14 2018 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-fileutil.ml,v 1.1 2018/03/14 11:16:15 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- fileutil.ml~       2009-05-02 02:31:27.000000000 +0000
++++ fileutil.ml
+@@ -21,14 +21,14 @@ let backslashes2forwardslashes s0 =
+   try
+     ignore(String.index s0 '\\'); (* avoid alloc if possible *)
+     let n = String.length s0 in
+-    let s = String.create n in
++    let s = Bytes.create n in
+     for i = 0 to n-1 do
+       let c = String.get s0 i in
+       if c = '\\'
+-      then String.set s i '/'
+-      else String.set s i c
++      then Bytes.set s i '/'
++      else Bytes.set s i c
+     done;
+-    s
++    Bytes.to_string s
+   with Not_found -> s0
+ 
+ let rec removeTrailingSlashes s =
diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/patches/patch-fingerprint.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.40/patches/patch-fingerprint.ml       Wed Mar 14 11:16:14 2018 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-fingerprint.ml,v 1.1 2018/03/14 11:16:15 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- fingerprint.ml~    2009-05-02 02:31:27.000000000 +0000
++++ fingerprint.ml
+@@ -66,13 +66,13 @@ let hexaCode theChar =
+ 
+ let toString md5 =
+   let length = String.length md5 in
+-  let string = String.create (length * 2) in
++  let string = Bytes.create (length * 2) in
+   for i=0 to (length - 1) do
+     let c1, c2 =  hexaCode (md5.[i]) in
+-    string.[2*i] <- c1;
+-    string.[2*i + 1] <- c2;
++    Bytes.set string (2*i) c1;
++    Bytes.set string (2*i + 1) c2;
+   done;
+-  string
++  Bytes.to_string string
+ 
+ let string = Digest.string
+ 
diff -r 110208dc50bb -r 3ddb3c47623e net/unison2.40/patches/patch-fpcache.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.40/patches/patch-fpcache.ml   Wed Mar 14 11:16:14 2018 +0000
@@ -0,0 +1,50 @@
+$NetBSD: patch-fpcache.ml,v 1.1 2018/03/14 11:16:15 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- fpcache.ml~        2010-10-08 15:44:59.000000000 +0000
++++ fpcache.ml
+@@ -50,11 +50,12 @@ let state = ref None
+ 
+ let decompress st i path =
+   let l = String.length path in
+-  let s = String.create (l + i) in
++  let s = Bytes.create (l + i) in
+   String.blit !st 0 s 0 i;
+   String.blit path 0 s i l;
+-  st := s;
+-  s
++  let s' = Bytes.to_string s in
++  st := s';
++  s'
+ 
+ let compress state path =
+   let s = state.last in
+@@ -74,21 +75,21 @@ let read st ic =
+   let fp1 = Digest.input ic in
+   let fp2 = Digest.input ic in
+   let headerSize = Marshal.header_size in
+-  let header = String.create headerSize in
++  let header = Bytes.create headerSize in
+   really_input ic header 0 headerSize;
+-  if fp1 <> Digest.string header then begin
++  if fp1 <> Digest.string (Bytes.to_string header) then begin
+     debug (fun () -> Util.msg "bad header checksum\n");
+     raise End_of_file
+   end;
+   let dataSize = Marshal.data_size header 0 in
+-  let s = String.create (headerSize + dataSize) in
+-  String.blit header 0 s 0 headerSize;
++  let s = Bytes.create (headerSize + dataSize) in
++  Bytes.blit header 0 s 0 headerSize;
+   really_input ic s headerSize dataSize;
+-  if fp2 <> Digest.string s then begin



Home | Main Index | Thread Index | Old Index