Skip to content

Commit

Permalink
ocaml-base_bigstring: use legacysupport correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Jul 6, 2024
1 parent 2394f76 commit f65d352
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
4 changes: 4 additions & 0 deletions ocaml/ocaml-base_bigstring/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
24 changes: 4 additions & 20 deletions ocaml/ocaml-base_bigstring/files/patch-memmem.diff
Original file line number Diff line number Diff line change
@@ -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 <caml/bigarray.h>

+#ifdef __APPLE__
+#include <AvailabilityMacros.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
+#include <LegacySupport/string.h>
+#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)))

0 comments on commit f65d352

Please sign in to comment.