-
Notifications
You must be signed in to change notification settings - Fork 30
setup.py: Discover liblzma paths via pkg-config. #11
Conversation
Sorry @Bluehorn, I seem to have completely missed this pull request. I have never used See also #18, @jakirkham can you comment on this alternative idea? |
If you want to use |
Adding a Python dependency does seem unfortunate, especially as anyone using this backport would be doing it on an older system (less likely to have pip etc). |
It just feels funny to try to reproduce the work that This is why I was thinking this could be optional (i.e. If we want to ensure Perhaps a third option is just to add flags to |
If there's a common or typical way to specify the optional paths which we can follow, that would be sensible. |
Unfortunately adding any dependency to setup.py basically makes the package uninstallable. pip currently does not care and runs setup.py without any dependencies installed. This makes it impossible (for example) to use Cython for building extensions without including the generated C source files. The relevant issue in pip is this one: pypa/pip#1820 However, this seems to be a quite new feature of pip and I'd rather not make use of it until it is standard on most Python installations. Our build system routinely upgrades pip before installing anything else, but not everybody is doing that. And running pkg-config using subprocess.Popen is not really a big deal IMHO. |
I'm about to archive this repository, and so am closing the outstanding issues and pull requests. Thank you for your efforts though. |
I was unable to build backports.lzma on a RHEL5 system. RHEL5 does not include distribution packages for liblzma, therefore it was installed locally.
The usual way on Linux systems to discover libraries for building is to query the pkg-config tool. Unfortunately, the setup.py in backports.lzma does not do this yet.
This patch adds pkg-config integration. To stay compatible the pkg-config output is only added as last resort. IMHO it should be the first location to look at, but that's not for me to decide. With this patch backports.lzma builds fine for my case.