Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

libarchive formula omits LZMA support #28478

Closed
dsoprea opened this issue Apr 17, 2014 · 11 comments
Closed

libarchive formula omits LZMA support #28478

dsoprea opened this issue Apr 17, 2014 · 11 comments

Comments

@dsoprea
Copy link

dsoprea commented Apr 17, 2014

Is there a reason for the "--without-lzma" switch (like a lack of library support under Mac)? I need LZMA (7-Zip).

    system "./configure", "--prefix=#{prefix}",
                          "--without-lzma",
                          "--without-lzo2",
                          "--without-nettle",
                          "--without-xml2"
@dsoprea dsoprea changed the title libarchive omits LZMA support libarchive formula omits LZMA support Apr 17, 2014
@mistydemeo
Copy link
Member

At a guess, it's just because it would a) add an extra dependency, b) it hasn't been requested yet. We could add an option!

I tried removing the flag, and it didn't build with lzma anyway since liblzma wasn't available:

checking lzmadec.h usability... no
checking lzmadec.h presence... no
checking for lzmadec.h... no
checking for lzmadec_decode in -llzmadec... no

@mistydemeo
Copy link
Member

It looks like we provide lzma via the xz formula, but it doesn't include the lzmadec.h header or a liblzmadec.

@dsoprea
Copy link
Author

dsoprea commented Apr 17, 2014

It does:

libarchive/libarchive$ grep lzma -R . | grep "\.h"
./archive.h:__LA_DECL int archive_read_support_compression_lzma(struct
archive *)
./archive.h:__LA_DECL int archive_read_support_filter_lzma(struct archive
*);
./archive.h:__LA_DECL int archive_write_set_compression_lzma(struct archive
*)
./archive.h:__LA_DECL int archive_write_add_filter_lzma(struct archive *);
./archive_read_support_filter_xz.c:#include <lzma.h>
./archive_read_support_filter_xz.c:#include <lzmadec.h>
./archive_read_support_format_7zip.c:#include <lzma.h>
./archive_read_support_format_xar.c:#include <lzma.h>
./archive_read_support_format_xar.c:#include <lzmadec.h>
./archive_util.c:#include <lzma.h>
./archive_write_add_filter_xz.c:#include <lzma.h>
./archive_write_set_format_7zip.c:#include <lzma.h>
./archive_write_set_format_xar.c:#include <lzma.h>

On the contrary, I would assume that we wouldn't arbitrarily pare-down the
builds... That we'd let them build with its defaults unless there are
something explicitly requested. That way, it's relatively compatible to
what's there when building from the source directly or installing a package
on a platform (like Ubuntu).

Either way, can't we just add the xz formula as a dependency? I've had to
work on one project in a terminal to Ubuntu, and am currently building the
source to try to get something local.

On Thu, Apr 17, 2014 at 2:06 PM, Misty De Meo notifications@github.comwrote:

It looks like we provide lzma via the xz formula, but it doesn't include
the lzmadec.h header or a liblzmadec.


Reply to this email directly or view it on GitHubhttps://github.com//issues/28478#issuecomment-40743969
.

@mistydemeo
Copy link
Member

Ignore that last comment.

@mistydemeo
Copy link
Member

Missed the part later in the configure script where it looks for them - yep, does seem to find them via xz.

@mistydemeo
Copy link
Member

depends_on 'xz' => :optional and removing --disable-lzma from the configure switch is enough to make this work.

@dsoprea
Copy link
Author

dsoprea commented Apr 17, 2014

Would LZMA access cause an unresolvable binding if xz isn't installed?

On Thu, Apr 17, 2014 at 2:21 PM, Misty De Meo notifications@github.comwrote:

depends_on 'xz' => :optional and removing --disable-lzma from the
configure switch is enough to make this work.


Reply to this email directly or view it on GitHubhttps://github.com//issues/28478#issuecomment-40745653
.

@mistydemeo
Copy link
Member

xz would be a dependency, so you'd need to installed to build libarchive with lzma, and if you removed xz then libarchive wouldn't work. (Same as any other dependency.)

@dsoprea
Copy link
Author

dsoprea commented Apr 17, 2014

I'm not familiar with the Homebrew formula declarative. There's no way to
configure one way if an optional dependency is satisfied or another if not?

On Thu, Apr 17, 2014 at 2:41 PM, Misty De Meo notifications@github.comwrote:

xz would be a dependency, so you'd need to installed to build libarchive
with lzma, and if you removed xz then libarchive wouldn't work. (Same as
any other dependency.)


Reply to this email directly or view it on GitHubhttps://github.com//issues/28478#issuecomment-40747978
.

@mistydemeo
Copy link
Member

Homebrew doesn't opportunistically pick up dependencies; it's on if requested, and off otherwise. (Since Homebrew also isolates the build environment, it means xz will not be visible if not requested, even if installed.)

@dsoprea
Copy link
Author

dsoprea commented Apr 17, 2014

Okay. Can you go ahead and make the update?

On Thu, Apr 17, 2014 at 2:58 PM, Misty De Meo notifications@github.comwrote:

Homebrew doesn't opportunistically pick up dependencies; it's on if
requested, and off otherwise. (Since Homebrew also isolates the build
environment, it means xz will not be visible if not requested, even if
installed.)


Reply to this email directly or view it on GitHubhttps://github.com//issues/28478#issuecomment-40749786
.

@adamv adamv closed this as completed in 0037865 Apr 25, 2014
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants