pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/time/wyrd Fix build with ocaml 4.06.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0749a09ddcce
branches:  trunk
changeset: 377228:0749a09ddcce
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Wed Mar 14 09:14:05 2018 +0000

description:
Fix build with ocaml 4.06.

diffstat:

 time/wyrd/distinfo                 |   3 +-
 time/wyrd/patches/patch-utility.ml |  39 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletions(-)

diffs (57 lines):

diff -r cc48a6690037 -r 0749a09ddcce time/wyrd/distinfo
--- a/time/wyrd/distinfo        Wed Mar 14 09:08:45 2018 +0000
+++ b/time/wyrd/distinfo        Wed Mar 14 09:14:05 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2015/11/02 23:31:46 agc Exp $
+$NetBSD: distinfo,v 1.7 2018/03/14 09:14:05 dholland Exp $
 
 SHA1 (wyrd-1.4.6.tar.gz) = aaeca29b844825f45aadcf5207f4d1c875e4dc82
 RMD160 (wyrd-1.4.6.tar.gz) = 47319812942195d4b56f861b7cbb527e94e7495f
@@ -6,3 +6,4 @@
 Size (wyrd-1.4.6.tar.gz) = 425829 bytes
 SHA1 (patch-Makefile.in) = 0dbd5042fa40810a76cb89b677ce3a71ececde9e
 SHA1 (patch-curses_Makefile.in) = 26602a2b71bacd37555ad6a1c3966f7b25721f34
+SHA1 (patch-utility.ml) = 529b15bc306bddf41992a299001966e00f631e69
diff -r cc48a6690037 -r 0749a09ddcce time/wyrd/patches/patch-utility.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/wyrd/patches/patch-utility.ml        Wed Mar 14 09:14:05 2018 +0000
@@ -0,0 +1,39 @@
+$NetBSD: patch-utility.ml,v 1.1 2018/03/14 09:14:05 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- utility.ml~        2013-02-03 03:40:39.000000000 +0000
++++ utility.ml
+@@ -270,7 +270,7 @@ let read_all_shell_command_output shell_
+          let (read_list, _, _) = Unix.select (out_lst @ err_lst) [] [] (10.0) in
+          if List.length read_list > 0 then begin
+             let chan = List.hd read_list in
+-            let buf = String.make 256 ' ' in
++            let buf = Bytes.make 256 ' ' in
+             let chars_read = Unix.read chan buf 0 256 in
+             if chars_read = 0 then
+                (* no chars read indicates EOF *)
+@@ -281,7 +281,7 @@ let read_all_shell_command_output shell_
+             else
+                (* if 1-256 characters are read, append them to the proper
+                 * buffer and continue *)
+-               let s = String.sub buf 0 chars_read in
++               let s = Bytes.to_string (Bytes.sub buf 0 chars_read) in
+                if chan = out_read then
+                   read_output (out_str ^ s) err_str out_done err_done
+                else
+@@ -354,11 +354,11 @@ let utf8_string_before s n =
+          substr
+       else
+          let num_new_bytes = utf8_width s.[byte_pos] in
+-         let new_bytes = String.make num_new_bytes s.[byte_pos] in
++         let new_bytes = Bytes.make num_new_bytes s.[byte_pos] in
+          for i = 1 to pred num_new_bytes do
+-            new_bytes.[i] <- s.[byte_pos + i]
++            Bytes.set new_bytes i s.[byte_pos + i]
+          done;
+-         build_substr (substr ^ new_bytes) (succ utf8_pos) 
++         build_substr (substr ^ (Bytes.to_string new_bytes)) (succ utf8_pos) 
+             (byte_pos + num_new_bytes)
+    in
+    if Curses.Curses_config.wide_ncurses then



Home | Main Index | Thread Index | Old Index