From: Daniel Dickman Subject: [update] devel/ocaml-parmap 1.0-rc10 -> 1.2.4 To: ports@openbsd.org Date: Tue, 9 Jun 2026 21:59:49 -0400 Update ocaml-parmap to 1.2.4 for ocaml 5.x support. The port also switches from ocamlbuild to dune as the build system. There are no reverse deps. ok? Index: Makefile =================================================================== RCS file: /cvs/ports/devel/ocaml-parmap/Makefile,v diff -u -p -u -r1.20 Makefile --- Makefile 24 Apr 2024 17:10:05 -0000 1.20 +++ Makefile 10 Jun 2026 01:55:30 -0000 @@ -1,14 +1,13 @@ COMMENT = OCaml parallel map primitive for multicores -CATEGORIES = devel -V = 1.0-rc10 -REVISION = 7 -NAME = ocaml-parmap -DISTNAME = ocaml-parmap-$V -DISTFILES = ${DISTNAME}{$V}.tar.gz -WRKDIST = ${WRKDIR}/parmap-$V -PKGNAME = ocaml-parmap-${V:S/-//} -SITES = ${HOMEPAGE}/archive/ +V = 1.2.4 +DISTNAME = parmap-${V} +EXTRACT_SUFX = .tbz +PKGNAME = ocaml-parmap-${V} + +SITES = https://github.com/rdicosmo/parmap/releases/download/${V}/ + +CATEGORIES = devel HOMEPAGE = https://github.com/rdicosmo/parmap @@ -16,15 +15,20 @@ HOMEPAGE = https://github.com/rdicosmo/p PERMIT_PACKAGE = Yes MODULES = lang/ocaml -BUILD_DEPENDS = sysutils/findlib devel/ocaml-ocamlbuild -USE_GMAKE = Yes -CONFIGURE_STYLE = gnu +BUILD_DEPENDS = devel/dune + +pre-build: + find ${WRKSRC} -type f -name '*.ml*' \ + -exec perl -pi -e 's/\bPrintf\.kprintf\b/Printf.ksprintf/g' {} + -FAKE_FLAGS = DESTDIR=${WRKINST}${TRUEPREFIX} +do-build: + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} dune build -j ${MAKE_JOBS} -TEST_TARGET = tests -TEST_DEPENDS = ${BASE_PKGPATH} +do-install: + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} DESTDIR="${WRKINST}" dune install -j ${MAKE_JOBS} +do-test: + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} dune test .include Index: distinfo =================================================================== RCS file: /cvs/ports/devel/ocaml-parmap/distinfo,v diff -u -p -u -r1.4 distinfo --- distinfo 19 Jun 2019 09:18:18 -0000 1.4 +++ distinfo 10 Jun 2026 01:55:30 -0000 @@ -1,2 +1,2 @@ -SHA256 (ocaml-parmap-1.0-rc10.tar.gz) = crjIsRFCqNvTyBwMZqx6hQhKYU+S8pX/IZVxBwPfywo= -SIZE (ocaml-parmap-1.0-rc10.tar.gz) = 99391 +SHA256 (parmap-1.2.4.tbz) = BTkSEjIK3CVNloJACFo6eQ6Ob9o/cdrA9xuv87NKas4= +SIZE (parmap-1.2.4.tbz) = 37001 Index: patches/patch-bytearray_ml =================================================================== RCS file: patches/patch-bytearray_ml diff -N patches/patch-bytearray_ml --- patches/patch-bytearray_ml 11 Mar 2022 18:50:53 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -Index: bytearray.ml ---- bytearray.ml.orig -+++ bytearray.ml -@@ -61,7 +61,9 @@ let of_string s = - - let mmap_of_string fd s = - let l = String.length s in -- let ba = Bigarray.Array1.map_file fd Bigarray.char Bigarray.c_layout true l in -+ let ba = -+ Bigarray.array1_of_genarray @@ -+ Unix.map_file fd Bigarray.char Bigarray.c_layout true [|l|] in - unsafe_blit_from_string s 0 ba 0 l; - ba - (* Index: patches/patch-example_dune =================================================================== RCS file: patches/patch-example_dune diff -N patches/patch-example_dune --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-example_dune 10 Jun 2026 01:55:30 -0000 @@ -0,0 +1,19 @@ +Index: example/dune +--- example/dune.orig ++++ example/dune +@@ -1,14 +1 @@ +-(executable +- (name mandels) +- (modules mandels) +- (flags +- (:standard -w -3-27)) +- (libraries parmap graphics unix bigarray)) +- +-;(executable +-; (name mandels_sdl) +-; (public_name ocaml-parmap-mandels_sdl) +-; (modules mandels_sdl) +-; (flags +-; (:standard -w -3-27)) +-; (libraries parmap graphics unix bigarray sdl)) ++; disabled for package build Index: patches/patch-example_mandels_ml =================================================================== RCS file: patches/patch-example_mandels_ml diff -N patches/patch-example_mandels_ml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-example_mandels_ml 10 Jun 2026 01:55:30 -0000 @@ -0,0 +1,14 @@ +backport commit 058e74af1337e7fd0c655f29d5626cc944e61728 + +Index: example/mandels.ml +--- example/mandels.ml.orig ++++ example/mandels.ml +@@ -204,7 +204,7 @@ and track_rect x y oldimg = + (match oldimg with + None -> () + | Some (i,x,y) -> draw_image i x y); +- if w>0 & h>0 then ++ if w>0 && h>0 then + let i = get_image bx by w h in + (* draw the border _inside_ the area *) + draw_rect bx by (w-1) (h-1); Index: patches/patch-parmap_ml =================================================================== RCS file: patches/patch-parmap_ml diff -N patches/patch-parmap_ml --- patches/patch-parmap_ml 11 Mar 2022 18:50:53 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,35 +0,0 @@ -Index: parmap.ml ---- parmap.ml.orig -+++ parmap.ml -@@ -109,7 +109,8 @@ let redirect ?(path = (Printf.sprintf "/tmp/.parmap.%d - (* unmarshal from a mmap seen as a bigarray *) - let unmarshal fd = - let a = -- Bigarray.Array1.map_file fd Bigarray.char Bigarray.c_layout true (-1) in -+ Bigarray.array1_of_genarray @@ -+ Unix.map_file fd Bigarray.char Bigarray.c_layout true [|~-1|] in - let res = Bytearray.unmarshal a 0 in - Unix.close fd; - res -@@ -124,8 +125,9 @@ let unmarshal fd = - - on Linux kernels, we might allocate a mmapped memory area of huge_size - and marshal into it directly - -- let ba = Bigarray.Array1.map_file -- fd Bigarray.char Bigarray.c_layout true huge_size in -+ let ba = -+ Bigarray.array1_of_genarray @@ -+ Unix.map_file fd Bigarray.char Bigarray.c_layout true huge_size in - ignore(Bytearray.marshal_to_buffer ba 0 v [Marshal.Closures]); - Unix.close fd - -@@ -624,7 +626,8 @@ let init_shared_buffer a = - let size = Array.length a in - let fd = Utils.tempfd() in - let arr = -- Bigarray.Array1.map_file fd Bigarray.float64 Bigarray.c_layout true size in -+ Bigarray.array1_of_genarray @@ -+ Unix.map_file fd Bigarray.float64 Bigarray.c_layout true [|size|] in - - (* The mmap() function shall add an extra reference to the file associated - with the file descriptor fildes which is not removed by a subsequent Index: patches/patch-src_bytearray_stubs_c =================================================================== RCS file: patches/patch-src_bytearray_stubs_c diff -N patches/patch-src_bytearray_stubs_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_bytearray_stubs_c 10 Jun 2026 01:55:30 -0000 @@ -0,0 +1,74 @@ +backport commit 7325014e922b8c2c117f1e037184c13d90e2fd52 + + +Index: src/bytearray_stubs.c +--- src/bytearray_stubs.c.orig ++++ src/bytearray_stubs.c +@@ -13,15 +13,15 @@ CAMLprim value ml_marshal_to_bigarray(value v, value f + { + char *buf; + long len; +- output_value_to_malloc(v, flags, &buf, &len); +- return alloc_bigarray(BIGARRAY_UINT8 | BIGARRAY_C_LAYOUT | BIGARRAY_MANAGED, +- 1, buf, &len); ++ caml_output_value_to_malloc(v, flags, &buf, &len); ++ return caml_ba_alloc(CAML_BA_UINT8 | CAML_BA_C_LAYOUT | CAML_BA_MANAGED, ++ 1, buf, &len); + } + + CAMLprim value ml_marshal_to_bigarray_buffer(value b, value ofs, + value v, value flags) + { +- struct caml_bigarray *b_arr = Bigarray_val(b); ++ struct caml_ba_array *b_arr = Caml_ba_array_val(b); + return Val_long(caml_output_value_to_block(v, flags, Array_data (b_arr, ofs), + b_arr->dim[0] - Long_val(ofs))); + } +@@ -29,16 +29,16 @@ CAMLprim value ml_marshal_to_bigarray_buffer(value b, + + CAMLprim value ml_unmarshal_from_bigarray(value b, value ofs) + { +- struct caml_bigarray *b_arr = Bigarray_val(b); +- return input_value_from_block (Array_data (b_arr, ofs), +- b_arr->dim[0] - Long_val(ofs)); ++ struct caml_ba_array *b_arr = Caml_ba_array_val(b); ++ return caml_input_value_from_block (Array_data (b_arr, ofs), ++ b_arr->dim[0] - Long_val(ofs)); + } + + CAMLprim value ml_blit_string_to_bigarray + (value s, value i, value a, value j, value l) + { + const char *src = String_val(s) + Int_val(i); +- char *dest = Array_data(Bigarray_val(a), j); ++ char *dest = Array_data(Caml_ba_array_val(a), j); + memcpy(dest, src, Long_val(l)); + return Val_unit; + } +@@ -46,7 +46,7 @@ CAMLprim value ml_blit_string_to_bigarray + CAMLprim value ml_blit_bigarray_to_string + (value a, value i, value s, value j, value l) + { +- char *src = Array_data(Bigarray_val(a), i); ++ char *src = Array_data(Caml_ba_array_val(a), i); + char *dest = &Byte(String_val(s), Long_val(j)); + memcpy(dest, src, Long_val(l)); + return Val_unit; +@@ -57,7 +57,7 @@ CAMLprim value ml_blit_floatarray_to_bigarray + { + int w = 8; + char *src = Bp_val(fa) + Long_val(i)*w; +- char *dest = Floatarray_data(Bigarray_val(a), j); ++ char *dest = Floatarray_data(Caml_ba_array_val(a), j); + memcpy(dest, src, Long_val(l)*w); + return Val_unit; + } +@@ -66,7 +66,7 @@ CAMLprim value ml_blit_bigarray_to_floatarray + (value a, value i, value fa, value j, value l) + { + int w = 8; +- char *src = Floatarray_data(Bigarray_val(a), i); ++ char *src = Floatarray_data(Caml_ba_array_val(a), i); + char *dest = Bp_val(fa) + Long_val(j)*w; + memcpy(dest, src, Long_val(l)*w); + return Val_unit; Index: patches/patch-src_parmap_ml =================================================================== RCS file: patches/patch-src_parmap_ml diff -N patches/patch-src_parmap_ml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_parmap_ml 10 Jun 2026 01:55:30 -0000 @@ -0,0 +1,15 @@ +backport commit 67f3ca9318bdac8b0eb538aca07cf1dc9d75878e + +Index: src/parmap.ml +--- src/parmap.ml.orig ++++ src/parmap.ml +@@ -102,7 +102,8 @@ let reopen_out outchan path fname = + + (* send stdout and stderr to a file to avoid mixing output from different + cores, if enabled *) +-let redirect ?(path = (Printf.sprintf "/tmp/.parmap.%d" (Unix.getpid ()))) ~id = ++let[@warning "-16" (* unerasable-optional-argument *)] ++ redirect ?(path = (Printf.sprintf "/tmp/.parmap.%d" (Unix.getpid ()))) ~id = + reopen_out stdout path (Printf.sprintf "stdout.%d" id); + reopen_out stderr path (Printf.sprintf "stderr.%d" id);; + Index: pkg/PFRAG.dynlink-native =================================================================== RCS file: /cvs/ports/devel/ocaml-parmap/pkg/PFRAG.dynlink-native,v diff -u -p -u -r1.2 PFRAG.dynlink-native --- pkg/PFRAG.dynlink-native 11 Mar 2022 18:50:53 -0000 1.2 +++ pkg/PFRAG.dynlink-native 10 Jun 2026 01:55:30 -0000 @@ -1 +1 @@ -@bin lib/ocaml/parmap/parmap.cmxs +lib/ocaml/parmap/parmap.cmxs Index: pkg/PFRAG.native =================================================================== RCS file: /cvs/ports/devel/ocaml-parmap/pkg/PFRAG.native,v diff -u -p -u -r1.4 PFRAG.native --- pkg/PFRAG.native 11 Mar 2022 18:50:53 -0000 1.4 +++ pkg/PFRAG.native 10 Jun 2026 01:55:30 -0000 @@ -1,8 +1,8 @@ %%dynlink%% lib/ocaml/parmap/bytearray.cmx -lib/ocaml/parmap/myocamlbuild.cmx lib/ocaml/parmap/parmap.a lib/ocaml/parmap/parmap.cmx lib/ocaml/parmap/parmap.cmxa +lib/ocaml/parmap/parmap_compat.cmx lib/ocaml/parmap/parmap_utils.cmx lib/ocaml/parmap/setcore.cmx Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/devel/ocaml-parmap/pkg/PLIST,v diff -u -p -u -r1.5 PLIST --- pkg/PLIST 11 Mar 2022 18:50:53 -0000 1.5 +++ pkg/PLIST 10 Jun 2026 01:55:30 -0000 @@ -2,14 +2,34 @@ lib/ocaml/parmap/ lib/ocaml/parmap/META lib/ocaml/parmap/bytearray.cmi +lib/ocaml/parmap/bytearray.cmt +lib/ocaml/parmap/bytearray.cmti +lib/ocaml/parmap/bytearray.ml lib/ocaml/parmap/bytearray.mli -lib/ocaml/parmap/libparmap_stubs.a +lib/ocaml/parmap/dune-package +@static-lib lib/ocaml/parmap/libparmap_stubs.a +lib/ocaml/parmap/opam lib/ocaml/parmap/parmap.cma lib/ocaml/parmap/parmap.cmi +lib/ocaml/parmap/parmap.cmt +lib/ocaml/parmap/parmap.cmti +lib/ocaml/parmap/parmap.ml lib/ocaml/parmap/parmap.mli +lib/ocaml/parmap/parmap_compat.cmi +lib/ocaml/parmap/parmap_compat.cmt +lib/ocaml/parmap/parmap_compat.ml lib/ocaml/parmap/parmap_utils.cmi +lib/ocaml/parmap/parmap_utils.cmt +lib/ocaml/parmap/parmap_utils.cmti +lib/ocaml/parmap/parmap_utils.ml lib/ocaml/parmap/parmap_utils.mli lib/ocaml/parmap/setcore.cmi -lib/ocaml/stublibs/dllparmap_stubs.so -@comment lib/ocaml/stublibs/dllparmap_stubs.so.owner -@man man/man3/Parmap.3o +lib/ocaml/parmap/setcore.cmt +lib/ocaml/parmap/setcore.ml +@so lib/ocaml/stublibs/dllparmap_stubs.so +share/doc/parmap/ +share/doc/parmap/CHANGES +share/doc/parmap/LICENSE +share/doc/parmap/README.md +share/doc/parmap/odoc-pages/ +share/doc/parmap/odoc-pages/index.mld