diff options
author | Benjamin Jacobs <freebsd@dev.thsi.be> | 2024-03-11 22:43:46 +0100 |
---|---|---|
committer | Guido Falsi <madpilot@FreeBSD.org> | 2024-03-11 22:50:58 +0100 |
commit | 8025aa10ceb960b62c9a826fb56eb1ac68ea1ce3 (patch) | |
tree | 959847a64e64c876f5bdd4c254c22f44ca3ff372 /net | |
parent | security/dirmngr: Moved man to share/man (diff) |
lang/ocaml: Update to 4.14.1
The 'force-safe-string; setting is NOT enabled, as opposed to the
new upstream default. OCaml users are encouraged to migrate to safe
strings as soon as possible.
- The X11 library isn't part of lang/ocaml anymore, users should
install x11-toolkits/ocaml-graphics.
- Add new 'ocaml' USES
- Bump PORTREVISION on dependent ports, due to ABI Change.
The update includes the following updates to existing ports (needed
to keep them working):
- devel/ocaml-camlp4: Updated to 4.14+1
- devel/ocaml-camlp5: Updated to 8.02.01, homepage updated
- devel/ocaml-dune: Patch to allow overriding the stublibs directory,
strip binary and shared libraries
- devel/ocaml-findlib: Improve port
- devel/ocaml-lwt: Fix build with OCaml 4.14
- deve/ocaml-re: Update to 1.11.0, use new dune USES
- devel/ocaml-sdl: Fix build with new ocaml
- games/freetennis: Fix build, tidy Makefile
- graphics/ocaml-images: Updated to 5.0.4, new homepage, use new
dune USES, undeprecate
- graphics/ocaml-lablgl: Moved into site-lib, dynamic objects
stripped, add missing GL dependencies
- math/coq: Updated to 8.19.0
- math/ocaml-zarith: strip shared libraries, fixed usage of
USE_OCAML_LDCONFIG, use new dune USES
- math/teyjus: Fix build
- net/unison240: Fix build with new compiler
- net/unison248: Fix build with new compiler, add MAKE_JOBS_UNSAFE
- net-p2p/mldonkey: Fix build with new compiler, fix build on i386
- sysutils/ledit: Updated to 2.06, install native binary, Use github,
fix man page installation
- www/geneweb: Build fix for OCaml and Camlp5 updates
- x11-toolkits/ocaml-lablgtk2: Fix build with new compiler
- x11-toolkits/ocaml-lablgtk3: Updated to 3.1.4, added ocaml-camlp-stream
dependency, build fix patch
- x11-toolkits/ocaml-labltk: Updated to 8.06.12, Improve Makefile
Added the following ports:
- devel/ocaml-astring
- devel/ocaml-base
- devel/ocaml-bos
- devel/ocaml-camlp-streams
- devel/ocaml-csexp
- devel/ocaml-fmt
- devel/ocaml-fpath
- devel/ocaml-logs
- devel/ocaml-mtime
- devel/ocaml-pcre2
- devel/ocaml-rresult
- devel/ocaml-seq
- devel/ocaml-stdio
- x11-toolkits/ocaml-graphics
PR: 250408 [1], 262781 [1], 262788 [3], 262789 [1],
262792 [1], 263006 [1], 263162 [3], 263206 [2],
276893 [1], 276945 [4], 276953 [1], 277026 [5],
277241 [1], 277242 [1], 277243 [1], 277244 [1],
277245 [1], 277246 [1], 277247 [1], 277248 [1],
277249 [1], 277250 [1], 277251 [1], 277252 [1],
277253 [1], 277254 [1], 277255 [1], 277256 [4],
277257 [1], 277258 [1]
Approved by: maintainer timeout [1],
yuri (maintainer) [2],
overcome by events, fixit [3],
madpilot (maintainer) [4]
Reviewed by: madpilot
Exp-run by: antoine [5]
Differential Revision: https://reviews.freebsd.org/D43861
Diffstat (limited to 'net')
-rw-r--r-- | net/unison240/files/patch-Makefile.OCaml | 15 | ||||
-rw-r--r-- | net/unison240/files/patch-hash__compat.c | 168 | ||||
-rw-r--r-- | net/unison240/files/patch-uutil.ml | 11 | ||||
-rw-r--r-- | net/unison248/Makefile | 1 | ||||
-rw-r--r-- | net/unison248/files/patch-Makefile.OCaml | 15 | ||||
-rw-r--r-- | net/unison248/files/patch-hash__compat.c | 168 | ||||
-rw-r--r-- | net/unison248/files/patch-uutil.ml | 11 |
7 files changed, 383 insertions, 6 deletions
diff --git a/net/unison240/files/patch-Makefile.OCaml b/net/unison240/files/patch-Makefile.OCaml index dfd96642b5e9..624f4afe967d 100644 --- a/net/unison240/files/patch-Makefile.OCaml +++ b/net/unison240/files/patch-Makefile.OCaml @@ -1,6 +1,6 @@ --- Makefile.OCaml.orig 2014-12-30 02:21:28 UTC +++ Makefile.OCaml -@@ -72,7 +72,7 @@ OCAMLLIBDIR=$(shell ocamlc -v | tail -1 | sed -e 's/.* +@@ -72,7 +72,7 @@ LABLGTKLIB=$(OCAMLLIBDIR)/lablgtk # This should be set to an appropriate value automatically, depending # on whether the lablgtk library is available LABLGTKLIB=$(OCAMLLIBDIR)/lablgtk @@ -9,7 +9,7 @@ ##BCP [3/2007]: Removed temporarily, since the OSX UI is not working well ## at the moment and we don't want to confuse people by building it by default ifeq ($(OSARCH),osx) -@@ -91,7 +91,7 @@ buildexecutable:: +@@ -91,7 +91,7 @@ INCLFLAGS=-I lwt -I ubase -I system ### Default parameters INCLFLAGS=-I lwt -I ubase -I system @@ -18,7 +18,16 @@ CAMLFLAGS+=-I system/$(SYSTEM) -I lwt/$(SYSTEM) ifeq ($(OSARCH),win32) -@@ -292,7 +292,7 @@ endif +@@ -233,7 +233,7 @@ OCAMLLIBS+=unix.cma str.cma bigarray.cma + # File extensions will be substituted for the native code version + OCAMLLIBS+=unix.cma str.cma bigarray.cma + +-COBJS+=osxsupport$(OBJ_EXT) pty$(OBJ_EXT) bytearray_stubs$(OBJ_EXT) ++COBJS+=osxsupport$(OBJ_EXT) pty$(OBJ_EXT) bytearray_stubs$(OBJ_EXT) hash_compat$(OBJ_EXT) + + ######################################################################## + ### User Interface setup +@@ -292,7 +292,7 @@ ifeq ($(UISTYLE), gtk2) # Gtk2 GUI ifeq ($(UISTYLE), gtk2) diff --git a/net/unison240/files/patch-hash__compat.c b/net/unison240/files/patch-hash__compat.c new file mode 100644 index 000000000000..ba746e41d22b --- /dev/null +++ b/net/unison240/files/patch-hash__compat.c @@ -0,0 +1,168 @@ +--- hash_compat.c.orig 2024-02-06 20:29:47 UTC ++++ hash_compat.c +@@ -0,0 +1,165 @@ ++/* The pre-OCaml 4.00 hash implementation */ ++/* FIXME: This is included for backwards compatibility only and must be ++ * REMOVED when a new hash function included in a stable release has been ++ * available for a few years. The removal of this function will break ++ * Unison version compatibility. There must be plenty of time given ++ * for users to upgrade (most users don't compile themselves and are at ++ * mercy of whatever package repositories they use). */ ++ ++/* Code copied from OCaml sources */ ++/**************************************************************************/ ++/* */ ++/* OCaml */ ++/* */ ++/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ ++/* */ ++/* Copyright 1996 Institut National de Recherche en Informatique et */ ++/* en Automatique. */ ++/* */ ++/* All rights reserved. This file is distributed under the terms of */ ++/* the GNU Lesser General Public License version 2.1, with the */ ++/* special exception on linking described in the file LICENSE. */ ++/* */ ++/**************************************************************************/ ++ ++#include <caml/mlvalues.h> ++#include <caml/custom.h> ++#include <caml/address_class.h> ++ ++struct hash_state { ++ uintnat accu; ++ intnat univ_limit, univ_count; ++}; ++ ++static void hash_aux(struct hash_state*, value obj); ++ ++CAMLprim value unsn_hash_univ_param(value count, value limit, value obj) ++{ ++ struct hash_state h; ++ h.univ_limit = Long_val(limit); ++ h.univ_count = Long_val(count); ++ h.accu = 0; ++ hash_aux(&h, obj); ++ return Val_long(h.accu & 0x3FFFFFFF); ++ /* The & has two purposes: ensure that the return value is positive ++ and give the same result on 32 bit and 64 bit architectures. */ ++} ++ ++#define Alpha 65599 ++#define Beta 19 ++#define Combine(new) (h->accu = h->accu * Alpha + (new)) ++#define Combine_small(new) (h->accu = h->accu * Beta + (new)) ++ ++static void hash_aux(struct hash_state* h, value obj) ++{ ++ unsigned char * p; ++ mlsize_t i, j; ++ tag_t tag; ++ ++ h->univ_limit--; ++ if (h->univ_count < 0 || h->univ_limit < 0) return; ++ ++ again: ++ if (Is_long(obj)) { ++ h->univ_count--; ++ Combine(Long_val(obj)); ++ return; ++ } ++ if (! Is_in_value_area(obj)) { ++ /* obj is a pointer outside the heap, to an object with ++ a priori unknown structure. Use its physical address as hash key. */ ++ Combine((intnat) obj); ++ return; ++ } ++ /* Pointers into the heap are well-structured blocks. So are atoms. ++ We can inspect the block contents. */ ++ /* The code needs reindenting later. Leaving as is to facilitate review. */ ++ tag = Tag_val(obj); ++ switch (tag) { ++ case String_tag: ++ h->univ_count--; ++ i = caml_string_length(obj); ++ for (p = &Byte_u(obj, 0); i > 0; i--, p++) ++ Combine_small(*p); ++ break; ++ case Double_tag: ++ /* For doubles, we inspect their binary representation, LSB first. ++ The results are consistent among all platforms with IEEE floats. */ ++ h->univ_count--; ++#ifdef ARCH_BIG_ENDIAN ++ for (p = &Byte_u(obj, sizeof(double) - 1), i = sizeof(double); ++ i > 0; ++ p--, i--) ++#else ++ for (p = &Byte_u(obj, 0), i = sizeof(double); ++ i > 0; ++ p++, i--) ++#endif ++ Combine_small(*p); ++ break; ++ case Double_array_tag: ++ h->univ_count--; ++ for (j = 0; j < Bosize_val(obj); j += sizeof(double)) { ++#ifdef ARCH_BIG_ENDIAN ++ for (p = &Byte_u(obj, j + sizeof(double) - 1), i = sizeof(double); ++ i > 0; ++ p--, i--) ++#else ++ for (p = &Byte_u(obj, j), i = sizeof(double); ++ i > 0; ++ p++, i--) ++#endif ++ Combine_small(*p); ++ } ++ break; ++ case Abstract_tag: ++ /* We don't know anything about the contents of the block. ++ Better do nothing. */ ++ break; ++ case Infix_tag: ++ hash_aux(h, obj - Infix_offset_val(obj)); ++ break; ++ case Forward_tag: ++ obj = Forward_val (obj); ++ goto again; ++ case Object_tag: ++ h->univ_count--; ++ Combine(Oid_val(obj)); ++ break; ++ case Custom_tag: ++ /* If no hashing function provided, do nothing */ ++ if (Custom_ops_val(obj)->hash != NULL) { ++ h->univ_count--; ++ Combine(Custom_ops_val(obj)->hash(obj)); ++ } ++ break; ++#ifdef NO_NAKED_POINTERS ++ case Closure_tag: ++ h->univ_count--; ++ Combine_small(tag); ++ /* Recursively hash the environment fields */ ++ i = Wosize_val(obj); ++ j = Start_env_closinfo(Closinfo_val(obj)); ++ while (i > j) { ++ i--; ++ hash_aux(h, Field(obj, i)); ++ } ++ /* Combine the code pointers, closure info fields, and infix headers */ ++ while (i > 0) { ++ i--; ++ Combine(Field(obj, i)); ++ h->univ_count--; ++ } ++ break; ++#endif ++ default: ++ h->univ_count--; ++ Combine_small(tag); ++ i = Wosize_val(obj); ++ while (i != 0) { ++ i--; ++ hash_aux(h, Field(obj, i)); ++ } ++ break; ++ } ++} diff --git a/net/unison240/files/patch-uutil.ml b/net/unison240/files/patch-uutil.ml new file mode 100644 index 000000000000..cf364ade3fcf --- /dev/null +++ b/net/unison240/files/patch-uutil.ml @@ -0,0 +1,11 @@ +--- uutil.ml.orig 2024-02-06 20:32:31 UTC ++++ uutil.ml +@@ -34,7 +34,7 @@ let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF + + let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF + +-external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" ++external hash_param : int -> int -> 'a -> int = "unsn_hash_univ_param" "noalloc" + + let hash x = hash_param 10 100 x + diff --git a/net/unison248/Makefile b/net/unison248/Makefile index 44cdcabe527e..a17c5f845bfc 100644 --- a/net/unison248/Makefile +++ b/net/unison248/Makefile @@ -34,6 +34,7 @@ WRKSRC_SUBDIR= src NO_OCAML_RUNDEPENDS=yes CONFLICTS= unison-devel MAKE_ENV= CLIBS="${LIBS:S/^-/-ccopt -/}" COFLAGS="${CFLAGS:C/ *(-[^ ]*) */ -ccopt \"\1 \"/gW}" +MAKE_JOBS_UNSAFE= yes ALL_TARGET= unison all USE_GITHUB= yes diff --git a/net/unison248/files/patch-Makefile.OCaml b/net/unison248/files/patch-Makefile.OCaml index 3e91ae298763..73ff7ac83133 100644 --- a/net/unison248/files/patch-Makefile.OCaml +++ b/net/unison248/files/patch-Makefile.OCaml @@ -1,6 +1,6 @@ ---- Makefile.OCaml.orig 2017-03-23 16:39:49 UTC +--- Makefile.OCaml.orig 2017-12-18 12:23:54 UTC +++ Makefile.OCaml -@@ -32,7 +32,11 @@ ifeq ($(shell uname),OpenBSD) +@@ -32,7 +32,11 @@ ifeq ($(shell uname),NetBSD) else ifeq ($(shell uname),NetBSD) OSARCH=NetBSD @@ -12,7 +12,16 @@ ifeq ($(shell uname),Linux) OSARCH=Linux endif -@@ -311,6 +315,10 @@ ifeq ($(OSARCH),Linux) +@@ -240,7 +244,7 @@ OCAMLLIBS+=unix.cma str.cma bigarray.cma + # File extensions will be substituted for the native code version + OCAMLLIBS+=unix.cma str.cma bigarray.cma + +-COBJS+=osxsupport$(OBJ_EXT) pty$(OBJ_EXT) bytearray_stubs$(OBJ_EXT) ++COBJS+=osxsupport$(OBJ_EXT) pty$(OBJ_EXT) bytearray_stubs$(OBJ_EXT) hash_compat$(OBJ_EXT) + + ######################################################################## + ### User Interface setup +@@ -311,6 +315,10 @@ endif -include fsmonitor/linux/Makefile src/fsmonitor/linux/Makefile endif diff --git a/net/unison248/files/patch-hash__compat.c b/net/unison248/files/patch-hash__compat.c new file mode 100644 index 000000000000..ba746e41d22b --- /dev/null +++ b/net/unison248/files/patch-hash__compat.c @@ -0,0 +1,168 @@ +--- hash_compat.c.orig 2024-02-06 20:29:47 UTC ++++ hash_compat.c +@@ -0,0 +1,165 @@ ++/* The pre-OCaml 4.00 hash implementation */ ++/* FIXME: This is included for backwards compatibility only and must be ++ * REMOVED when a new hash function included in a stable release has been ++ * available for a few years. The removal of this function will break ++ * Unison version compatibility. There must be plenty of time given ++ * for users to upgrade (most users don't compile themselves and are at ++ * mercy of whatever package repositories they use). */ ++ ++/* Code copied from OCaml sources */ ++/**************************************************************************/ ++/* */ ++/* OCaml */ ++/* */ ++/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ ++/* */ ++/* Copyright 1996 Institut National de Recherche en Informatique et */ ++/* en Automatique. */ ++/* */ ++/* All rights reserved. This file is distributed under the terms of */ ++/* the GNU Lesser General Public License version 2.1, with the */ ++/* special exception on linking described in the file LICENSE. */ ++/* */ ++/**************************************************************************/ ++ ++#include <caml/mlvalues.h> ++#include <caml/custom.h> ++#include <caml/address_class.h> ++ ++struct hash_state { ++ uintnat accu; ++ intnat univ_limit, univ_count; ++}; ++ ++static void hash_aux(struct hash_state*, value obj); ++ ++CAMLprim value unsn_hash_univ_param(value count, value limit, value obj) ++{ ++ struct hash_state h; ++ h.univ_limit = Long_val(limit); ++ h.univ_count = Long_val(count); ++ h.accu = 0; ++ hash_aux(&h, obj); ++ return Val_long(h.accu & 0x3FFFFFFF); ++ /* The & has two purposes: ensure that the return value is positive ++ and give the same result on 32 bit and 64 bit architectures. */ ++} ++ ++#define Alpha 65599 ++#define Beta 19 ++#define Combine(new) (h->accu = h->accu * Alpha + (new)) ++#define Combine_small(new) (h->accu = h->accu * Beta + (new)) ++ ++static void hash_aux(struct hash_state* h, value obj) ++{ ++ unsigned char * p; ++ mlsize_t i, j; ++ tag_t tag; ++ ++ h->univ_limit--; ++ if (h->univ_count < 0 || h->univ_limit < 0) return; ++ ++ again: ++ if (Is_long(obj)) { ++ h->univ_count--; ++ Combine(Long_val(obj)); ++ return; ++ } ++ if (! Is_in_value_area(obj)) { ++ /* obj is a pointer outside the heap, to an object with ++ a priori unknown structure. Use its physical address as hash key. */ ++ Combine((intnat) obj); ++ return; ++ } ++ /* Pointers into the heap are well-structured blocks. So are atoms. ++ We can inspect the block contents. */ ++ /* The code needs reindenting later. Leaving as is to facilitate review. */ ++ tag = Tag_val(obj); ++ switch (tag) { ++ case String_tag: ++ h->univ_count--; ++ i = caml_string_length(obj); ++ for (p = &Byte_u(obj, 0); i > 0; i--, p++) ++ Combine_small(*p); ++ break; ++ case Double_tag: ++ /* For doubles, we inspect their binary representation, LSB first. ++ The results are consistent among all platforms with IEEE floats. */ ++ h->univ_count--; ++#ifdef ARCH_BIG_ENDIAN ++ for (p = &Byte_u(obj, sizeof(double) - 1), i = sizeof(double); ++ i > 0; ++ p--, i--) ++#else ++ for (p = &Byte_u(obj, 0), i = sizeof(double); ++ i > 0; ++ p++, i--) ++#endif ++ Combine_small(*p); ++ break; ++ case Double_array_tag: ++ h->univ_count--; ++ for (j = 0; j < Bosize_val(obj); j += sizeof(double)) { ++#ifdef ARCH_BIG_ENDIAN ++ for (p = &Byte_u(obj, j + sizeof(double) - 1), i = sizeof(double); ++ i > 0; ++ p--, i--) ++#else ++ for (p = &Byte_u(obj, j), i = sizeof(double); ++ i > 0; ++ p++, i--) ++#endif ++ Combine_small(*p); ++ } ++ break; ++ case Abstract_tag: ++ /* We don't know anything about the contents of the block. ++ Better do nothing. */ ++ break; ++ case Infix_tag: ++ hash_aux(h, obj - Infix_offset_val(obj)); ++ break; ++ case Forward_tag: ++ obj = Forward_val (obj); ++ goto again; ++ case Object_tag: ++ h->univ_count--; ++ Combine(Oid_val(obj)); ++ break; ++ case Custom_tag: ++ /* If no hashing function provided, do nothing */ ++ if (Custom_ops_val(obj)->hash != NULL) { ++ h->univ_count--; ++ Combine(Custom_ops_val(obj)->hash(obj)); ++ } ++ break; ++#ifdef NO_NAKED_POINTERS ++ case Closure_tag: ++ h->univ_count--; ++ Combine_small(tag); ++ /* Recursively hash the environment fields */ ++ i = Wosize_val(obj); ++ j = Start_env_closinfo(Closinfo_val(obj)); ++ while (i > j) { ++ i--; ++ hash_aux(h, Field(obj, i)); ++ } ++ /* Combine the code pointers, closure info fields, and infix headers */ ++ while (i > 0) { ++ i--; ++ Combine(Field(obj, i)); ++ h->univ_count--; ++ } ++ break; ++#endif ++ default: ++ h->univ_count--; ++ Combine_small(tag); ++ i = Wosize_val(obj); ++ while (i != 0) { ++ i--; ++ hash_aux(h, Field(obj, i)); ++ } ++ break; ++ } ++} diff --git a/net/unison248/files/patch-uutil.ml b/net/unison248/files/patch-uutil.ml new file mode 100644 index 000000000000..cf364ade3fcf --- /dev/null +++ b/net/unison248/files/patch-uutil.ml @@ -0,0 +1,11 @@ +--- uutil.ml.orig 2024-02-06 20:32:31 UTC ++++ uutil.ml +@@ -34,7 +34,7 @@ let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF + + let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF + +-external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" ++external hash_param : int -> int -> 'a -> int = "unsn_hash_univ_param" "noalloc" + + let hash x = hash_param 10 100 x + |