Diff file-5.37-r1 with a file-5.38

/usr/portage/sys-apps/file/file-5.38.ebuild 2020-01-05 14:15:00.000000000 +0300
13 13
	inherit autotools git-r3
14 14
else
15 15
	SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz"
16
	KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16
	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 17
fi
18 18

  
19 19
DESCRIPTION="identify a file's format by scanning binary data for patterns"
......
21 21

  
22 22
LICENSE="BSD-2"
23 23
SLOT="0"
24
IUSE="python static-libs zlib"
24
IUSE="bzip2 lzma python static-libs zlib"
25 25
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
26 26

  
27 27
DEPEND="
28
	bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
29
	lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
28 30
	python? (
29 31
		${PYTHON_DEPS}
30 32
		dev-python/setuptools[${PYTHON_USEDEP}]
......
33 35
RDEPEND="${DEPEND}
34 36
	python? ( !dev-python/python-magic )"
35 37

  
36
PATCHES=( "${FILESDIR}"/${P}-CVE-2019-18218.patch )
37

  
38 38
src_prepare() {
39 39
	default
40 40

  
......
50 50
	local myeconfargs=(
51 51
		--disable-libseccomp
52 52
		--enable-fsect-man5
53
		$(use_enable bzip2 bzlib)
54
		$(use_enable lzma xzlib)
53 55
		$(use_enable static-libs static)
54 56
		$(use_enable zlib)
55 57
	)
56
	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
58
	econf "${myeconfargs[@]}"
57 59
}
58 60

  
59
src_configure() {
61
build_src_configure() {
62
	local myeconfargs=(
63
		--disable-shared
64
		--disable-libseccomp
65
		--disable-bzlib
66
		--disable-xzlib
67
		--disable-zlib
68
	)
69
	tc-env_build econf "${myeconfargs[@]}"
70
}
71

  
72
need_build_file() {
60 73
	# when cross-compiling, we need to build up our own file
61 74
	# because people often don't keep matching host/target
62 75
	# file versions #362941
63
	if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
76
	tc-is-cross-compiler && ! has_version -b "~${CATEGORY}/${P}"
77
}
78

  
79
src_configure() {
80
	local ECONF_SOURCE=${S}
81

  
82
	if need_build_file; then
64 83
		mkdir -p "${WORKDIR}"/build || die
65 84
		cd "${WORKDIR}"/build || die
66
		tc-export_build_env BUILD_C{C,XX}
67
		ECONF_SOURCE="${S}" \
68
		ac_cv_header_zlib_h=no \
69
		ac_cv_lib_z_gzopen=no \
70
		CHOST=${CBUILD} \
71
		CFLAGS=${BUILD_CFLAGS} \
72
		CXXFLAGS=${BUILD_CXXFLAGS} \
73
		CPPFLAGS=${BUILD_CPPFLAGS} \
74
		LDFLAGS="${BUILD_LDFLAGS} -static" \
75
		CC=${BUILD_CC} \
76
		CXX=${BUILD_CXX} \
77
		econf --disable-shared --disable-libseccomp
85
		build_src_configure
78 86
	fi
79 87

  
80 88
	multilib-minimal_src_configure
......
91 99
}
92 100

  
93 101
src_compile() {
94
	if tc-is-cross-compiler && ! ROOT=/ has_version "~${CATEGORY}/${P}" ; then
102
	if need_build_file; then
95 103
		emake -C "${WORKDIR}"/build/src magic.h #586444
96 104
		emake -C "${WORKDIR}"/build/src file
97
		PATH="${WORKDIR}/build/src:${PATH}"
105
		local -x PATH="${WORKDIR}/build/src:${PATH}"
98 106
	fi
99 107
	multilib-minimal_src_compile
100 108

  
Thank you!