git: e4db3f2e77fb - main - net/unison: Update to 2.53.0

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Tue, 22 Nov 2022 17:37:12 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e4db3f2e77fb08e8a29e2bc91c0d6e7454716e61

commit e4db3f2e77fb08e8a29e2bc91c0d6e7454716e61
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-11-22 17:35:30 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-11-22 17:35:30 +0000

    net/unison: Update to 2.53.0
    
    Project moved to GTK 3, through ocaml-lablgtk3.
    
    Port includes patch to allow building with ocaml 4.07 included in
    ports, provided by Tõivo Leedjärv on the unison-users mailing list.
    
    Many thanks to him and Greg Troxel from the unison project for the
    patch, their suggestions and support.
    
    NOTE: version since 2.52.0 are wire compatibile so no need to
    preserve the old version.
    
    PR:             267693
---
 net/unison/Makefile                      |  12 ++--
 net/unison/distinfo                      |   6 +-
 net/unison/files/patch-Makefile.OCaml    |  21 ++++--
 net/unison/files/patch-ubase_umarshal.ml | 114 +++++++++++++++++++++++++++++++
 4 files changed, 138 insertions(+), 15 deletions(-)

diff --git a/net/unison/Makefile b/net/unison/Makefile
index 0b19294b495d..760953afe5fa 100644
--- a/net/unison/Makefile
+++ b/net/unison/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	unison
-PORTVERSION=	2.52.1
+PORTVERSION=	2.53.0
 DISTVERSIONPREFIX=	v
 CATEGORIES=	net
 
@@ -17,12 +17,12 @@ nox11_PKGNAMESUFFIX=		-nox11
 nox11_CONFLICTS_INSTALL=	unison
 
 x11_CONFLICTS_INSTALL=		unison-nox11
-x11_BUILD_DEPENDS=	lablgtk2:x11-toolkits/ocaml-lablgtk2 \
+x11_BUILD_DEPENDS=	ocaml-lablgtk3>0:x11-toolkits/ocaml-lablgtk3 \
 			icotool:graphics/icoutils
 x11_LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
 			libfreetype.so:print/freetype2 \
 			libharfbuzz.so:print/harfbuzz
-x11_RUN_DEPENDS=	lablgtk2:x11-toolkits/ocaml-lablgtk2
+x11_RUN_DEPENDS=	ocaml-lablgtk3>0:x11-toolkits/ocaml-lablgtk3
 
 PLIST_SUB=	PORTVERSION=${PORTVERSION}
 USES=		gmake localbase
@@ -52,9 +52,9 @@ MAKE_ARGS=		UISTYLE=text
 PKGMESSAGE=		${PKGDIR}/pkg-message.nox11
 PLIST_SUB+=		X11="@comment "
 .else
-MAKE_ARGS=		UISTYLE=gtk2
+MAKE_ARGS=		UISTYLE=gtk3
 SUB_FILES=		${PORTNAME}.desktop
-USE_GNOME+=		atk cairo gdkpixbuf2 glib20 gtk20 pango
+USE_GNOME+=		atk cairo gdkpixbuf2 glib20 gtk30 pango
 USES+=			gettext-runtime gnome
 PLIST_SUB+=		X11=""
 .endif
@@ -68,7 +68,7 @@ post-patch:
 	@${REINPLACE_CMD} -e 's/CFLAGS/COFLAGS/g' \
 		${WRKSRC}/Makefile.OCaml ${WRKSRC}/fsmonitor/linux/Makefile
 .else
-	@${REINPLACE_CMD} -Ee 's@(\+|/)(lablgtk2)@\1site-lib/\2@' \
+	@${REINPLACE_CMD} -Ee 's@(\+|/)(lablgtk3)@\1site-lib/\2@' \
 		-e 's/CFLAGS/COFLAGS/g' \
 		${WRKSRC}/Makefile.OCaml ${WRKSRC}/fsmonitor/linux/Makefile
 .endif
