pkgsrc-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/pkgsrc/rev/81023e5c6728
branches:  trunk
changeset: 377233:81023e5c6728
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Wed Mar 14 10:16:03 2018 +0000

description:
Fix build with ocaml 4.06

diffstat:

 net/unison2.32/Makefile                         |    5 +-
 net/unison2.32/distinfo                         |   18 +++-
 net/unison2.32/patches/patch-bytearray.ml       |   68 ++++++++++++
 net/unison2.32/patches/patch-bytearray.mli      |   17 +++
 net/unison2.32/patches/patch-bytearray__stubs.c |   29 +++++
 net/unison2.32/patches/patch-case.ml            |   30 +++++
 net/unison2.32/patches/patch-fileutil.ml        |   25 ++++
 net/unison2.32/patches/patch-fingerprint.ml     |   24 ++++
 net/unison2.32/patches/patch-fspath.ml          |   30 +++++
 net/unison2.32/patches/patch-lwt_lwt__unix.ml   |   93 +++++++++++++++++
 net/unison2.32/patches/patch-lwt_lwt__unix.mli  |   28 +++++
 net/unison2.32/patches/patch-osx.ml             |  128 ++++++++++++++++++++++++
 net/unison2.32/patches/patch-path.ml            |   35 ++++++
 net/unison2.32/patches/patch-remote.ml          |   95 +++++++++++++++++
 net/unison2.32/patches/patch-terminal.ml        |   49 +++++++++
 net/unison2.32/patches/patch-test.ml            |   18 +++
 net/unison2.32/patches/patch-transfer.ml        |  124 +++++++++++++++++++++++
 net/unison2.32/patches/patch-uicommon.ml        |   27 +++++
 18 files changed, 841 insertions(+), 2 deletions(-)

diffs (truncated from 932 to 300 lines):

diff -r b6f93ca31c5d -r 81023e5c6728 net/unison2.32/Makefile
--- a/net/unison2.32/Makefile   Wed Mar 14 09:59:22 2018 +0000
+++ b/net/unison2.32/Makefile   Wed Mar 14 10:16:03 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.63 2018/03/12 11:17:24 wiz Exp $
+# $NetBSD: Makefile,v 1.64 2018/03/14 10:16:03 dholland Exp $
 
 DISTNAME=      unison-2.32.52
 PKGREVISION=   64
@@ -19,6 +19,9 @@
 MAKE_FLAGS+=   CFLAGS=""
 MAKE_ENV+=     HOME=${WRKDIR:Q}
 
+# with -j, runs only about half the build and then stops
+MAKE_JOBS_SAFE=        no
+
 .include "options.mk"
 .include "../../mk/bsd.prefs.mk"
 
diff -r b6f93ca31c5d -r 81023e5c6728 net/unison2.32/distinfo
--- a/net/unison2.32/distinfo   Wed Mar 14 09:59:22 2018 +0000
+++ b/net/unison2.32/distinfo   Wed Mar 14 10:16:03 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.2 2015/11/04 00:35:42 agc Exp $
+$NetBSD: distinfo,v 1.3 2018/03/14 10:16:03 dholland Exp $
 
 SHA1 (unison-2.32.52.tar.gz) = 68ea5709de4fcc2f9aef7b01b24637503b61b5ac
 RMD160 (unison-2.32.52.tar.gz) = 8216a2e482d5a445dd7acdb62e1bb6377e90d1a1
@@ -6,3 +6,19 @@
 Size (unison-2.32.52.tar.gz) = 697866 bytes
 SHA1 (patch-aa) = d59adf3446ea3f98f4ab72274b95b1140d3cf896
 SHA1 (patch-ab) = 29a2bc3842be7bb1bde7372dfeca2a5c5b4acdef
