Skip to content

libkiwix 14.2.0 (new formula)#274802

Open
adamlamar wants to merge 1 commit intoHomebrew:mainfrom
adamlamar:libkiwix
Open

libkiwix 14.2.0 (new formula)#274802
adamlamar wants to merge 1 commit intoHomebrew:mainfrom
adamlamar:libkiwix

Conversation

@adamlamar
Copy link
Copy Markdown
Contributor

@adamlamar adamlamar commented Mar 28, 2026


libkiwix is a dependency of kiwix/kiwix-tools. Will be submitting kiwix-tools after this merges. In my local testing they work together correctly.

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>?
  • Is your test running fine brew test <formula>?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

AI helped define the mustache dependency, the install steps, and test steps. kiwix-tools, a consumer of libkiwix, works correctly on my local system.


@github-actions github-actions bot added new formula PR adds a new formula to Homebrew/homebrew-core icu4c ICU use is a significant feature of the PR or issue meson Meson use is a significant feature of the PR or issue labels Mar 28, 2026
@adamlamar adamlamar marked this pull request as ready for review March 28, 2026 21:27
#include <kiwix/kiwix_config.h>
#include <iostream>
int main() {
std::cout << "libkiwix " << LIBKIWIX_VERSION << std::endl;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@branchv branchv changed the title libkiwix 14.2.0 libkiwix 14.2.0 (new formula) Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

icu4c ICU use is a significant feature of the PR or issue meson Meson use is a significant feature of the PR or issue new formula PR adds a new formula to Homebrew/homebrew-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants