pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/boomerang lang/boomerang: fix build with recent o...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d26f11d9b4a4
branches:  trunk
changeset: 457046:d26f11d9b4a4
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sun Aug 15 06:38:37 2021 +0000

description:
lang/boomerang: fix build with recent ocaml

diffstat:

 lang/boomerang/distinfo                            |   9 +-
 lang/boomerang/patches/patch-common_hbase_baker.ml |  32 +++++++
 lang/boomerang/patches/patch-common_hbase_memo.ml  |  33 +++++++
 lang/boomerang/patches/patch-common_hbase_misc.ml  |  92 ++++++++++++++++++++++
 lang/boomerang/patches/patch-common_ubase_uarg.ml  |  15 +++
 lang/boomerang/patches/patch-common_ubase_util.ml  |  15 +++
 lang/boomerang/patches/patch-src_bdiff3.ml         |  15 +++
 lang/boomerang/patches/patch-src_bstring.ml        |  22 +++++
 8 files changed, 232 insertions(+), 1 deletions(-)

diffs (270 lines):

diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/distinfo
--- a/lang/boomerang/distinfo   Sun Aug 15 06:10:45 2021 +0000
+++ b/lang/boomerang/distinfo   Sun Aug 15 06:38:37 2021 +0000
@@ -1,6 +1,13 @@
-$NetBSD: distinfo,v 1.2 2015/11/03 22:50:32 agc Exp $
+$NetBSD: distinfo,v 1.3 2021/08/15 06:38:37 dholland Exp $
 
 SHA1 (boomerang-0.2-source.tar.gz) = 4c6ca181b6f306c398a1bf3a0b96a6653ee80f98
 RMD160 (boomerang-0.2-source.tar.gz) = b0ebefa993fd8da041c9bb4b50da9eb378b218b3
 SHA512 (boomerang-0.2-source.tar.gz) = 25fb10e2f68002ea64edefa5b9c42f5db515727c7da676308f397d80b7d5052036c0405c3f3a6367eda5937bcaf2f6e15dd2077f0bcf5c214082250de926161f
 Size (boomerang-0.2-source.tar.gz) = 950116 bytes
