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

Detection of system-provided liblzma fails on FreeBSD #125

Open
UnitedMarsupials opened this issue May 17, 2024 · 2 comments
Open

Detection of system-provided liblzma fails on FreeBSD #125

UnitedMarsupials opened this issue May 17, 2024 · 2 comments

Comments

@UnitedMarsupials
Copy link

UnitedMarsupials commented May 17, 2024

Modern FreeBSD-releases come with liblzma (and xz) included in the base system (along with libz and libbz2), but it is not detected by the lzma-sys/build.rs -- presumably because there is no matching pkg-config files for it.

It cannot be difficult to fix, but I cannot figure it out myself :(

@UnitedMarsupials
Copy link
Author

UnitedMarsupials commented May 18, 2024

Simply removing the pkg_config::probe_library call like this:

--- vendor/lzma-sys/build.rs    2023-12-04 16:32:19.000000000 -0500
+++ vendor/lzma-sys/build.rs    2023-12-11 18:09:40.320258000 -0500
@@ -19,5 +19,5 @@
     // Otherwise check the system to see if it has an lzma library already
     // installed that we can use.
-    if !want_static && !msvc && pkg_config::probe_library("liblzma").is_ok() {
+    if !want_static && !msvc {
         return;
     }

"works" in that the included xz-5.2 sources are ignored -- as they should be. But the build fails later, when linking something, that actually needs LZMA-functions.

How do I change the build.rs so that adds -lzma to the linker command-line of everything, that wants LZMA-functions? Some kind of ldflags.append('-lzma') before return-ing?

@UnitedMarsupials
Copy link
Author

Matter of fact, even if want_static is true, the system-provided /usr/lib/liblzma.a should be used...

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

No branches or pull requests

1 participant