git: b0bad619f282 - main - devel/ocaml-magic: Update version 0.7.3=>0.7.4

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 28 Jun 2026 22:09:33 UTC
The branch main has been updated by bofh:

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

commit b0bad619f28293e0da9f99d9a8810df05f6d9a64
Author:     Benjamin Jacobs <freebsd@dev.thsi.be>
AuthorDate: 2026-06-28 20:54:47 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2026-06-28 22:08:54 +0000

    devel/ocaml-magic: Update version 0.7.3=>0.7.4
    
    - Update WWW
    - Update MASTER_SITES
    - Adopt
    
    Changelog: https://github.com/Chris00/ocaml-magic/releases/tag/v0.7.4
---
 devel/ocaml-magic/Makefile                       |  24 ++---
 devel/ocaml-magic/distinfo                       |   5 +-
 devel/ocaml-magic/files/patch-src_magic__stubs.c | 114 -----------------------
 devel/ocaml-magic/pkg-plist                      |   6 +-
 4 files changed, 17 insertions(+), 132 deletions(-)

diff --git a/devel/ocaml-magic/Makefile b/devel/ocaml-magic/Makefile
index 72b284c05fb8..37c5a249ad75 100644
--- a/devel/ocaml-magic/Makefile
+++ b/devel/ocaml-magic/Makefile
@@ -1,14 +1,13 @@
 PORTNAME=	magic
-PORTVERSION=	0.7.3
-PORTREVISION=	7
+DISTVERSION=	0.7.4
 CATEGORIES=	devel
-MASTER_SITES=	SF/ocaml-${PORTNAME}/ocaml-${PORTNAME}/0.7
+MASTER_SITES=	https://github.com/Chris00/${PKGNAMEPREFIX}${PORTNAME}/releases/download/v${DISTVERSION}/
 PKGNAMEPREFIX=	ocaml-
 DISTNAME=	${PKGNAMEPREFIX}${PORTNAME}-${PORTVERSION}
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	freebsd@dev.thsi.be
 COMMENT=	OCaml binding for libmagic(3)
-WWW=		https://sourceforge.net/projects/ocaml-magic/
+WWW=		https://github.com/Chris00/ocaml-magic
 
 LICENSE=	LGPL21
 LICENSE_FILE=	${WRKSRC}/LICENSE
@@ -32,15 +31,18 @@ USE_BINUTILS=	yes
 .endif
 
 post-install:
-	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/magic/dllmagic_stubs.so
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/magic/dllmagic_stubs.so
 
 post-install-DOCS-on:
-	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-	${INSTALL_DATA} ${WRKSRC}/doc/html/* ${STAGEDIR}${DOCSDIR}
+	cd ${WRKSRC}/doc/html/ && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
 
 post-install-EXAMPLES-on:
-	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
-	${INSTALL_DATA} ${WRKSRC}/examples/* ${STAGEDIR}${EXAMPLESDIR}
-	${STRIP_CMD} ${STAGEDIR}${EXAMPLESDIR}/file
+	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/examples/file ${STAGEDIR}${EXAMPLESDIR}
+	${INSTALL_DATA} ${WRKSRC}/examples/*.ml ${WRKSRC}/examples/Makefile \
+		 ${WRKSRC}/OCamlMakefile ${STAGEDIR}${EXAMPLESDIR}
+	${REINPLACE_CMD} -e "/^export OCAMLMAKEFILE/s@../@@" \
+		-e "/^export INCDIRS/s@=.*@= +site-lib/magic@" \
+		${STAGEDIR}${EXAMPLESDIR}/Makefile
 
 .include <bsd.port.mk>
diff --git a/devel/ocaml-magic/distinfo b/devel/ocaml-magic/distinfo
index cd15b86ab0b1..6ff0031e820f 100644
--- a/devel/ocaml-magic/distinfo
+++ b/devel/ocaml-magic/distinfo
@@ -1,2 +1,3 @@
-SHA256 (ocaml-magic-0.7.3.tar.gz) = fd09e2208b1483062919f8aa57d24427584729a6a00b6cdf3133fda425870fbc
-SIZE (ocaml-magic-0.7.3.tar.gz) = 54888
+TIMESTAMP = 1734801616
+SHA256 (ocaml-magic-0.7.4.tar.gz) = 025d68bc9b6a7f9987defd8157942ffdcba83849e312bf2f890e93bbb3932013
+SIZE (ocaml-magic-0.7.4.tar.gz) = 61942
diff --git a/devel/ocaml-magic/files/patch-src_magic__stubs.c b/devel/ocaml-magic/files/patch-src_magic__stubs.c
deleted file mode 100644
index 38e313e916d4..000000000000
--- a/devel/ocaml-magic/files/patch-src_magic__stubs.c
+++ /dev/null
@@ -1,114 +0,0 @@
---- src/magic_stubs.c.orig	2008-03-23 20:39:45 UTC
-+++ src/magic_stubs.c
-@@ -53,7 +53,7 @@ static void raise_magic_failure(const char * msg)
- {
-   static value * exn = NULL;
-   if (exn == NULL) exn = caml_named_value("Magic.Failure");
--  raise_with_string(*exn, (char *) msg);
-+  caml_raise_with_string(*exn, (char *) msg);
- }
- 
- /* [raise_on_error] raises an exception according to the error that
-@@ -73,20 +73,20 @@ static void raise_on_error(const char* fname, const ma
-   if (err_magic != NULL) {
-     /* libmagic error */
-     if ((errmsg = malloc(flen + strlen(err_magic) + 1)) == NULL)
--      raise_out_of_memory();
-+      caml_raise_out_of_memory();
-     if (exn == NULL) exn = caml_named_value("Magic.Failure");
-     strcpy(errmsg, fname);
-     strcpy(errmsg + flen, err_magic);
--    verrmsg = copy_string(errmsg);
-+    verrmsg = caml_copy_string(errmsg);
-     free(errmsg); /* err_magic is freed by magic_close */
--    raise_with_arg(*exn, verrmsg);
-+    caml_raise_with_arg(*exn, verrmsg);
-   }
-   else  {
-     /* System error */
-     const int err = magic_errno(cookie);
-     int len = 80;  /* buffer length */
- 
--    if ((errmsg = malloc(len)) == NULL) raise_out_of_memory();
-+    if ((errmsg = malloc(len)) == NULL) caml_raise_out_of_memory();
-     strcpy(errmsg, fname);
- #ifdef HAVE_STRERROR_R
-     /* Allocate buffer [errmsg] until there is enough space for the
-@@ -95,15 +95,15 @@ static void raise_on_error(const char* fname, const ma
-       /* Reallocate to a bigger size -- no need to keep the contents */
-       len *= 2;
-       free(errmsg);
--      if ((errmsg = malloc(len)) == NULL) raise_out_of_memory();
-+      if ((errmsg = malloc(len)) == NULL) caml_raise_out_of_memory();
-       strcpy(errmsg, fname);
-     }
- #else
-     strncat(errmsg, strerror(err), len - flen - 1);
- #endif
--    verrmsg = copy_string(errmsg);
-+    verrmsg = caml_copy_string(errmsg);
-     free(errmsg);
--    raise_sys_error(verrmsg);
-+    caml_raise_sys_error(verrmsg);
-   }
- 
-   CAMLreturn0;
-@@ -147,7 +147,7 @@ static struct custom_operations cookie_ops = {
-     /* deserialize */ custom_deserialize_default
- };
- 
--#define ALLOC_COOKIE alloc_custom(&cookie_ops, sizeof(magic_t), \
-+#define ALLOC_COOKIE caml_alloc_custom(&cookie_ops, sizeof(magic_t), \
-                      sizeof(magic_t), 40 * sizeof(magic_t))
- 
- /*
-@@ -169,22 +169,22 @@ CAMLprim value ocaml_magic_open(value flags)
-     else {
-       const int err = errno; /* save it */
- 
--      if ((errmsg = malloc(len)) == NULL) raise_out_of_memory();
-+      if ((errmsg = malloc(len)) == NULL) caml_raise_out_of_memory();
-       strcpy(errmsg, "Magic.create: "); /* 14 chars */
- #ifdef HAVE_STRERROR_R
-       /* No cookie yet, so one cannot use the above generic err fun */
-       while(strerror_r(err, errmsg + 14, len - 14) < 0) {
-         len *= 2;
-         free(errmsg);
--        if ((errmsg = malloc(len)) == NULL) raise_out_of_memory();
-+        if ((errmsg = malloc(len)) == NULL) caml_raise_out_of_memory();
-         strcpy(errmsg, "Magic.create: ");
-       }
- #else
-       strncat(errmsg, strerror(err), len - 15);
- #endif
--      verrmsg = copy_string(errmsg);
-+      verrmsg = caml_copy_string(errmsg);
-       free(errmsg);
--      raise_sys_error(verrmsg);
-+      caml_raise_sys_error(verrmsg);
-     }
-   }
-   CAMLreturn(c);
-@@ -207,11 +207,11 @@ CAMLprim value ocaml_magic_file(value c, value fname)
-   const char * ans;
-   const magic_t cookie = COOKIE_VAL(c);
- 
--  if (cookie == NULL) invalid_argument("Magic.file");
-+  if (cookie == NULL) caml_invalid_argument("Magic.file");
-   if ((ans = magic_file(cookie, String_val(fname))) == NULL) {
-     raise_on_error("Magic.file: ", cookie);
-   }
--  CAMLreturn(copy_string(ans));
-+  CAMLreturn(caml_copy_string(ans));
- }
- 
- CAMLprim value ocaml_magic_buffer(value c, value buf, value len)
-@@ -224,7 +224,7 @@ CAMLprim value ocaml_magic_buffer(value c, value buf, 
-   if ((ans = magic_buffer(cookie, String_val(buf), Int_val(len)))
-       == NULL)
-     raise_on_error("Magic.buffer: ", cookie);
--  CAMLreturn(copy_string(ans));
-+  CAMLreturn(caml_copy_string(ans));
- }
- 
- 
diff --git a/devel/ocaml-magic/pkg-plist b/devel/ocaml-magic/pkg-plist
index c526af0b2870..00b54247d8da 100644
--- a/devel/ocaml-magic/pkg-plist
+++ b/devel/ocaml-magic/pkg-plist
@@ -22,11 +22,7 @@
 %%PORTDOCS%%%%DOCSDIR%%/style.css
 %%PORTDOCS%%%%DOCSDIR%%/type_Magic.html
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile.in
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/OCamlMakefile
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/file
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/file.cmi
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/file.cmo
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/file.cmx
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/file.ml
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/file.o
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/test.ml