Open
Conversation
daeho-ro
reviewed
Mar 29, 2026
| #include <kiwix/kiwix_config.h> | ||
| #include <iostream> | ||
| int main() { | ||
| std::cout << "libkiwix " << LIBKIWIX_VERSION << std::endl; |
Member
There was a problem hiding this comment.
I hope there will be more functional test, not just printing version.
| uses_from_macos "curl" | ||
| uses_from_macos "zlib" | ||
|
|
||
| # Mustache header-only library (required dependency) |
Member
There was a problem hiding this comment.
It seems that the header will be used in other formula, too. So this should be a separated formula but the tag is outdated and cannot build without patch. For now, please leave a comment as follows:
Suggested change
| # Mustache header-only library (required dependency) | |
| # TODO: separate as a new formula once upstream release a new tag |
| end | ||
|
|
||
| def install | ||
| # Install Mustache header |
Member
There was a problem hiding this comment.
Suggested change
| # Install Mustache header |
Comment on lines
+60
to
+69
| # Get icu4c path for compilation | ||
| icu4c = Formula["icu4c@78"] | ||
|
|
||
| cxx_args = ["-std=c++17", "-I#{include}", "-I#{icu4c.opt_include}", | ||
| "-L#{lib}", "-L#{icu4c.opt_lib}", "-lkiwix", "-o", "test"] | ||
| if OS.mac? | ||
| sdk_cxx_include = MacOS::CLT.sdk_path/"usr/include/c++/v1" | ||
| cxx_args = ["-isystem#{sdk_cxx_include}"] + cxx_args if sdk_cxx_include.exist? | ||
| end | ||
| system ENV.cxx, "test.cpp", *cxx_args |
Member
There was a problem hiding this comment.
Suggested change
| # Get icu4c path for compilation | |
| icu4c = Formula["icu4c@78"] | |
| cxx_args = ["-std=c++17", "-I#{include}", "-I#{icu4c.opt_include}", | |
| "-L#{lib}", "-L#{icu4c.opt_lib}", "-lkiwix", "-o", "test"] | |
| if OS.mac? | |
| sdk_cxx_include = MacOS::CLT.sdk_path/"usr/include/c++/v1" | |
| cxx_args = ["-isystem#{sdk_cxx_include}"] + cxx_args if sdk_cxx_include.exist? | |
| end | |
| system ENV.cxx, "test.cpp", *cxx_args | |
| icu4c = Formula["icu4c@78"] | |
| system ENV.cxx, "test.cpp", "-std=c++17", "-o", "test", "-I#{include}", "-I#{icu4c.opt_include}", | |
| "-L#{lib}", "-L#{icu4c.opt_lib}", "-lkiwix" |
Comment on lines
+34
to
+45
| # On macOS, CLT 17+ moved C++ stdlib headers into the SDK; pass them explicitly so | ||
| # meson's atomics check can find <atomic> when configuring. | ||
| # Also pass mustache include path via cpp_args so meson's has_header check finds it. | ||
| extra_cxx_args = ["-I#{buildpath}/mustache"] | ||
| if OS.mac? | ||
| sdk_cxx_include = MacOS::CLT.sdk_path/"usr/include/c++/v1" | ||
| extra_cxx_args << "-isystem#{sdk_cxx_include}" if sdk_cxx_include.exist? | ||
| end | ||
|
|
||
| system "meson", "setup", "build", | ||
| "-Dcpp_args=#{extra_cxx_args.join(" ")}", | ||
| *std_meson_args |
Member
There was a problem hiding this comment.
Suggested change
| # On macOS, CLT 17+ moved C++ stdlib headers into the SDK; pass them explicitly so | |
| # meson's atomics check can find <atomic> when configuring. | |
| # Also pass mustache include path via cpp_args so meson's has_header check finds it. | |
| extra_cxx_args = ["-I#{buildpath}/mustache"] | |
| if OS.mac? | |
| sdk_cxx_include = MacOS::CLT.sdk_path/"usr/include/c++/v1" | |
| extra_cxx_args << "-isystem#{sdk_cxx_include}" if sdk_cxx_include.exist? | |
| end | |
| system "meson", "setup", "build", | |
| "-Dcpp_args=#{extra_cxx_args.join(" ")}", | |
| *std_meson_args | |
| Is mustache build only? Since `buildpath` is a temporary path, this will not work at runtime. | |
| Anyway, this can be changed for now as follows: | |
| ```suggestion | |
| ENV.append_to_cflags "-I#{buildpath}/mustache" | |
| system "meson", "setup", "build", *std_meson_args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libkiwix is a dependency of kiwix/kiwix-tools. Will be submitting kiwix-tools after this merges. In my local testing they work together correctly.
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>?brew test <formula>?brew audit --strict <formula>(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it passbrew audit --new <formula>?AI helped define the mustache dependency, the install steps, and test steps. kiwix-tools, a consumer of libkiwix, works correctly on my local system.