diff --git a/net/unison/distinfo b/net/unison/distinfo
index 020a99d20028..91d48791f149 100644
--- a/net/unison/distinfo
+++ b/net/unison/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1652016497
-SHA256 (bcpierce00-unison-v2.52.1_GH0.tar.gz) = ff7d920e1b4ec0872df764130b82a515f6f21a361f31a67b39c3e3ea12bfda80
-SIZE (bcpierce00-unison-v2.52.1_GH0.tar.gz) = 1360920
+TIMESTAMP = 1669069594
+SHA256 (bcpierce00-unison-v2.53.0_GH0.tar.gz) = 9364477df4501b9c7377e2ca1a7c4b44c1f16fa7cbc12b7f5b543d08c3f0740a
+SIZE (bcpierce00-unison-v2.53.0_GH0.tar.gz) = 1387266
diff --git a/net/unison/files/patch-Makefile.OCaml b/net/unison/files/patch-Makefile.OCaml
index 503906115d6e..6172ff5c8790 100644
--- a/net/unison/files/patch-Makefile.OCaml
+++ b/net/unison/files/patch-Makefile.OCaml
@@ -1,6 +1,6 @@
---- Makefile.OCaml.orig	2022-03-12 16:24:03 UTC
+--- Makefile.OCaml.orig	2022-10-30 19:42:39 UTC
 +++ Makefile.OCaml
-@@ -31,7 +31,11 @@ ifeq ($(shell uname),NetBSD)
+@@ -34,7 +34,11 @@ ifeq ($(shell uname),NetBSD)
  else
  ifeq ($(shell uname),NetBSD)
    OSARCH=NetBSD
@@ -12,7 +12,16 @@
  ifeq ($(shell uname),Linux)
    OSARCH=Linux
  endif
-@@ -315,6 +319,11 @@ endif
+@@ -256,7 +260,7 @@ OCAMLOBJS+=main.cmo
+ 
+ # OCaml libraries for the bytecode version
+ # File extensions will be substituted for the native code version
+-OCAMLLIBS+=unix.cma str.cma
++OCAMLLIBS+=unix.cma str.cma bigarray.cma
+ INCLFLAGS+=-I +unix -I +str
+ 
+ COBJS+=osxsupport$(OBJ_EXT) pty$(OBJ_EXT) bytearray_stubs$(OBJ_EXT) hash_compat$(OBJ_EXT) props_xattr$(OBJ_EXT) props_acl$(OBJ_EXT)
+@@ -321,6 +325,11 @@ endif
  INCLFLAGS+=-I fsmonitor -I fsmonitor/linux
  endif
  
@@ -24,7 +33,7 @@
  ifeq ($(OSARCH),solaris)
  -include fsmonitor/solaris/Makefile src/fsmonitor/solaris/Makefile
  INCLFLAGS+=-I fsmonitor -I fsmonitor/solaris
-@@ -442,6 +451,10 @@ win32rc/unison.res.lib: win32rc/unison.rc win32rc/U.ic
+@@ -434,6 +443,10 @@ win32rc/unison.res.lib: win32rc/unison.rc win32rc/U.ic
  	-$(RM) $@
  	ocamllex $<
  
@@ -34,8 +43,8 @@
 +
  %.cmi : %.mli
  	@echo "$(CAMLC): $< ---> $@"
- 	$(CAMLC) $(CAMLFLAGS) $(COMPATCAMLFLAGS) -c $(CWD)/$<
-@@ -466,7 +479,7 @@ compat%.cmx: compat%.ml
+ 	$(CAMLC) $(CAMLFLAGS) -c $(CWD)/$<
+@@ -448,7 +461,7 @@ win32rc/unison.res.lib: win32rc/unison.rc win32rc/U.ic
  
  %.o %.obj: %.c
  	@echo "$(CAMLC): $< ---> $@"
