head 1.3; access; symbols pkgsrc-2022Q2:1.2.0.36 pkgsrc-2022Q2-base:1.2 pkgsrc-2022Q1:1.2.0.34 pkgsrc-2022Q1-base:1.2 pkgsrc-2021Q4:1.2.0.32 pkgsrc-2021Q4-base:1.2 pkgsrc-2021Q3:1.2.0.30 pkgsrc-2021Q3-base:1.2 pkgsrc-2021Q2:1.2.0.28 pkgsrc-2021Q2-base:1.2 pkgsrc-2021Q1:1.2.0.26 pkgsrc-2021Q1-base:1.2 pkgsrc-2020Q4:1.2.0.24 pkgsrc-2020Q4-base:1.2 pkgsrc-2020Q3:1.2.0.22 pkgsrc-2020Q3-base:1.2 pkgsrc-2020Q2:1.2.0.20 pkgsrc-2020Q2-base:1.2 pkgsrc-2020Q1:1.2.0.16 pkgsrc-2020Q1-base:1.2 pkgsrc-2019Q4:1.2.0.18 pkgsrc-2019Q4-base:1.2 pkgsrc-2019Q3:1.2.0.14 pkgsrc-2019Q3-base:1.2 pkgsrc-2019Q2:1.2.0.12 pkgsrc-2019Q2-base:1.2 pkgsrc-2019Q1:1.2.0.10 pkgsrc-2019Q1-base:1.2 pkgsrc-2018Q4:1.2.0.8 pkgsrc-2018Q4-base:1.2 pkgsrc-2018Q3:1.2.0.6 pkgsrc-2018Q3-base:1.2 pkgsrc-2018Q2:1.2.0.4 pkgsrc-2018Q2-base:1.2 pkgsrc-2018Q1:1.2.0.2 pkgsrc-2018Q1-base:1.2 pkgsrc-2017Q4:1.1.0.14 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.12 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.8 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.6 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.4 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.2 pkgsrc-2016Q3-base:1.1; locks; strict; comment @# @; 1.3 date 2022.06.29.07.54.41; author wiz; state dead; branches; next 1.2; commitid mi8IBwWu4raDmUJD; 1.2 date 2018.03.14.14.05.37; author dholland; state Exp; branches; next 1.1; commitid Krp8pmGYK0HVOquA; 1.1 date 2016.08.15.15.48.19; author jaapb; state Exp; branches; next ; commitid lqVAZUYd8mmfTpiz; desc @@ 1.3 log @camlp4: remove camlp4 is an outdated way to build packages with caml and does not work with pkgsrc ocaml versions for more than a year. Remove camlp4 and all packages using it. Ok jaapb@@ @ text @$NetBSD: patch-src_utils_lib_options.ml4,v 1.2 2018/03/14 14:05:37 dholland Exp $ Compile with OCaml 4.03 (is_printable changes) and 4.06 (string/bytes changes) --- src/utils/lib/options.ml4.dist 2013-07-07 10:56:43.000000000 +0000 +++ src/utils/lib/options.ml4 @@@@ -208,7 +208,7 @@@@ and parse_option = parser | [< 'Int i >] -> IntValue i | [< 'Float f >] -> FloatValue f | [< 'Kwd "@@"; 'Int i; v = parse_once_value i >] -> OnceValue v -| [< 'Char c >] -> StringValue (let s = String.create 1 in s.[0] <- c; s) +| [< 'Char c >] -> StringValue (String.make 1 c) | [< 'Kwd "["; v = parse_list [] >] -> List v | [< 'Kwd "("; v = parse_list [] >] -> List v @@@@ -332,8 +332,7 @@@@ let exit_exn = Exit let unsafe_get = String.unsafe_get -external is_printable : char -> bool = "caml_is_printable" -let unsafe_set = String.unsafe_set +let unsafe_set = Bytes.unsafe_set let escaped s = let n = ref 0 in @@@@ -343,31 +342,22 @@@@ let escaped s = (match unsafe_get s i with '"' | '\\' -> 2 | '\n' | '\t' -> 1 - | c -> if is_printable c then 1 else 4) + | c -> 1) done; if !n = String.length s then s else - let s' = String.create !n in + let s' = Bytes.create !n in n := 0; for i = 0 to String.length s - 1 do begin match unsafe_get s i with '"' | '\\' as c -> unsafe_set s' !n '\\'; incr n; unsafe_set s' !n c | '\n' | '\t' as c -> unsafe_set s' !n c | c -> - if is_printable c then unsafe_set s' !n c - else - let a = int_of_char c in - unsafe_set s' !n '\\'; - incr n; - unsafe_set s' !n (char_of_int (48 + a / 100)); - incr n; - unsafe_set s' !n (char_of_int (48 + a / 10 mod 10)); - incr n; - unsafe_set s' !n (char_of_int (48 + a mod 10)) + unsafe_set s' !n c end; incr n done; - s' + Bytes.to_string s' let safe_string s = if s = "" then "\"\"" @ 1.2 log @Partial build fixes for ocaml 4.06. not at all clear this thing is worth the trouble... @ text @d1 1 a1 1 $NetBSD: patch-src_utils_lib_options.ml4,v 1.1 2016/08/15 15:48:19 jaapb Exp $ @ 1.1 log @Added patches to net/mldonkey to make it compile with OCaml 4.03. Most of the patches were taken from the Gentoo ebuild at https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ddc06bf06bc144de45139545ff4eb6f660b443c with one pkgsrc-specific addition. There were no upstream changes. This (hopefully) fixes PR pkg/51397 @ text @d1 1 a1 1 $NetBSD$ d3 4 a6 2 Compile with OCaml 4.03 --- src/utils/lib/options.ml4.orig 2013-07-07 10:56:43.000000000 +0000 d8 10 a17 1 @@@@ -332,7 +332,6 @@@@ let exit_exn = Exit d22 2 a23 1 let unsafe_set = String.unsafe_set d26 2 a27 1 @@@@ -343,7 +342,7 @@@@ let escaped s = d36 5 a40 1 @@@@ -354,16 +353,7 @@@@ let escaped s = d58 5 @