commit:     b385f513fdd7fc944c020c2e499a2a9f8baff0ff
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 26 17:51:25 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Feb 26 17:51:59 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b385f513

sys-apps/file: add 5.47

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/file/Manifest         |   2 +
 sys-apps/file/file-5.47.ebuild | 187 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 189 insertions(+)

diff --git a/sys-apps/file/Manifest b/sys-apps/file/Manifest
index 0401fcfef7fa..b857c8497876 100644
--- a/sys-apps/file/Manifest
+++ b/sys-apps/file/Manifest
@@ -1,2 +1,4 @@
 DIST file-5.46.tar.gz 1312892 BLAKE2B 
2b1df136f01c253cc490b483c644403da0674692ef97ef9e1239878328cfb8ce2bc418c14626145719c69acab00d56b63b5340a2b56c276c996b1e6ad1bfe9b6
 SHA512 
a6cb7325c49fd4af159b7555bdd38149e48a5097207acbe5e36deb5b7493ad6ea94d703da6e0edece5bb32959581741f4213707e5cb0528cd46d75a97a5242dc
 DIST file-5.46.tar.gz.asc 195 BLAKE2B 
7a2a65f10cbfe921ae633a9bee3a56a98b8e3100b8cbfe4b4871ce3960f28e62bb9e7425f5c1bfe9b126f43d7dd4ddcb36220f07f979072a8ef5fe62c14b5ef8
 SHA512 
93f99b468bbda29eab6e37fdee1f1806a10b18206a85c68e888e967678cfd128bb9c34bc9835a699e447623ddf0e2ea041039a682f7be1db2ab37935fd4aafa0
+DIST file-5.47.tar.gz 2676776 BLAKE2B 
52b91ee7868a9b75431e00fca7f7db1362b3d39eb065f52434ea73d9ccd7497f3371f7e0a455644c56df3e6acee247208edc47bf8004fa922dba32786cc3e10c
 SHA512 
a19c1f2b584bcfa70d4a02545667a90ff9e069523a5fc7b84d79b2b32cb7e59b73c555943784a13d56fa6d4618e18a254fd6102187def1a4a7d936b41ae7ce31
+DIST file-5.47.tar.gz.asc 163 BLAKE2B 
32e6a0dab4e0981d2fbf6eae73e3ddc24b69ddcf316d3ae82045007a208cd28b02b54a705c114d5c9da5bdddc760003b190385c3732bcb7d9862dc359c496c37
 SHA512 
19dafce2906420855915493b7c20fdefdb6464090f96c8b431aa7b3c15899e2a57cdc96d586c2a3de113f5857c6b22f6ee9bc825275cdd7c26f6eb1eaaad7073