+SHA1 (patch-bytearray.ml) = efe1e039f9f64c204229b0d6d483a480ce13dce7
+SHA1 (patch-bytearray.mli) = a93299b6880159c66b2e3feed2db10b53a99489f
+SHA1 (patch-bytearray__stubs.c) = 6ad17f3c6a581b749f1c6d52149377f908179290
+SHA1 (patch-case.ml) = 20721eb771af7a446961af5a2e1c9bcb958a87dc
+SHA1 (patch-fileutil.ml) = cfa84095f6a3d249d483fcf6aaeb18083ee3593d
+SHA1 (patch-fingerprint.ml) = 709e0ee1fa3ccdc22ac00421d0538e37f35c31b1
+SHA1 (patch-fspath.ml) = d4929f4bf127100ca400de1c0f3a560975cfdb96
+SHA1 (patch-lwt_lwt__unix.ml) = 61196ccbb2b4f689698f2cab3079ed40984f2773
+SHA1 (patch-lwt_lwt__unix.mli) = 0e9d553cced1ff8c86188e6a4b9acd5963c26e6f
+SHA1 (patch-osx.ml) = d90bf2df6f15883c692b1dcfcbba461ca955c345
+SHA1 (patch-path.ml) = f48a08d01e2bfeff405d9a882cf6a4ab30bd48f4
+SHA1 (patch-remote.ml) = 5e275cbc374b2ff519f69e7656a205009f7160d5
+SHA1 (patch-terminal.ml) = 1e84fb39df5e4d5a1df39a1cc35879d73369ca3c
+SHA1 (patch-test.ml) = 6a23b78ad5270bb7ad9c7dcf9b043b44a090f611
+SHA1 (patch-transfer.ml) = fd33382fa283e25a705659651105b74f290431f9
+SHA1 (patch-uicommon.ml) = 54602d200323fd1d0eb18741fb06572846d434a4
diff -r b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-bytearray.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.32/patches/patch-bytearray.ml Wed Mar 14 10:16:03 2018 +0000
@@ -0,0 +1,68 @@
+$NetBSD: patch-bytearray.ml,v 1.1 2018/03/14 10:16:03 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 b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-bytearray.mli
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.32/patches/patch-bytearray.mli        Wed Mar 14 10:16:03 2018 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-bytearray.mli,v 1.1 2018/03/14 10:16:03 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 b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-bytearray__stubs.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.32/patches/patch-bytearray__stubs.c   Wed Mar 14 10:16:03 2018 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-bytearray__stubs.c,v 1.1 2018/03/14 10:16:03 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 b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-case.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.32/patches/patch-case.ml      Wed Mar 14 10:16:03 2018 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-case.ml,v 1.1 2018/03/14 10:16:03 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- case.ml~   2009-05-29 12:54:25.000000000 +0000
++++ case.ml
+@@ -56,19 +56,19 @@ let needNormalization s =
+ 
+ let removeTrailingDots s =
+   let len = String.length s in
+-  let s' = String.create len in
++  let s' = Bytes.create len in
+   let pos = ref (len - 1) in
+   let pos' = ref (len - 1) in
+   while !pos >= 0 do
+     while !pos >= 0 && s.[!pos] = '.' do decr pos done;
+     while !pos >= 0 && s.[!pos] <> '/' do
+-      s'.[!pos'] <- s.[!pos]; decr pos; decr pos'
++      Bytes.set s' !pos' s.[!pos]; decr pos; decr pos'
+     done;
+     while !pos >= 0 && s.[!pos] = '/' do
+-      s'.[!pos'] <- s.[!pos]; decr pos; decr pos'
++      Bytes.set s' !pos' s.[!pos]; decr pos; decr pos'
+     done
+   done;
+-  String.sub s' (!pos' + 1) (len - !pos' - 1)
++  Bytes.to_string (Bytes.sub s' (!pos' + 1) (len - !pos' - 1))
+ 
+ (* Dots are ignored at the end of filenames under Windows. *)
+ let normalize s =
diff -r b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-fileutil.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.32/patches/patch-fileutil.ml  Wed Mar 14 10:16:03 2018 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-fileutil.ml,v 1.1 2018/03/14 10:16:03 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 b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-fingerprint.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.32/patches/patch-fingerprint.ml       Wed Mar 14 10:16:03 2018 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-fingerprint.ml,v 1.1 2018/03/14 10:16:03 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 b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-fspath.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unison2.32/patches/patch-fspath.ml    Wed Mar 14 10:16:03 2018 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-fspath.ml,v 1.1 2018/03/14 10:16:03 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- fspath.ml~ 2009-05-02 02:31:27.000000000 +0000
++++ fspath.ml
+@@ -50,7 +50,7 @@ let winRootFix d =
+ (* least distinguishing suffixes of two fspaths, for displaying in the user  *)
+ (* interface.                                                                *)
+ let differentSuffix (Fspath f1) (Fspath f2) =
+-  if isRootDir f1 or isRootDir f2 then (f1,f2)
++  if isRootDir f1 || isRootDir f2 then (f1,f2)
+   else begin
+     (* We use the invariant that neither f1 nor f2 ends in slash             *)
+     let len1 = String.length f1 in
+@@ -180,11 +180,11 @@ let concat fspath path =
+       let p = Path.toString path in
+       let l = String.length fspath in
+       let l' = String.length p in
+-      let s = String.create (l + l' + 1) in
++      let s = Bytes.create (l + l' + 1) in
+       String.blit fspath 0 s 0 l;
+-      s.[l] <- '/';
++      Bytes.set s l '/';
+       String.blit p 0 s (l + 1) l';
+-      Fspath s
++      Fspath (Bytes.to_string s)
+   end
+ 
+ (* Filename.dirname is screwed up in Windows so we use this function.  It    *)
diff -r b6f93ca31c5d -r 81023e5c6728 net/unison2.32/patches/patch-lwt_lwt__unix.ml



Home | Main Index | Thread Index | Old Index