+SHA1 (patch-common_hbase_baker.ml) = 23887e3421d955f0185d219973a880979c9e2c32
+SHA1 (patch-common_hbase_memo.ml) = 618c823d6087fba7196c175843acfa1acb1e3f1f
+SHA1 (patch-common_hbase_misc.ml) = 60f72a1c94d9ddb06e0dec505deb115bc0aafc47
+SHA1 (patch-common_ubase_uarg.ml) = f6e04d29a6fed5e0e34cd14e938ca111464df2ef
+SHA1 (patch-common_ubase_util.ml) = 9d9a05f7ce941f4a4e104499d60dc87378da42f3
+SHA1 (patch-src_bdiff3.ml) = 448401ffeb59407675df62b4442b564d34d00ea5
+SHA1 (patch-src_bstring.ml) = 2669c184461fa9df83ba82508510dab29ca41ac0
diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/patches/patch-common_hbase_baker.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/boomerang/patches/patch-common_hbase_baker.ml        Sun Aug 15 06:38:37 2021 +0000
@@ -0,0 +1,32 @@
+$NetBSD: patch-common_hbase_baker.ml,v 1.1 2021/08/15 06:38:38 dholland Exp $
+
+Fix build with current ocaml.
+Silence warning about archaic syntax.
+
+--- common/hbase/baker.ml~     2008-03-03 12:19:20.000000000 +0000
++++ common/hbase/baker.ml
+@@ -22,13 +22,13 @@ let go suffix l = 
+                   begin
+                     let fc = open_in f in
+                     let len = in_channel_length fc in 
+-                    let buf = String.create len in
++                    let buf = Bytes.create len in
+                       really_input fc buf 0 len;
+                       close_in fc;                 
+                       Hashtbl.replace 
+                         srcs 
+                         (Filename.chop_extension (Filename.basename f))
+-                        (String.escaped buf)
++                        (String.escaped (Bytes.to_string buf))
+                   end;
+                 loop rest
+             | Unix.S_DIR -> 
+@@ -36,7 +36,7 @@ let go suffix l = 
+                   try 
+                     let dc = Unix.readdir dh in
+                     let dn = sprintf "%s/%s" f dc in
+-                      dirloop dh (if dc = "." or dc =".." then fs else dn::fs)
++                      dirloop dh (if dc = "." || dc = ".." then fs else dn::fs)
+                   with End_of_file -> fs in 
+                 let dh = Unix.opendir f in
+                 let dcs = List.sort compare (dirloop dh []) in
diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/patches/patch-common_hbase_memo.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/boomerang/patches/patch-common_hbase_memo.ml Sun Aug 15 06:38:37 2021 +0000
@@ -0,0 +1,33 @@
+$NetBSD: patch-common_hbase_memo.ml,v 1.1 2021/08/15 06:38:38 dholland Exp $
+
+Fix build with current ocaml.
+
+--- common/hbase/memo.ml~      2007-12-10 17:19:28.000000000 +0000
++++ common/hbase/memo.ml
+@@ -92,7 +92,7 @@ let resize hashfun tbl =
+   let osize = Array.length odata in
+   let nsize = min (2 * osize + 1) Sys.max_array_length in
+   if nsize <> osize then begin
+-    let ndata = Array.create nsize Empty in
++    let ndata = Array.make nsize Empty in
+     let rec insert_bucket = function
+         Empty -> ()
+       | Cons(key, data, rest) ->
+@@ -530,7 +530,7 @@ module MakeLater(M:MemoType) = struct
+       None -> None 
+     | Some t -> (try Some (H.find t a) with Not_found -> None)
+ 
+-  let memoize f =
++  let memoize (f: M.arg -> M.res) =
+     if (Prefs.read memo_off || Safelist.mem M.name (Prefs.read memo_skip)) then f 
+     else gen_memoize M.name M.format_arg M.format_res 
+       H.find H.add get_table None f
+@@ -561,7 +561,7 @@ module MakeLater2(M:MemoType2) = struct
+       None -> None 
+     | Some t -> (try Some (H.find t a) with Not_found -> None)
+             
+-  let memoize f = 
++  let memoize (f: M.arg -> M.res) = 
+       if (Prefs.read memo_off || Safelist.mem M.name (Prefs.read memo_skip)) then f 
+       else 
+       gen_memoize M.name M.format_arg M.format_res 
diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/patches/patch-common_hbase_misc.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/boomerang/patches/patch-common_hbase_misc.ml Sun Aug 15 06:38:37 2021 +0000
@@ -0,0 +1,92 @@
+$NetBSD: patch-common_hbase_misc.ml,v 1.1 2021/08/15 06:38:38 dholland Exp $
+
+Fix build with current ocaml.
+
+--- common/hbase/misc.ml~      2009-08-17 20:39:00.000000000 +0000
++++ common/hbase/misc.ml
+@@ -207,20 +207,20 @@ let escape (escapeChar: char -> string) 
+   let result = 
+     if !n = String.length s then s else 
+     begin
+-      let s' = String.create !n in   
++      let s' = Bytes.create !n in   
+       n := 0;
+       for i = 0 to String.length s - 1 do 
+         let c = String.get s i in
+         let cEscaped = escapeChar c in
+         if String.length cEscaped = 1 then begin
+-          String.set s' !n c; incr n
++          Bytes.set s' !n c; incr n
+         end else
+           for i = 0 to String.length cEscaped - 1 do begin
+-            String.set s' !n (String.get cEscaped i);
++            Bytes.set s' !n (String.get cEscaped i);
+             incr n;
+           end done
+       done;
+-      s'
++      Bytes.to_string s'
+     end
+   in
+   debug(fun () -> Util.format "escape returns %s@\n" result);
+@@ -231,10 +231,10 @@ let generic_escape_char escapedchars c =
+   if c = '\\' then 
+     "\\\\"
+   else if String.contains escapedchars c then
+-    let str = String.create 2 in
+-    String.set str 0 '\\';
+-    String.set str 1 c;
+-    str
++    let str = Bytes.create 2 in
++    Bytes.set str 0 '\\';
++    Bytes.set str 1 c;
++    Bytes.to_string str
+   else
+     "-"
+ 
+@@ -251,20 +251,20 @@ let generic_unescape s =
+       else
+         loop (i + 1) (n + 1)
+     in
+-    let s' = String.create (loop 0 0) in
++    let s' = Bytes.create (loop 0 0) in
+     let rec loop i i' = 
+       if i >= String.length s then
+         ()
+       else if s.[i] = '\\' then begin
+-        s'.[i'] <- s.[i+1]; (* assumes that '\' always followed by a char *)
++        Bytes.set s' i' (String.get s (i+1)); (* assumes that '\' always followed by a char *)
+         loop (i + 2) (i' + 1)
+       end else begin
+-        s'.[i'] <- s.[i];
++        Bytes.set s' i' (String.get s i);
+         loop (i + 1) (i' + 1)
+       end
+     in
+     loop 0 0;
+-    s'
++    Bytes.to_string s'
+ 
+ (* find c, skipping all the escaped characters, e.g., "\;" *)
+ let rec index_rec_nonescape s i c = 
+@@ -511,9 +511,9 @@ let rec remove_file_or_dir d =
+ 
+ let read_chan chan =
+   let nbytes = in_channel_length chan in
+-  let string = String.create nbytes in
++  let string = Bytes.create nbytes in
+   really_input chan string 0 nbytes;
+-  string
++  Bytes.to_string string
+ 
+ let read file =
+   if file = "-" then
+@@ -584,7 +584,7 @@ let rec cp_dash_r fromhere tohere =
+ (* ### Should trap unix errors and do something sensible... *)
+ let backup path =
+   let newpath = backup_file_name path in
+-  if is_dir path or Sys.file_exists path then cp_dash_r path newpath
++  if is_dir path || Sys.file_exists path then cp_dash_r path newpath
+ 
+ (* exec : string -> string *)
+ let exec s = 
diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/patches/patch-common_ubase_uarg.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/boomerang/patches/patch-common_ubase_uarg.ml Sun Aug 15 06:38:37 2021 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-common_ubase_uarg.ml,v 1.1 2021/08/15 06:38:38 dholland Exp $
+
+Silence warning about archaic syntax.
+
+--- common/ubase/uarg.ml~      2007-03-26 13:07:39.000000000 +0000
++++ common/ubase/uarg.ml
+@@ -66,7 +66,7 @@ let parse speclist anonfun errmsg =
+   incr current;
+   while !current < l do
+     let ss = Sys.argv.(!current) in
+-    if String.length ss >= 1 & String.get ss 0 = '-' then begin
++    if String.length ss >= 1 && String.get ss 0 = '-' then begin
+       let args = Util.splitIntoWords ss '=' in
+       let s = Safelist.nth args 0 in
+       let arg conv mesg =
diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/patches/patch-common_ubase_util.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/boomerang/patches/patch-common_ubase_util.ml Sun Aug 15 06:38:37 2021 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-common_ubase_util.ml,v 1.1 2021/08/15 06:38:38 dholland Exp $
+
+Fix build with current ocaml.
+
+--- common/ubase/util.ml~      2007-03-26 13:07:39.000000000 +0000
++++ common/ubase/util.ml
+@@ -12,7 +12,7 @@ let nocase_cmp a b =
+     if i>=minlen then compare alen blen
+     else
+       let c =
+-        compare (Char.lowercase(String.get a i)) (Char.lowercase(String.get b i)) in
++        compare (Char.lowercase_ascii(String.get a i)) (Char.lowercase_ascii(String.get b i)) in
+       if c<>0 then c else loop (i+1) in
+   loop 0
+ let nocase_eq a b = (0 = (nocase_cmp a b))
diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/patches/patch-src_bdiff3.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/boomerang/patches/patch-src_bdiff3.ml        Sun Aug 15 06:38:37 2021 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bdiff3.ml,v 1.1 2021/08/15 06:38:38 dholland Exp $
+
+Silence compiler warning about archaic syntax.
+
+--- src/bdiff3.ml~     2009-08-03 16:53:28.000000000 +0000
++++ src/bdiff3.ml
+@@ -83,7 +83,7 @@ module Make(A: Diff3Arg) = struct
+            lcs_oa.(i)) 
+       lcs_oa;
+     let rec find_matches i j l = 
+-      if (i=0) or (j=0) then l
++      if (i=0) || (j=0) then l
+       else match lcs_aux.(i).(j) with  
+         | Diag -> find_matches (i-1) (j-1) ((i-1,j-1)::l)  
+         | Top  -> find_matches (i-1) j l    
diff -r 0e16db51bd98 -r d26f11d9b4a4 lang/boomerang/patches/patch-src_bstring.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/boomerang/patches/patch-src_bstring.ml       Sun Aug 15 06:38:37 2021 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_bstring.ml,v 1.1 2021/08/15 06:38:38 dholland Exp $
+
+Fix build with current ocaml.
+
+--- src/bstring.ml~    2009-08-26 19:28:59.000000000 +0000
++++ src/bstring.ml
+@@ -236,12 +236,12 @@ let dist_limit_aux limit s t =
+ 
+ let rev_s s =
+   let n = String.length s in
+-  let t = String.make n '\000' in
++  let t = Bytes.make n '\000' in
+   let rec loop x y =
+     if x >= n
+-    then t
++    then Bytes.to_string t
+     else (
+-      String.set t x s.[y];
++      Bytes.set t x (String.get s y);
+       loop (succ x) (pred y)
+     )
+   in



Home | Main Index | Thread Index | Old Index