app-arch/xz-utils: Support disabling unnecessary filters
authorMichał Górny <mgorny@gentoo.org>
Wed, 13 Dec 2017 09:13:23 +0000 (10:13 +0100)
committerThomas Deutschmann <whissi@gentoo.org>
Sun, 17 Dec 2017 21:08:11 +0000 (22:08 +0100)
Closes: https://bugs.gentoo.org/641488
Closes: https://github.com/gentoo/gentoo/pull/6547
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
app-arch/xz-utils/metadata.xml
app-arch/xz-utils/xz-utils-5.2.3.ebuild
app-arch/xz-utils/xz-utils-9999.ebuild

index 56c12441305763f03fbabf550cd183a254076708..fac09b73379abdfa009c2fa4288d18f844c9bd79 100644 (file)
@@ -5,4 +5,9 @@
        <email>base-system@gentoo.org</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>
index f15ced82058d3827b08c049f471516ac9c85a033..bd59ee3b45a738994738f6c17aee94c3b945cf81 100644 (file)
@@ -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[@]}"
index e437466c00f93498121dcec34b11bf56dcee6061..1fe45b2c25ed3f80698b06d3829d73b493d88f9d 100644 (file)
@@ -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[@]}"