diff --git a/net/unison/files/patch-ubase_umarshal.ml b/net/unison/files/patch-ubase_umarshal.ml
new file mode 100644
index 000000000000..0edb9f18aec5
--- /dev/null
+++ b/net/unison/files/patch-ubase_umarshal.ml
@@ -0,0 +1,114 @@
+--- ubase/umarshal.ml.orig	2022-10-30 19:42:39 UTC
++++ ubase/umarshal.ml
+@@ -15,6 +15,111 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *)
+ 
++(* OCaml 4.07 compatibility ONLY *)
++module Bytes = struct
++
++include Bytes
++
++(* The following code is taken from OCaml sources.
++   Authors of the code snippet: Alain Frisch and Daniel Bünzli *)
++
++(**************************************************************************)
++(*                                                                        *)
++(*                                 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.          *)
++(*                                                                        *)
++(**************************************************************************)
++
++(** {6 Binary encoding/decoding of integers} *)
++
++external get_uint8 : bytes -> int -> int = "%string_safe_get"
++external get_uint16_ne : bytes -> int -> int = "%caml_string_get16"
++external get_int32_ne : bytes -> int -> int32 = "%caml_string_get32"
++external get_int64_ne : bytes -> int -> int64 = "%caml_string_get64"
++external set_int8 : bytes -> int -> int -> unit = "%string_safe_set"
++external set_int16_ne : bytes -> int -> int -> unit = "%caml_string_set16"
++external set_int32_ne : bytes -> int -> int32 -> unit = "%caml_string_set32"
++external set_int64_ne : bytes -> int -> int64 -> unit = "%caml_string_set64"
++external swap16 : int -> int = "%bswap16"
++external swap32 : int32 -> int32 = "%bswap_int32"
++external swap64 : int64 -> int64 = "%bswap_int64"
++
++let get_int8 b i =
++  ((get_uint8 b i) lsl (Sys.int_size - 8)) asr (Sys.int_size - 8)
++
++let get_uint16_le b i =
++  if Sys.big_endian then swap16 (get_uint16_ne b i)
++  else get_uint16_ne b i
++
++let get_uint16_be b i =
++  if not Sys.big_endian then swap16 (get_uint16_ne b i)
++  else get_uint16_ne b i
++
++let get_int16_ne b i =
++  ((get_uint16_ne b i) lsl (Sys.int_size - 16)) asr (Sys.int_size - 16)
++
++let get_int16_le b i =
++  ((get_uint16_le b i) lsl (Sys.int_size - 16)) asr (Sys.int_size - 16)
++
++let get_int16_be b i =
++  ((get_uint16_be b i) lsl (Sys.int_size - 16)) asr (Sys.int_size - 16)
++
++let get_int32_le b i =
++  if Sys.big_endian then swap32 (get_int32_ne b i)
++  else get_int32_ne b i
++
++let get_int32_be b i =
++  if not Sys.big_endian then swap32 (get_int32_ne b i)
++  else get_int32_ne b i
++
++let get_int64_le b i =
++  if Sys.big_endian then swap64 (get_int64_ne b i)
++  else get_int64_ne b i
++
++let get_int64_be b i =
++  if not Sys.big_endian then swap64 (get_int64_ne b i)
++  else get_int64_ne b i
++
++let set_int16_le b i x =
++  if Sys.big_endian then set_int16_ne b i (swap16 x)
++  else set_int16_ne b i x
++
++let set_int16_be b i x =
++  if not Sys.big_endian then set_int16_ne b i (swap16 x)
++  else set_int16_ne b i x
++
++let set_int32_le b i x =
++  if Sys.big_endian then set_int32_ne b i (swap32 x)
++  else set_int32_ne b i x
++
++let set_int32_be b i x =
++  if not Sys.big_endian then set_int32_ne b i (swap32 x)
++  else set_int32_ne b i x
++
++let set_int64_le b i x =
++  if Sys.big_endian then set_int64_ne b i (swap64 x)
++  else set_int64_ne b i x
++
++let set_int64_be b i x =
++  if not Sys.big_endian then set_int64_ne b i (swap64 x)
++  else set_int64_ne b i x
++
++let set_uint8 = set_int8
++let set_uint16_ne = set_int16_ne
++let set_uint16_be = set_int16_be
++let set_uint16_le = set_int16_le
++
++end
++(* / *)
++
+ exception Error of string
+ 
+ type 'a t = {