commit:     e082cbd69d9b535ab62e89360efd3aac1f5f3115
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 13 09:13:23 2017 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Dec 17 21:08:11 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e082cbd6

app-arch/xz-utils: Support disabling unnecessary filters

Closes: https://bugs.gentoo.org/641488
Closes: https://github.com/gentoo/gentoo/pull/6547
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 app-arch/xz-utils/metadata.xml          |  5 +++++
 app-arch/xz-utils/xz-utils-5.2.3.ebuild | 16 +++++++++++++++-
 app-arch/xz-utils/xz-utils-9999.ebuild  | 16 +++++++++++++++-
 3 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/app-arch/xz-utils/metadata.xml b/app-arch/xz-utils/metadata.xml
index 56c12441305..fac09b73379 100644
--- a/app-arch/xz-utils/metadata.xml
+++ b/app-arch/xz-utils/metadata.xml
@@ -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>

diff --git a/app-arch/xz-utils/xz-utils-5.2.3.ebuild 
b/app-arch/xz-utils/xz-utils-5.2.3.ebuild
index f15ced82058..bd59ee3b45a 100644
--- a/app-arch/xz-utils/xz-utils-5.2.3.ebuild
+++ b/app-arch/xz-utils/xz-utils-5.2.3.ebuild
@@ -27,7 +27,7 @@ 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
@@ -35,6 +35,9 @@ RDEPEND="!<app-arch/lzma-4.63
 DEPEND="${RDEPEND}
        ${EXTRA_DEPEND}"
 
+# Tests currently do not account for smaller feature set
+RESTRICT="!extra-filters? ( test )"
+
 src_prepare() {
        if [[ ${PV} == "9999" ]] ; then
                eautopoint
@@ -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[@]}"

diff --git a/app-arch/xz-utils/xz-utils-9999.ebuild 
b/app-arch/xz-utils/xz-utils-9999.ebuild
index e437466c00f..1fe45b2c25e 100644
--- a/app-arch/xz-utils/xz-utils-9999.ebuild
+++ b/app-arch/xz-utils/xz-utils-9999.ebuild
@@ -27,7 +27,7 @@ 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
@@ -35,6 +35,9 @@ RDEPEND="!<app-arch/lzma-4.63
 DEPEND="${RDEPEND}
        ${EXTRA_DEPEND}"
 
+# Tests currently do not account for smaller feature set
+RESTRICT="!extra-filters? ( test )"
+
 src_prepare() {
        if [[ ${PV} == "9999" ]] ; then
                eautopoint
@@ -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[@]}"

Reply via email to