Skip to content

feat: support pkg-config across all platforms#157

Open
JyJyJcr wants to merge 1 commit intometno:mainfrom
JyJyJcr:pkg-config
Open

feat: support pkg-config across all platforms#157
JyJyJcr wants to merge 1 commit intometno:mainfrom
JyJyJcr:pkg-config

Conversation

@JyJyJcr
Copy link
Copy Markdown

@JyJyJcr JyJyJcr commented Feb 19, 2026

Some macOS users (e.g., those using nix-darwin) rely on pkg-config to locate HDF5, but the current build script only checks Homebrew. Additionally, on Windows, if both a registry-detected version and a pkg-config version are available, the script does not allow selecting the pkg-config version.

This PR introduces a new pkg-config feature flag to explicitly enable HDF5 detection via pkg-config. The library search logic is updated to try pkg-config first on all operating systems when this feature is enabled.

For backward compatibility, this feature is enabled by default.

@mulimoen
Copy link
Copy Markdown
Collaborator

We will have to update all dependents of hdf5-sys to not use standard features and put pkg-config at toplevel hdf5. Unless your usecase is only using the hdf5-sys directly

@mulimoen
Copy link
Copy Markdown
Collaborator

Or we can always use pkg-config and fall back to other methods if pkg-config is failing. I am unfamiliar with pkg-config outside of linux, is it widely adopted?

@JyJyJcr
Copy link
Copy Markdown
Author

JyJyJcr commented Feb 19, 2026

At least on macOS, pkg-config is commonly used in *-sys crates. I’m less familiar with the Windows situation, but many *-sys crates simply try pkg-config first on all platforms. Though it may not cover every case, it is a simple solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants