pkgconfig icon indicating copy to clipboard operation
pkgconfig copied to clipboard

how to auto-install pkgconfig and use it from setup.py?

Open ThomasWaldmann opened this issue 2 years ago • 4 comments

at borgbackup, we use pkgconfig to locate some libraries we need for building some C extensions (using Cython) for our python code.

we have documented that pkgconfig MUST be installed before setup.py is invoked, but who reads docs? :-)

because pkgconfig is already needed at import time of setup.py (to build the C extensions), before setup(...) is invoked, we can't use setup_requires to have pkgconfig pulled automatically.

is there a way to have it pull pkgconfig automagically somehow?

https://github.com/borgbackup/borg/blob/1.2.0/setup.py

ThomasWaldmann avatar Feb 26 '22 22:02 ThomasWaldmann

Hmm, other then vendoring pkgconfig or installing directly from source up-front via pip I don't think this is possible.

matze avatar Feb 27 '22 11:02 matze

Hmm, considering that pkgconfig is just a single module / single file i would need to vendor (== put besides setup.py), that sounds like a good idea.

Anything from your side that might make this more complicated than it seems?

ThomasWaldmann avatar Feb 27 '22 12:02 ThomasWaldmann

Hmm, OTOH, even if we vendor pkgconfig python module, it will still need the pkg-config cli tool and that can be missing, too.

ThomasWaldmann avatar Feb 27 '22 12:02 ThomasWaldmann

Anything from your side that might make this more complicated than it seems?

Sorry for the late reply. No, I think it's a rational thing to do. Just look hat what pip vendors, that's a whole different level.

matze avatar Mar 04 '22 12:03 matze