From f65d35206c522ca662ac8cf1ad1e509e9e6788ca Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sat, 6 Jul 2024 23:17:50 +0800 Subject: [PATCH] ocaml-base_bigstring: use legacysupport correctly --- ocaml/ocaml-base_bigstring/Portfile | 4 ++++ .../files/patch-memmem.diff | 24 ++++--------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/ocaml/ocaml-base_bigstring/Portfile b/ocaml/ocaml-base_bigstring/Portfile index 649e76efd9062..3fd2a7df7a9a8 100644 --- a/ocaml/ocaml-base_bigstring/Portfile +++ b/ocaml/ocaml-base_bigstring/Portfile @@ -27,6 +27,10 @@ github.tarball_from archive # Use legacysupport to provide it. if {${os.platform} eq "darwin" && ${os.major} < 11} { patchfiles patch-memmem.diff + + post-patch { + reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/dune + } } depends_lib-append port:ocaml-base \ diff --git a/ocaml/ocaml-base_bigstring/files/patch-memmem.diff b/ocaml/ocaml-base_bigstring/files/patch-memmem.diff index 1effd2504b57b..70c050601f7f6 100644 --- a/ocaml/ocaml-base_bigstring/files/patch-memmem.diff +++ b/ocaml/ocaml-base_bigstring/files/patch-memmem.diff @@ -1,25 +1,9 @@ ---- src/base_bigstring.h 2023-04-25 21:12:24.000000000 +0800 -+++ src/base_bigstring.h 2023-10-25 15:23:59.000000000 +0800 -@@ -3,6 +3,13 @@ - - #include - -+#ifdef __APPLE__ -+#include -+#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060 -+#include -+#endif -+#endif -+ - /* Bigarray flags for creating a [Bigstring.t] */ - #define BASE_BIGSTRING_FLAGS (CAML_BA_CHAR | CAML_BA_C_LAYOUT) - --- src/dune 2023-04-25 21:12:24.000000000 +0800 -+++ src/dune 2023-10-25 19:59:56.000000000 +0800 -@@ -1,3 +1,3 @@ ++++ src/dune 2024-07-06 23:12:51.000000000 +0800 +@@ -1,3 +1,4 @@ (library (name base_bigstring) (public_name base_bigstring) -- (js_of_ocaml (javascript_files runtime.js)) (libraries base int_repr) + (js_of_ocaml (javascript_files runtime.js)) (libraries base int_repr) - (c_names base_bigstring_stubs) (preprocess (pps ppx_jane))) \ No newline at end of file -+ (js_of_ocaml (javascript_files runtime.js)) (libraries base int_repr) (c_library_flags -lMacportsLegacySupport) ++ (c_flags -I@PREFIX@/include/LegacySupport) (c_library_flags -lMacportsLegacySupport) + (c_names base_bigstring_stubs) (preprocess (pps ppx_jane)))