commit:     762048810c50d1994b1af1c7d95b09353b78b38e
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Sun Feb  4 05:19:21 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb  5 14:12:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76204881

sys-apps/file: fix dependencies for USE=python

This uses DISTUTILS_OPTIONAL and manually adds dependencies based on
USE, but gets it wrong:

- it requires python/setuptools in DEPEND, whereas the eclass expects it
  in BDEPEND for cross building
- it adds all DEPEND to RDEPEND, which then includes setuptools
- it uses hardcoded setuptools stuff instead of the eclass recommended
  variable containing additional build time dependencies

It then also adds the correct BDEPEND version of the dependencies.

Solve this by ripping out the DEPEND handling altogether, and using a
minimal set of RDEPEND requirements.

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../file/{file-9999.ebuild => file-5.45-r4.ebuild} | 32 ++++++++++++----------
 sys-apps/file/file-9999.ebuild                     | 11 ++++----
 2 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/sys-apps/file/file-9999.ebuild b/sys-apps/file/file-5.45-r4.ebuild
similarity index 88%
copy from sys-apps/file/file-9999.ebuild
copy to sys-apps/file/file-5.45-r4.ebuild
index 1f2cf6f8d1ac..3876dcbbf72f 100644
--- a/sys-apps/file/file-9999.ebuild
+++ b/sys-apps/file/file-5.45-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -7,14 +7,14 @@ DISTUTILS_USE_PEP517=setuptools
 DISTUTILS_OPTIONAL=1
 PYTHON_COMPAT=( python3_{10..11} )
 
-inherit distutils-r1 libtool toolchain-funcs multilib-minimal
+inherit distutils-r1 toolchain-funcs multilib-minimal
 
 if [[ ${PV} == 9999 ]] ; then
        EGIT_REPO_URI="https://github.com/glensc/file.git";
        inherit autotools git-r3
 else
        VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/file.asc
-       inherit verify-sig
+       inherit autotools verify-sig
        SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz";
        SRC_URI+=" verify-sig? ( ftp://ftp.astron.com/pub/file/${P}.tar.gz.asc 
)"
 
@@ -35,17 +35,16 @@ DEPEND="
        bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
        lzip? ( app-arch/lzlib )
        lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
-       python? (
-               ${PYTHON_DEPS}
-               dev-python/setuptools[${PYTHON_USEDEP}]
-       )
        seccomp? ( >=sys-libs/libseccomp-2.5.4[${MULTILIB_USEDEP}] )
        zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
        zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
 "
 RDEPEND="
        ${DEPEND}
-       python? ( !dev-python/python-magic )
+       python? (
+               ${PYTHON_DEPS}
+               !dev-python/python-magic
+       )
        seccomp? ( >=sys-libs/libseccomp-2.5.4[${MULTILIB_USEDEP}] )
 "
 BDEPEND+="
@@ -60,17 +59,22 @@ QA_CONFIG_IMPL_DECL_SKIP=( makedev )
 
 PATCHES=(
        "${FILESDIR}/file-5.43-seccomp-fstatat64-musl.patch" #789336, not 
upstream yet
-       "${FILESDIR}/file-5.43-portage-sandbox.patch" #889046
+       "${FILESDIR}/file-5.45-seccomp-sandbox.patch"
+       "${FILESDIR}/${P}-32-bit-time_t.patch"
+       "${FILESDIR}/${P}-32-bit-time_t-deux.patch"
+       "${FILESDIR}/${P}-weak-magic-shell.patch" #908401
 )
 
 src_prepare() {
        default
 
-       if [[ ${PV} == 9999 ]] ; then
-               eautoreconf
-       else
-               elibtoolize
-       fi
+       #if [[ ${PV} == 9999 ]] ; then
+       #       eautoreconf
+       #else
+       #       elibtoolize
+       #fi
+       # Just for file-5.45-32-bit-time_t-deux.patch, drop in 5.46
+       eautoreconf
 
        # Don't let python README kill main README, bug #60043
        mv python/README.md python/README.python.md || die

diff --git a/sys-apps/file/file-9999.ebuild b/sys-apps/file/file-9999.ebuild
index 1f2cf6f8d1ac..19c650b61358 100644
--- a/sys-apps/file/file-9999.ebuild
+++ b/sys-apps/file/file-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -35,17 +35,16 @@ DEPEND="
        bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
        lzip? ( app-arch/lzlib )
        lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
-       python? (
-               ${PYTHON_DEPS}
-               dev-python/setuptools[${PYTHON_USEDEP}]
-       )
        seccomp? ( >=sys-libs/libseccomp-2.5.4[${MULTILIB_USEDEP}] )
        zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
        zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
 "
 RDEPEND="
        ${DEPEND}
-       python? ( !dev-python/python-magic )
+       python? (
+               ${PYTHON_DEPS}
+               !dev-python/python-magic
+       )
        seccomp? ( >=sys-libs/libseccomp-2.5.4[${MULTILIB_USEDEP}] )
 "
 BDEPEND+="

Reply via email to