diff --git a/sys-apps/file/file-5.47.ebuild b/sys-apps/file/file-5.47.ebuild
new file mode 100644
index 000000000000..95e3022d87a7
--- /dev/null
+++ b/sys-apps/file/file-5.47.ebuild
@@ -0,0 +1,187 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{11..14} )
+
+inherit distutils-r1 toolchain-funcs multilib-minimal
+
+if [[ ${PV} == 9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/file/file";
+       inherit autotools git-r3
+else
+       VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/file.asc
+       inherit libtool verify-sig
+       SRC_URI="https://astron.com/pub/file/${P}.tar.gz";
+       SRC_URI+=" verify-sig? ( https://astron.com/pub/file/${P}.tar.gz.asc )"
+
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
+
+       BDEPEND="verify-sig? ( sec-keys/openpgp-keys-file )"
+fi
+
+DESCRIPTION="Identify a file's format by scanning binary data for patterns"
+HOMEPAGE="https://www.darwinsys.com/file/";
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="bzip2 lzip lzma python seccomp static-libs zlib zstd"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="
+       bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
+       lzip? ( app-arch/lzlib )
+       lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
+       seccomp? ( >=sys-libs/libseccomp-2.5.4[${MULTILIB_USEDEP}] )
+       zlib? ( >=virtual/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}] )
+       zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${DEPEND}
+       python? (
+               ${PYTHON_DEPS}
+               !dev-python/python-magic
+       )
+       seccomp? ( >=sys-libs/libseccomp-2.5.4[${MULTILIB_USEDEP}] )
+"
+BDEPEND+="
+       python? (
+               ${PYTHON_DEPS}
+               ${DISTUTILS_DEPS}
+       )
+"
+
+# https://bugs.gentoo.org/898676
+QA_CONFIG_IMPL_DECL_SKIP=( makedev )
+
+PATCHES=(
+       "${FILESDIR}/file-5.43-seccomp-fstatat64-musl.patch" #789336, not 
upstream yet
+       "${FILESDIR}/file-5.45-seccomp-sandbox.patch"
+)
+
+src_prepare() {
+       default
+
+       if [[ ${PV} == 9999 ]] ; then
+               eautoreconf
+       else
+               elibtoolize
+       fi
+
+       # Don't let python README kill main README, bug #60043
+       mv python/README.md python/README.python.md || die
+
+       # bug #662090
+       sed -i '[email protected]@README.python.md@' python/setup.py || die
+}
+
+multilib_src_configure() {
+       local myeconfargs=(
+               --enable-fsect-man5
+               $(use_enable bzip2 bzlib)
+               $(multilib_native_use_enable lzip lzlib)
+               $(use_enable lzma xzlib)
+               $(use_enable seccomp libseccomp)
+               $(use_enable static-libs static)
+               $(use_enable zlib)
+               $(use_enable zstd zstdlib)
+       )
+
+       econf "${myeconfargs[@]}"
+}
+
+build_src_configure() {
+       local myeconfargs=(
+               --disable-shared
+               --disable-libseccomp
+               --disable-bzlib
+               --disable-xzlib
+               --disable-zlib
+       )
+
+       econf_build "${myeconfargs[@]}"
+}
+
+need_build_file() {
+       # When cross-compiling, we need to build up our own file
+       # because people often don't keep matching host/target
+       # file versions, bug #362941
+       tc-is-cross-compiler && ! has_version -b "~${CATEGORY}/${P}"
+}
+
+src_configure() {
+       local ECONF_SOURCE="${S}"
+
+       if need_build_file ; then
+               mkdir -p "${WORKDIR}"/build || die
+               cd "${WORKDIR}"/build || die
+               build_src_configure
+       fi
+
+       multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+       if multilib_is_native_abi ; then
+               emake
+       else
+               # bug #586444
+               emake -C src magic.h
+               emake -C src libmagic.la
+       fi
+}
+
+src_compile() {
+       if need_build_file ; then
+               # bug #586444
+               emake -C "${WORKDIR}"/build/src magic.h
+               emake -C "${WORKDIR}"/build/src file
+               local -x PATH="${WORKDIR}/build/src:${PATH}"
+       fi
+
+       multilib-minimal_src_compile
+
+       if use python ; then
+               cd python || die
+               distutils-r1_src_compile
+       fi
+}
+
+src_test() {
+       multilib-minimal_src_test
+
+       if use python ; then
+               cd python || die
+               distutils-r1_src_test
+       fi
+}
+
+python_test() {
+       eunittest
+}
+
+multilib_src_install() {
+       if multilib_is_native_abi ; then
+               default
+       else
+               emake -C src install-{nodist_includeHEADERS,libLTLIBRARIES} 
DESTDIR="${D}"
+       fi
+}
+
+multilib_src_install_all() {
+       dodoc ChangeLog MAINT # README
+
+       # Required for `file -C`
+       insinto /usr/share/misc/magic
+       doins -r magic/Magdir/*
+
+       if use python ; then
+               cd python || die
+               distutils-r1_src_install
+       fi
+
+       find "${ED}" -type f -name "*.la" -delete || die
+}

Reply via email to