Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tool to create wheel + pc file from binary #50

Open
virtuald opened this issue Sep 27, 2024 · 2 comments
Open

tool to create wheel + pc file from binary #50

virtuald opened this issue Sep 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@virtuald
Copy link
Collaborator

I'm planning to move all my robotpy projects to meson, but hadn't really figured out the best way to make inter-wheel dependencies work -- so I'm glad I found this!

Background

My dependencies are built and published to a maven-like repo + artifacts. I take those, build pybind11 wrappers around them, and stick it all in a wheel that depends on other wheels (described here).

As part of this move to meson, I think what would make the most sense is for me to write a tool that gets the maven artifact, unzips it, adds a .pc file and entrypoint, and then publishes that wheel to pypi. Then all of my wrapper wheels can just specify the wheel that just has the native dependency in it in their build dependencies, and meson will magically find it and everything works.

The question

It seems to me that there are probably other people that would like to take binary artifacts and repackage them as wheels that can be consumed by something that uses pkg-config.

  • Does such a tool already exist?
  • If not, I'm going to write said tool, because I need it. Is there any interest in that tool living either in this repo, or another pypackaging-native repo?

I'm also open to alternative solutions as well.

@virtuald
Copy link
Collaborator Author

virtuald commented Oct 14, 2024

I wrote a hatchling plugin to do this, along with some other stuff: https://github.com/virtuald/hatch-pkgconf-meson/tree/main/hatch-mkpkgconf

@FFY00
Copy link
Contributor

FFY00 commented Jan 13, 2025

I generally just hardcode the file, like the one in https://github.com/pypackaging-native/pkgconf-pypi/blob/main/tests/packages/register-pkg-config-path/register_pkg_config_path/pkgconf/register_pkg_config_path.pc, as generally there isn't really need for it to be dynamic.

I also tried generating the file using Meson, but couldn't get meson-python to bundle it in the wheel.

On the use-cases where the file needs to be dynamic, you could have a template and render it via the build system.

@FFY00 FFY00 added the enhancement New feature or request label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants