Skip to content

Commit

Permalink
app-arch/xz-utils: Support disabling unnecessary filters
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/641488
Closes: gentoo#6547
Signed-off-by: Thomas Deutschmann <[email protected]>
  • Loading branch information
mgorny authored and Whissi committed Dec 17, 2017
1 parent 1d4fb20 commit e082cbd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app-arch/xz-utils/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
<email>[email protected]</email>
<name>Gentoo Base System</name>
</maintainer>
<use>
<flag name='extra-filters'>Build additional filters that are not
used in any of the default xz presets. This includes delta
and BCJ coders, additional match finders and SHA256 checks.</flag>
</use>
</pkgmetadata>
16 changes: 15 additions & 1 deletion app-arch/xz-utils/xz-utils-5.2.3.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ HOMEPAGE="http://tukaani.org/xz/"
# See top-level COPYING file as it outlines the various pieces and their licenses.
LICENSE="public-domain LGPL-2.1+ GPL-2+"
SLOT="0"
IUSE="elibc_FreeBSD nls static-libs +threads"
IUSE="elibc_FreeBSD +extra-filters nls static-libs +threads"

RDEPEND="!<app-arch/lzma-4.63
!app-arch/lzma-utils
!<app-arch/p7zip-4.57"
DEPEND="${RDEPEND}
${EXTRA_DEPEND}"

# Tests currently do not account for smaller feature set
RESTRICT="!extra-filters? ( test )"

src_prepare() {
if [[ ${PV} == "9999" ]] ; then
eautopoint
Expand All @@ -52,6 +55,17 @@ multilib_src_configure() {
)
multilib_is_native_abi ||
myconf+=( --disable-{xz,xzdec,lzmadec,lzmainfo,lzma-links,scripts} )
if ! use extra-filters; then
myconf+=(
# LZMA1 + LZMA2 for standard .lzma & .xz files
--enable-encoders=lzma1,lzma2
--enable-decoders=lzma1,lzma2
# those are used by default, depending on preset
--enable-match-finders=hc3,hc4,bt4
# CRC64 is used by default, though some (old?) files use CRC32
--enable-checks=crc32,crc64
)
fi

use elibc_FreeBSD && export ac_cv_header_sha256_h=no #545714
ECONF_SOURCE="${S}" econf "${myconf[@]}"
Expand Down
16 changes: 15 additions & 1 deletion app-arch/xz-utils/xz-utils-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ HOMEPAGE="http://tukaani.org/xz/"
# See top-level COPYING file as it outlines the various pieces and their licenses.
LICENSE="public-domain LGPL-2.1+ GPL-2+"
SLOT="0"
IUSE="elibc_FreeBSD nls static-libs +threads"
IUSE="elibc_FreeBSD +extra-filters nls static-libs +threads"

RDEPEND="!<app-arch/lzma-4.63
!app-arch/lzma-utils
!<app-arch/p7zip-4.57"
DEPEND="${RDEPEND}
${EXTRA_DEPEND}"

# Tests currently do not account for smaller feature set
RESTRICT="!extra-filters? ( test )"

src_prepare() {
if [[ ${PV} == "9999" ]] ; then
eautopoint
Expand All @@ -52,6 +55,17 @@ multilib_src_configure() {
)
multilib_is_native_abi ||
myconf+=( --disable-{xz,xzdec,lzmadec,lzmainfo,lzma-links,scripts} )
if ! use extra-filters; then
myconf+=(
# LZMA1 + LZMA2 for standard .lzma & .xz files
--enable-encoders=lzma1,lzma2
--enable-decoders=lzma1,lzma2
# those are used by default, depending on preset
--enable-match-finders=hc3,hc4,bt4
# CRC64 is used by default, though some (old?) files use CRC32
--enable-checks=crc32,crc64
)
fi

use elibc_FreeBSD && export ac_cv_header_sha256_h=no #545714
ECONF_SOURCE="${S}" econf "${myconf[@]}"
Expand Down

0 comments on commit e082cbd

Please sign in to comment.