Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/file/
Date: Tue, 19 Oct 2021 10:11:43
Message-Id: 1634638287.18fcd439557ad7bead7db8e9113adfdc820652e9.polynomial-c@gentoo
1 commit: 18fcd439557ad7bead7db8e9113adfdc820652e9
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 19 10:11:27 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 19 10:11:27 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18fcd439
7
8 sys-apps/file: Bump to version 5.41
9
10 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
11
12 sys-apps/file/Manifest | 1 +
13 sys-apps/file/file-5.41.ebuild | 144 +++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 145 insertions(+)
15
16 diff --git a/sys-apps/file/Manifest b/sys-apps/file/Manifest
17 index 87042e9a832..34a37c9cebd 100644
18 --- a/sys-apps/file/Manifest
19 +++ b/sys-apps/file/Manifest
20 @@ -1 +1,2 @@
21 DIST file-5.40.tar.gz 1004214 BLAKE2B 4e15a1ca62fe7c03c90b0e509dc899b87f4474f758ad3d08172b3d838dc3f7c2954ba1074eeeeb3da8c04b8df84eff2b8cdf3177da334a926914429df67f60bf SHA512 3b70df75fa4c9050d55b1ffdc28e5f3c8b8ef7d4efd1a06bf53f113b676d81114a85aae56e0897d32b53716662d64ad18ab251ca8c92c6405c69eb758bb99afb
22 +DIST file-5.41.tar.gz 1064097 BLAKE2B 56fe8a58d9497bb1bfe3ed6b3ce5df70dd27cc308eb0cfdac8e91ba81c733a96aa622c120ac59079986c6d84901c6f2d82fa24f698d481d7f77e6cfdd432d648 SHA512 bbf2d8e39450b31d0ba8d76d202790fea953775657f942f06e6dc9091798d4a395f7205e542388e4a25b6a4506d07f36c5c4da37cfce0734133e9203a3b00654
23
24 diff --git a/sys-apps/file/file-5.41.ebuild b/sys-apps/file/file-5.41.ebuild
25 new file mode 100644
26 index 00000000000..cb9244c374d
27 --- /dev/null
28 +++ b/sys-apps/file/file-5.41.ebuild
29 @@ -0,0 +1,144 @@
30 +# Copyright 1999-2021 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +PYTHON_COMPAT=( python3_{8..10} )
36 +DISTUTILS_OPTIONAL=1
37 +
38 +inherit distutils-r1 libtool toolchain-funcs multilib-minimal
39 +
40 +if [[ ${PV} == "9999" ]] ; then
41 + EGIT_REPO_URI="https://github.com/glensc/file.git"
42 + inherit autotools git-r3
43 +else
44 + SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz"
45 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
46 +fi
47 +
48 +DESCRIPTION="identify a file's format by scanning binary data for patterns"
49 +HOMEPAGE="https://www.darwinsys.com/file/"
50 +
51 +LICENSE="BSD-2"
52 +SLOT="0"
53 +IUSE="bzip2 lzma python seccomp static-libs zlib"
54 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
55 +
56 +DEPEND="
57 + bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
58 + lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
59 + python? (
60 + ${PYTHON_DEPS}
61 + dev-python/setuptools[${PYTHON_USEDEP}]
62 + )
63 + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )"
64 +RDEPEND="${DEPEND}
65 + python? ( !dev-python/python-magic )
66 + seccomp? ( sys-libs/libseccomp[${MULTILIB_USEDEP}] )"
67 +
68 +PATCHES=(
69 + "${FILESDIR}/file-5.39-portage-sandbox.patch" #713710 #728978
70 + "${FILESDIR}/file-5.40-seccomp-fstatat64-musl.patch" #789336, not upstream yet
71 +)
72 +
73 +src_prepare() {
74 + default
75 +
76 + if [[ ${PV} == 9999 ]] ; then
77 + eautoreconf
78 + fi
79 +
80 + elibtoolize
81 +
82 + # don't let python README kill main README #60043
83 + mv python/README.md python/README.python.md || die
84 + sed 's@××××××.md@README.python.md@' -i python/setup.py || die #662090
85 +}
86 +
87 +multilib_src_configure() {
88 + local myeconfargs=(
89 + --enable-fsect-man5
90 + $(use_enable bzip2 bzlib)
91 + $(use_enable lzma xzlib)
92 + $(use_enable seccomp libseccomp)
93 + $(use_enable static-libs static)
94 + $(use_enable zlib)
95 + )
96 + econf "${myeconfargs[@]}"
97 +}
98 +
99 +build_src_configure() {
100 + local myeconfargs=(
101 + --disable-shared
102 + --disable-libseccomp
103 + --disable-bzlib
104 + --disable-xzlib
105 + --disable-zlib
106 + )
107 + tc-env_build econf "${myeconfargs[@]}"
108 +}
109 +
110 +need_build_file() {
111 + # when cross-compiling, we need to build up our own file
112 + # because people often don't keep matching host/target
113 + # file versions #362941
114 + tc-is-cross-compiler && ! has_version -b "~${CATEGORY}/${P}"
115 +}
116 +
117 +src_configure() {
118 + local ECONF_SOURCE="${S}"
119 +
120 + if need_build_file ; then
121 + mkdir -p "${WORKDIR}"/build || die
122 + cd "${WORKDIR}"/build || die
123 + build_src_configure
124 + fi
125 +
126 + multilib-minimal_src_configure
127 +}
128 +
129 +multilib_src_compile() {
130 + if multilib_is_native_abi ; then
131 + emake
132 + else
133 + cd src || die
134 + emake magic.h #586444
135 + emake libmagic.la
136 + fi
137 +}
138 +
139 +src_compile() {
140 + if need_build_file ; then
141 + emake -C "${WORKDIR}"/build/src magic.h #586444
142 + emake -C "${WORKDIR}"/build/src file
143 + local -x PATH="${WORKDIR}/build/src:${PATH}"
144 + fi
145 + multilib-minimal_src_compile
146 +
147 + if use python ; then
148 + cd python || die
149 + distutils-r1_src_compile
150 + fi
151 +}
152 +
153 +multilib_src_install() {
154 + if multilib_is_native_abi ; then
155 + default
156 + else
157 + emake -C src install-{nodist_includeHEADERS,libLTLIBRARIES} DESTDIR="${D}"
158 + fi
159 +}
160 +
161 +multilib_src_install_all() {
162 + dodoc ChangeLog MAINT # README
163 +
164 + # Required for `file -C`
165 + insinto /usr/share/misc/magic
166 + doins -r magic/Magdir/*
167 +
168 + if use python ; then
169 + cd python || die
170 + distutils-r1_src_install
171 + fi
172 + find "${ED}" -type f -name "*.la" -delete || die
173 +}