[gentoo-dev] Re: [PATCH] kernel-2.eclass: EAPI 7 support

2021-02-05 Thread David Michael
On Fri, Feb 5, 2021 at 12:58 PM David Michael  wrote:
> This converts installation paths prefixed with EROOT or ED to have
> a leading slash, switches DEPEND to BDEPEND for EAPI 7 so tools are
> installed in BROOT and natively executable, and makes eapply_user
> the default src_prepare behavior for EAPIs since 6.
>
> It also drops the binutils build-time dependency since it was added
> in the original kernel.eclass implementation ~20 years ago to
> enforce a minimum version to avoid old assembly bugs.  All affected
> versions are long gone, and it isn't required to install sources
> anyway, so skip building the unused binutils dependency.

Oops, I forgot about the bug.  If someone applies this, you can add
the following line here:

Closes: https://bugs.gentoo.org/702280



[gentoo-dev] [PATCH] kernel-2.eclass: EAPI 7 support

2021-02-05 Thread David Michael
This converts installation paths prefixed with EROOT or ED to have
a leading slash, switches DEPEND to BDEPEND for EAPI 7 so tools are
installed in BROOT and natively executable, and makes eapply_user
the default src_prepare behavior for EAPIs since 6.

It also drops the binutils build-time dependency since it was added
in the original kernel.eclass implementation ~20 years ago to
enforce a minimum version to avoid old assembly bugs.  All affected
versions are long gone, and it isn't required to install sources
anyway, so skip building the unused binutils dependency.

Signed-off-by: David Michael 
---

Hi,

Can the kernel eclass support EAPI 7 now?  It would help auditing
dependencies to eventually support BDEPEND properly in the ebuilds using
the eclass.

The patch also corrects some whitespace issues that my editor was
highlighting, like extra end-of-line space or random embedded tabs.  I
could drop those changes if needed.

Thanks.

David

 eclass/kernel-2.eclass | 67 +++---
 1 file changed, 31 insertions(+), 36 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index dccd39ec8f2..12ab19baee7 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: kernel-2.eclass
@@ -8,7 +8,7 @@
 # John Mylchreest 
 # Mike Pagano 
 # 
-# @SUPPORTED_EAPIS: 2 3 4 5 6
+# @SUPPORTED_EAPIS: 2 3 4 5 6 7
 # @BLURB: Eclass for kernel packages
 # @DESCRIPTION:
 # This is the kernel.eclass rewrite for a clean base regarding the 2.6
@@ -28,7 +28,7 @@
 # @ECLASS-VARIABLE:  K_NODRYRUN
 # @DEFAULT_UNSET
 # @DESCRIPTION:
-# if this is set then patch --dry-run will not 
+# if this is set then patch --dry-run will not
 # be run. Certain patches will fail with this parameter
 # See bug #507656
 
@@ -198,11 +198,11 @@
 # If you do change them, there is a chance that we will not fix resulting bugs;
 # that of course does not mean we're not willing to help.
 
-inherit toolchain-funcs
+inherit estack toolchain-funcs
 [[ ${EAPI:-0} == [012345] ]] && inherit epatch
-[[ ${EAPI:-0} == [0123456] ]] && inherit estack eapi7-ver
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
 case ${EAPI:-0} in
-   2|3|4|5|6)
+   2|3|4|5|6|7)
EXPORT_FUNCTIONS src_{unpack,prepare,compile,install,test} \
pkg_{setup,preinst,postinst,postrm} ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
@@ -314,7 +314,6 @@ handle_genpatches() {
 # - KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
 # - EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1)
 detect_version() {
-
# We've already run, so nothing to do here.
[[ -n ${KV_FULL} ]] && return 0
 
@@ -540,7 +539,6 @@ detect_version() {

UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.xz
 ${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.xz"
fi
 
-
fi
 
debug-print-kernel2-variables
@@ -600,10 +598,8 @@ kernel_is_2_6() {
 
 # Capture the sources type and set DEPENDs
 if [[ ${ETYPE} == sources ]]; then
-   DEPEND="!build? (
-   sys-apps/sed
-   >=sys-devel/binutils-2.11.90.0.31
-   )"
+   [[ ${EAPI} == [0-6] ]] && DEPEND="!build? ( sys-apps/sed )" ||
+   BDEPEND="!build? ( sys-apps/sed )"
RDEPEND="!build? (
dev-lang/perl
sys-devel/bc
@@ -638,7 +634,8 @@ if [[ ${ETYPE} == sources ]]; then
# tree has been dropped from the kernel.
kernel_is lt 4 14 && LICENSE+=" !deblob? ( 
linux-firmware )"
 
-   DEPEND+=" deblob? ( ${PYTHON_DEPS} )"
+   [[ ${EAPI} == [0-6] ]] && DEPEND+=" deblob? ( 
${PYTHON_DEPS} )" ||
+   BDEPEND+=" deblob? ( ${PYTHON_DEPS} )"
 
if [[ -n KV_MINOR ]]; then
DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
@@ -826,7 +823,7 @@ unpack_set_extraversion() {
 
 unpack_fix_install_path() {
cd "${S}"
-   sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile
+   sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile
 }
 
 # Compile Functions
@@ -855,7 +852,7 @@ compile_headers() {
 
# autoconf.h isnt generated unless it already exists. plus, we 
have
# no guarantee that any headers are installed on the system...
-   [[ -f ${EROOT}usr/include/linux/autoconf.h ]] \
+   [[ -f ${EROOT%/}/usr/include/linux/autoconf.h ]] \
|| touch include/linux/autoconf.h

[gentoo-dev] [PATCH] xorg-3.eclass: Call einstalldocs when not using XORG_MULTILIB

2021-01-09 Thread David Michael
DOCS only got installed from the multilib-minimal_src_install call,
so they were missing from non-multilib packages.  This corrects a
behavior difference from xorg-2.eclass where autotools-utils.eclass
installed DOCS for the non-multilib case.

Signed-off-by: David Michael 
---
 eclass/xorg-3.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 399fc8661f4..fcaeb84edca 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -424,6 +424,7 @@ xorg-3_src_install() {
multilib-minimal_src_install "$@"
else
emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die 
"emake install failed"
+   einstalldocs
fi
 
# Many X11 libraries unconditionally install developer documentation
-- 
2.26.2



Re: [gentoo-dev] [PATCH] vala.eclass: make has_version aware of ROOT for EAPI 7

2021-01-08 Thread David Michael
On Thu, Jan 7, 2021 at 3:42 AM Mart Raudsepp  wrote:
> Ühel kenal päeval, K, 06.01.2021 kell 19:27, kirjutas Matt Turner:
> > From: David Michael 
> > The vala dependencies are declared in BDEPEND since EAPI 7 so that
> > the valac command is natively executable.  With no arguments, the
> > has_version function would look for a cross-compiled vala package
> > in the target ROOT and always fail.
>
> I'm not exactly convinced that vapi stuff is arch independent and
> belongs in BDEPEND over DEPEND. Vala ships a lot of .vapi files along
> with valac that get used on compilation. Though the difference might be
> only when different endianness or size_of int

If there are target-specific files that need to be installed via
DEPEND, vala would still need to be installed in BDEPEND so that there
is an executable valac command, right?

In practice, I don't think DEPEND usage matters yet because vala
support seems to require gobject-introspection, which is virtually
impossible to cross-compile.  (I plan to implement something like
Void[0] locally to try it some time.)

This patch is to fix packages like ibus[1] that depend on vala
regardless of my disabling the USE flag, where the current eclass
behavior unconditionally fails.

Thanks.

David

[0] https://maxice8.github.io/8-cross-the-gir
[1] 
https://github.com/gentoo/gentoo/blob/master/app-i18n/ibus/ibus-1.5.23.ebuild#L80



[gentoo-dev] [PATCH] gnome2-utils.eclass: skip executing cross-compiled tools

2020-12-02 Thread David Michael
Executing tools installed in ROOT will fail when cross-compiling,
so this prints a warning about manually running the command instead
in that case.  The warning is copied from dev-libs/glib.

This also reorders the exception handling by increasing severity so
that the "nothing to do" non-error returns first, otherwise the
expected problem of unexecutable cross-compiled commands returns,
otherwise the unexpected problem of missing commands returns.

The immodule cache functions were updated to handle a different
problem.  They run native tools from BROOT, but they are not
guaranteed to exist while cross-compiling (e.g. gtk+ can't BDEPEND
on itself, so the cross-compiled gtk+ can be installed before the
native gtk+, which fails from gtk-query-immodules not existing).

Closes: https://bugs.gentoo.org/757483
Signed-off-by: David Michael 
---

Hi,

Here is an eclass patch to fix bug #757483.  I wasn't sure if the
cross-compiling message should be a warning while everything else was a
debug-print, but I left it matching what glib does.  The message in the
glib ebuilds should be dropped if this is applied.

Thanks.

David

 eclass/gnome2-utils.eclass | 98 +-
 1 file changed, 75 insertions(+), 23 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 06643db0f60..4abaf3a1a5c 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -16,8 +16,9 @@
 
 [[ ${EAPI:-0} == [012345] ]] && inherit multilib
 # eutils.eclass: emktemp
+# toolchain-funs.eclass: tc-is-cross-compiler
 # xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update
-inherit eutils xdg-utils
+inherit eutils toolchain-funcs xdg-utils
 
 case "${EAPI:-0}" in
0|1|2|3|4|5|6|7) ;;
@@ -125,13 +126,21 @@ gnome2_gconf_install() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
-   if [[ ! -x "${updater}" ]]; then
-   debug-print "${updater} is not executable"
+   if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
+   debug-print "No GNOME 2 GConf schemas found"
return
fi
 
-   if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
-   debug-print "No GNOME 2 GConf schemas found"
+   if tc-is-cross-compiler ; then
+   ewarn "Updating of GNOME 2 GConf schemas skipped due to 
cross-compilation."
+   ewarn "You might want to run gconftool-2 manually on the target 
for"
+   ewarn "your final image and re-run it when packages installing"
+   ewarn "GNOME 2 GConf schemas get upgraded or added to the 
image."
+   return
+   fi
+
+   if [[ ! -x "${updater}" ]]; then
+   debug-print "${updater} is not executable"
return
fi
 
@@ -166,13 +175,20 @@ gnome2_gconf_uninstall() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
-   if [[ ! -x "${updater}" ]]; then
-   debug-print "${updater} is not executable"
+   if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
+   debug-print "No GNOME 2 GConf schemas found"
return
fi
 
-   if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
-   debug-print "No GNOME 2 GConf schemas found"
+   if tc-is-cross-compiler ; then
+   ewarn "Removal of GNOME 2 GConf schemas skipped due to 
cross-compilation."
+   ewarn "You might want to run gconftool-2 manually on the target 
for"
+   ewarn "your final image to uninstall this package's schemas."
+   return
+   fi
+
+   if [[ ! -x "${updater}" ]]; then
+   debug-print "${updater} is not executable"
return
fi
 
@@ -269,13 +285,21 @@ gnome2_scrollkeeper_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
-   if [[ ! -x "${updater}" ]] ; then
-   debug-print "${updater} is not executable"
+   if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
+   debug-print "No scroll cache to update"
return
fi
 
-   if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
-   debug-print "No scroll cache to update"
+   if tc-is-cross-compiler ; then
+   ewarn "Updating of scrollkeeper database skipped due to 
cross-compilation."
+   ewarn "You might want to run scro

[gentoo-dev] [PATCH v2 2/2] selinux-policy-2.eclass: drop EAPI 5

2020-11-03 Thread David Michael
Signed-off-by: David Michael 
---

Changes since v1:
  - Dropped unnecessary EAPI default value
  - Fixed eapply array awareness

 eclass/selinux-policy-2.eclass | 47 +-
 1 file changed, 12 insertions(+), 35 deletions(-)

diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
index 3ba310e49de..5def86fbef9 100644
--- a/eclass/selinux-policy-2.eclass
+++ b/eclass/selinux-policy-2.eclass
@@ -7,7 +7,7 @@
 # @ECLASS: selinux-policy-2.eclass
 # @MAINTAINER:
 # seli...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: This eclass supports the deployment of the various SELinux modules 
in sec-policy
 # @DESCRIPTION:
 # The selinux-policy-2.eclass supports deployment of the various SELinux 
modules
@@ -75,8 +75,8 @@
 : ${SELINUX_GIT_BRANCH:="master"};
 
 case "${EAPI:-0}" in
-   0|1|2|3|4) die "EAPI<5 is not supported";;
-   5|6|7) : ;;
+   0|1|2|3|4|5) die "EAPI<6 is not supported";;
+   6|7) : ;;
*) die "unknown EAPI" ;;
 esac
 
@@ -87,10 +87,6 @@ case ${BASEPOL} in
EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy";;
 esac
 
-if [[ ${EAPI:-0} == 5 ]]; then
-   inherit eutils
-fi
-
 IUSE=""
 
 HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux;
@@ -117,7 +113,7 @@ else
RDEPEND=">=sys-apps/policycoreutils-2.0.82
>=sec-policy/selinux-base-policy-${PV}"
 fi
-if [[ ${EAPI:-0} == [56] ]]; then
+if [[ ${EAPI} == 6 ]]; then
DEPEND="${RDEPEND}
sys-devel/m4
>=sys-apps/checkpolicy-2.0.21"
@@ -162,25 +158,13 @@ selinux-policy-2_src_prepare() {
# Patch the sources with the base patchbundle
if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "" ]]; then
cd "${S}"
-   if [[ ${EAPI:-0} == 5 ]]; then
-   EPATCH_MULTI_MSG="Applying SELinux policy updates ... " 
\
-   EPATCH_SUFFIX="patch" \
-   EPATCH_SOURCE="${WORKDIR}" \
-   EPATCH_FORCE="yes" \
-   epatch
-   else
-   einfo "Applying SELinux policy updates ... "
-   eapply -p0 
"${WORKDIR}/0001-full-patch-against-stable-release.patch"
-   fi
+   einfo "Applying SELinux policy updates ... "
+   eapply -p0 
"${WORKDIR}/0001-full-patch-against-stable-release.patch"
fi
 
-   # Call in epatch_user. We do this early on as we start moving
+   # Call in eapply_user. We do this early on as we start moving
# files left and right hereafter.
-   if [[ ${EAPI:-0} == 5 ]]; then
-   epatch_user
-   else
-   eapply_user
-   fi
+   eapply_user
 
# Copy additional files to the 3rd_party/ location
if [[ "$(declare -p POLICY_FILES 2>/dev/null 2>&1)" == "declare -a"* ]] 
||
@@ -195,17 +179,10 @@ selinux-policy-2_src_prepare() {
 
# Apply the additional patches refered to by the module ebuild.
# But first some magic to differentiate between bash arrays and strings
-   if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* ]] 
||
-  [[ -n ${POLICY_PATCH} ]]; then
-   cd "${S}/refpolicy/policy/modules"
-   for POLPATCH in ${POLICY_PATCH[@]};
-   do
-   if [[ ${EAPI:-0} == 5 ]]; then
-   epatch "${POLPATCH}"
-   else
-   eapply "${POLPATCH}"
-   fi
-   done
+   if [[ "$(declare -p POLICY_PATCH 2>/dev/null 2>&1)" == "declare -a"* 
]]; then
+   [[ -n ${POLICY_PATCH[*]} ]] && eapply -d 
"${S}/refpolicy/policy/modules" "${POLICY_PATCH[@]}"
+   else
+   [[ -n ${POLICY_PATCH} ]] && eapply -d 
"${S}/refpolicy/policy/modules" ${POLICY_PATCH}
fi
 
# Collect only those files needed for this particular module
-- 
2.26.2



Re: [gentoo-dev] [PATCH 1/2] selinux-policy-2.eclass: add EAPI 7

2020-11-03 Thread David Michael
On Tue, Nov 3, 2020 at 2:46 AM Ulrich Mueller  wrote:
> >>>>> On Mon, 02 Nov 2020, David Michael wrote:
>
> > +if [[ ${EAPI:-0} == [56] ]]; then
>
> Substituting 0 is not necessary here.

I wrote it that way to match all other EAPI conditions in the file.
I'll remove it in the second patch where the other instances are
dropped as well so the commits are self-consistent atomic changes.

Thanks.

David



[gentoo-dev] [PATCH 1/2] selinux-policy-2.eclass: add EAPI 7

2020-11-02 Thread David Michael
Closes: https://bugs.gentoo.org/748483
Signed-off-by: David Michael 
---

Hi,

Please start allowing EAPI 7 SELinux policy ebuilds.

Thanks.

David

 eclass/selinux-policy-2.eclass | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
index c1e21974021..3ba310e49de 100644
--- a/eclass/selinux-policy-2.eclass
+++ b/eclass/selinux-policy-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # Eclass for installing SELinux policy, and optionally
@@ -7,7 +7,7 @@
 # @ECLASS: selinux-policy-2.eclass
 # @MAINTAINER:
 # seli...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: This eclass supports the deployment of the various SELinux modules 
in sec-policy
 # @DESCRIPTION:
 # The selinux-policy-2.eclass supports deployment of the various SELinux 
modules
@@ -76,7 +76,7 @@
 
 case "${EAPI:-0}" in
0|1|2|3|4) die "EAPI<5 is not supported";;
-   5|6) : ;;
+   5|6|7) : ;;
*) die "unknown EAPI" ;;
 esac
 
@@ -117,9 +117,15 @@ else
RDEPEND=">=sys-apps/policycoreutils-2.0.82
>=sec-policy/selinux-base-policy-${PV}"
 fi
-DEPEND="${RDEPEND}
-   sys-devel/m4
-   >=sys-apps/checkpolicy-2.0.21"
+if [[ ${EAPI:-0} == [56] ]]; then
+   DEPEND="${RDEPEND}
+   sys-devel/m4
+   >=sys-apps/checkpolicy-2.0.21"
+else
+   DEPEND="${RDEPEND}"
+   BDEPEND="sys-devel/m4
+   >=sys-apps/checkpolicy-2.0.21"
+fi
 
 EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst 
pkg_postrm
 
-- 
2.26.2



[gentoo-dev] [PATCH 2/2] selinux-policy-2.eclass: drop EAPI 5

2020-11-02 Thread David Michael
Signed-off-by: David Michael 
---

Grepping through the ebuilds using this eclass shows that they're all on
EAPI 6.  A bunch of workarounds could be dropped along with EAPI 5, but
it isn't necessary to fix anything, so feel free to ignore this patch.

 eclass/selinux-policy-2.eclass | 38 --
 1 file changed, 9 insertions(+), 29 deletions(-)

diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
index 3ba310e49de..ce7643ecf15 100644
--- a/eclass/selinux-policy-2.eclass
+++ b/eclass/selinux-policy-2.eclass
@@ -7,7 +7,7 @@
 # @ECLASS: selinux-policy-2.eclass
 # @MAINTAINER:
 # seli...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: This eclass supports the deployment of the various SELinux modules 
in sec-policy
 # @DESCRIPTION:
 # The selinux-policy-2.eclass supports deployment of the various SELinux 
modules
@@ -75,8 +75,8 @@
 : ${SELINUX_GIT_BRANCH:="master"};
 
 case "${EAPI:-0}" in
-   0|1|2|3|4) die "EAPI<5 is not supported";;
-   5|6|7) : ;;
+   0|1|2|3|4|5) die "EAPI<6 is not supported";;
+   6|7) : ;;
*) die "unknown EAPI" ;;
 esac
 
@@ -87,10 +87,6 @@ case ${BASEPOL} in
EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy";;
 esac
 
-if [[ ${EAPI:-0} == 5 ]]; then
-   inherit eutils
-fi
-
 IUSE=""
 
 HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux;
@@ -117,7 +113,7 @@ else
RDEPEND=">=sys-apps/policycoreutils-2.0.82
>=sec-policy/selinux-base-policy-${PV}"
 fi
-if [[ ${EAPI:-0} == [56] ]]; then
+if [[ ${EAPI:-0} == 6 ]]; then
DEPEND="${RDEPEND}
sys-devel/m4
>=sys-apps/checkpolicy-2.0.21"
@@ -162,25 +158,13 @@ selinux-policy-2_src_prepare() {
# Patch the sources with the base patchbundle
if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "" ]]; then
cd "${S}"
-   if [[ ${EAPI:-0} == 5 ]]; then
-   EPATCH_MULTI_MSG="Applying SELinux policy updates ... " 
\
-   EPATCH_SUFFIX="patch" \
-   EPATCH_SOURCE="${WORKDIR}" \
-   EPATCH_FORCE="yes" \
-   epatch
-   else
-   einfo "Applying SELinux policy updates ... "
-   eapply -p0 
"${WORKDIR}/0001-full-patch-against-stable-release.patch"
-   fi
+   einfo "Applying SELinux policy updates ... "
+   eapply -p0 
"${WORKDIR}/0001-full-patch-against-stable-release.patch"
fi
 
-   # Call in epatch_user. We do this early on as we start moving
+   # Call in eapply_user. We do this early on as we start moving
# files left and right hereafter.
-   if [[ ${EAPI:-0} == 5 ]]; then
-   epatch_user
-   else
-   eapply_user
-   fi
+   eapply_user
 
# Copy additional files to the 3rd_party/ location
if [[ "$(declare -p POLICY_FILES 2>/dev/null 2>&1)" == "declare -a"* ]] 
||
@@ -200,11 +184,7 @@ selinux-policy-2_src_prepare() {
cd "${S}/refpolicy/policy/modules"
for POLPATCH in ${POLICY_PATCH[@]};
do
-   if [[ ${EAPI:-0} == 5 ]]; then
-   epatch "${POLPATCH}"
-   else
-   eapply "${POLPATCH}"
-   fi
+   eapply "${POLPATCH}"
done
fi
 
-- 
2.26.2



Re: [gentoo-dev] Re: [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow

2020-09-09 Thread David Michael
On Wed, Sep 9, 2020 at 5:37 AM Alexis Ballier  wrote:
> On Tue, 8 Sep 2020 15:54:14 -0400
> David Michael  wrote:
>
> > Hi,
> >
> > This fix might not be so straightforward.  A configuration I tested
> > hit a dependency loop with shadow -> pambase -> systemd -> a bunch of
> > groups -> shadow.  It is possible to bootstrap around by emerging
> > shadow with no USE flags first, but I don't know how acceptable it is
> > to introduce new dep loops like this.
>
> what happens without your change ?

Someone reported an issue in https://bugs.gentoo.org/720948 that
showed shadow and groups are not ordered during installation.  I am
not sure what environment produced those symptoms since I never
encountered it, but you can rage-clean shadow and a group, delete the
group, then reinstall it to reproduce the problem.

Thanks.

David



[gentoo-dev] Re: [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow

2020-09-08 Thread David Michael
Hi,

This fix might not be so straightforward.  A configuration I tested
hit a dependency loop with shadow -> pambase -> systemd -> a bunch of
groups -> shadow.  It is possible to bootstrap around by emerging
shadow with no USE flags first, but I don't know how acceptable it is
to introduce new dep loops like this.

Thanks.

David



Re: [gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow

2020-09-08 Thread David Michael
On Tue, Sep 8, 2020 at 12:04 PM Michał Górny  wrote:
> On Tue, 2020-09-08 at 11:57 -0400, David Michael wrote:
> > Signed-off-by: David Michael 
> > ---
> >  eclass/acct-group.eclass | 6 +-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
> > index 19a378e0b06..56e6391ef42 100644
> > --- a/eclass/acct-group.eclass
> > +++ b/eclass/acct-group.eclass
> > @@ -34,8 +34,12 @@
> >  if [[ -z ${_ACCT_GROUP_ECLASS} ]]; then
> >  _ACCT_GROUP_ECLASS=1
> >
> > +# The groupadd utility is called in pkg_preinst.  It should be in IDEPEND.
> >  case ${EAPI:-0} in
> > - 7) ;;
> > + 7)
> > + BDEPEND="userland_GNU? ( sys-apps/shadow )"
>
> Nothing from shadow is used in src_install, so this BDEPEND is
> unnecessary.

It is a workaround for EAPI 7's lack of IDEPEND to attempt to handle
cross-compiling, where RDEPEND alone would never attempt to install
the package in the native root.  Other packages and eclasses have been
using this convention for the same reason (Emacs, fcaps.eclass, etc.).

Thanks.

David



[gentoo-dev] [PATCH 2/2] acct-user.eclass: declare the missing dependency on shadow

2020-09-08 Thread David Michael
Signed-off-by: David Michael 
---
 eclass/acct-user.eclass | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index 56a4e83e8bf..96a076e106e 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -42,8 +42,12 @@
 if [[ -z ${_ACCT_USER_ECLASS} ]]; then
 _ACCT_USER_ECLASS=1
 
+# The useradd utility is called in pkg_preinst.  It should be in IDEPEND.
 case ${EAPI:-0} in
-   7) ;;
+   7)
+   BDEPEND="userland_GNU? ( sys-apps/shadow )"
+   RDEPEND="${BDEPEND}"
+   ;;
*) die "EAPI=${EAPI:-0} not supported";;
 esac
 
-- 
2.26.2




[gentoo-dev] [PATCH 1/2] acct-group.eclass: declare the missing dependency on shadow

2020-09-08 Thread David Michael
Signed-off-by: David Michael 
---
 eclass/acct-group.eclass | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
index 19a378e0b06..56e6391ef42 100644
--- a/eclass/acct-group.eclass
+++ b/eclass/acct-group.eclass
@@ -34,8 +34,12 @@
 if [[ -z ${_ACCT_GROUP_ECLASS} ]]; then
 _ACCT_GROUP_ECLASS=1
 
+# The groupadd utility is called in pkg_preinst.  It should be in IDEPEND.
 case ${EAPI:-0} in
-   7) ;;
+   7)
+   BDEPEND="userland_GNU? ( sys-apps/shadow )"
+   RDEPEND="${BDEPEND}"
+   ;;
*) die "EAPI=${EAPI:-0} not supported";;
 esac
 
-- 
2.26.2




[gentoo-dev] [PATCH] rust-toolchain.eclass: support bootstrapping armv5te

2020-07-11 Thread David Michael
This adds support for using system-bootstrap to build Rust for the
armv5tel profile.  It does not add binary bootstrap compilers.

Signed-off-by: David Michael 
---

Hi,

I have an ARM9 chip that I'd like to be able to target for Rust
packages.  Things are getting masked in the armv5tel profile due to it
not having Rust binaries.  Can we start fixing this?

I've bootstrapped armv5te Rust by cross-compiling it, and it seems to
work.  I can send my ebuild changes if anyone wants to build their own
armv5te compiler, but the eclass should at least define its default
builtin target so that it can be built with USE=system-bootstrap.

Thanks.

David

 eclass/rust-toolchain.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/rust-toolchain.eclass b/eclass/rust-toolchain.eclass
index 9d7360ed1c4..9ae4ad93945 100644
--- a/eclass/rust-toolchain.eclass
+++ b/eclass/rust-toolchain.eclass
@@ -41,6 +41,7 @@ rust_abi() {
powerpc64*)   echo powerpc64-unknown-linux-gnu;;
x86_64*gnu)   echo x86_64-unknown-linux-gnu;;
x86_64*musl)  echo x86_64-unknown-linux-musl;;
+   armv5te*) echo armv5te-unknown-linux-gnueabi;;
armv6j*s*)echo arm-unknown-linux-gnueabi;;
armv6j*h*)echo arm-unknown-linux-gnueabihf;;
armv7a*h*)echo armv7-unknown-linux-gnueabihf;;
-- 
2.26.2




Re: [gentoo-dev] user.eclass ignores ROOT/SYSROOT

2020-05-05 Thread David Michael
On Tue, May 5, 2020 at 4:22 PM Peter Stuge  wrote:
> Hi,
>
> I'm trying something out over here and I'm surprised to find that
> acct-group/* do not work with ROOT+SYSROOT != "/".
>
> Should I file yet another bug about this?
>
> I suppose the limitation is in user.eclass, but what about the 11 bugs
> already filed about exactly this problem?
>
> They are easy to see in the dup bug list at https://bugs.gentoo.org/53269
>
> Unfortunately mgorny closed 53269 WONTFIX because GLEP-27 is Deferred,
> causing all dup and dep bugs to be forgotten. Sad panda.
>
> --8<-- reproduce
> # export r=$(mktemp -d)
> # ROOT=$r SYSROOT=$r strace -fe execve emerge baselayout acct-group/ftp 2>&1 
> | grep groupadd
> [pid 13269] execve("/usr/sbin/groupadd", ["groupadd", "-r", "-g", "21", 
> "ftp"], 0x5d7e299e2340 /* 227 vars */) = 0
> groupadd: cannot lock /etc/group; try again later.
>  *   groupadd -r ${opts} "${egroup}" || die
>  *   groupadd -r ${opts} "${egroup}" || die
> -->8--
>
> In my particular case -R $r would work just fine, but as can be seen
> in several of those 11 dup bugs it is not a general solution.
>
> Any ideas on how to solve this?

I know it's not a general fix, but my solution for building a separate
systemd root was to use sysusers.  You could try the eclass patch(es)
at https://bugs.gentoo.org/702624 if you're using at least systemd
245.  (Older versions work if you apply the upstream commit linked in
the bug.)  If you're running a systemd host with a non-systemd target,
you can still probably run "systemd-sysusers --root=$ROOT" after
emerge to generate the accounts that way.

Thanks.

David



[gentoo-dev] Re: [PATCH] rpm.eclass: use BDEPEND for EAPI 7

2020-04-20 Thread David Michael
On Sat, Apr 18, 2020 at 11:15 AM David Michael  wrote:
> The build system's rpm2tar command is executed during unpack, so it
> must be install in /.
>
> Signed-off-by: David Michael 
> ---
>
> This patch fixes failures like this:
> >>> Unpacking source...
> >>> Unpacking urw-fonts-2.4-9.fc13.src.rpm to 
> /var/tmp/portage/media-fonts/urw-fonts-2.4.9/work
> /var/tmp/portage/media-fonts/urw-fonts-2.4.9/temp/environment: line 850: 
> rpm2tar: command not found
>
>  eclass/rpm.eclass | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass
> index 3a29c7e9f76..d27f0a386c7 100644
> --- a/eclass/rpm.eclass
> +++ b/eclass/rpm.eclass
> @@ -8,7 +8,10 @@
>
>  inherit estack eutils
>
> -DEPEND=">=app-arch/rpm2targz-9.0.0.3g"
> +case "${EAPI:-0}" in
> +   [0-6]) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
> +   *) BDEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
> +esac
>
>  # @FUNCTION: rpm_unpack
>  # @USAGE: 
> --
> 2.21.1

Can someone apply this?



[gentoo-dev] [PATCH] rpm.eclass: use BDEPEND for EAPI 7

2020-04-18 Thread David Michael
The build system's rpm2tar command is executed during unpack, so it
must be install in /.

Signed-off-by: David Michael 
---

This patch fixes failures like this:
>>> Unpacking source...
>>> Unpacking urw-fonts-2.4-9.fc13.src.rpm to 
/var/tmp/portage/media-fonts/urw-fonts-2.4.9/work
/var/tmp/portage/media-fonts/urw-fonts-2.4.9/temp/environment: line 850: 
rpm2tar: command not found

 eclass/rpm.eclass | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass
index 3a29c7e9f76..d27f0a386c7 100644
--- a/eclass/rpm.eclass
+++ b/eclass/rpm.eclass
@@ -8,7 +8,10 @@
 
 inherit estack eutils
 
-DEPEND=">=app-arch/rpm2targz-9.0.0.3g"
+case "${EAPI:-0}" in
+   [0-6]) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
+   *) BDEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
+esac
 
 # @FUNCTION: rpm_unpack
 # @USAGE: 
-- 
2.21.1



Re: [gentoo-dev] [PATCH] fcaps.eclass: Remove sys-libs/libcap-ng support

2020-04-15 Thread David Michael
On Tue, Apr 14, 2020 at 10:32 PM Matt Turner  wrote:
> At the same time, fix the dependency on sys-libs/libcap by  moving it to
> RDEPEND, as dependencies in DEPEND/BDEPEND are not guaranteed to exist
> during pkg_postinst() when this eclass is intended to run.

The BDEPEND was added for https://bugs.gentoo.org/700018 , which is
still needed so the command is in / during sysroot builds, or
installing fails.  Maybe deps could be:

EAPI < 7: RDEPEND
EAPI = 7: RDEPEND + BDEPEND
EAPI > 7: IDEPEND

Thanks.

David



Re: [gentoo-dev] [PATCH] qt5-build.eclass: support sysroot builds

2020-03-27 Thread David Michael
On Fri, Mar 27, 2020 at 4:49 PM James Le Cuirot  wrote:
> On Fri, 27 Mar 2020 13:10:34 -0400
> David Michael  wrote:
>
> > I'd like to be able to install qt5 packages in a sysroot for staging,
> > and this is an initial patch for it.  The pkg-config variables might not
> > be required, but it seemed appropriate to pass the sysroot-configured
> > versions through the build.  There are a few caveats:
> >
> >   - The upstream configure scripts do some bad things like this:
> > https://code.qt.io/cgit/qt/qtbase.git/tree/configure.pri#n363
> > That makes the build fail for systems using lib64 (e.g. amd64).  I'm
> > able to work around this by defining PKG_CONFIG_LIBDIR for dev-qt/*.
>
> Indeed, that sucks. We should probably patch that out. I don't know
> what it means where it says "or use -pkg-config to override this test",
> do you?

I'm not sure, since -pkg-config is already being used by the eclass.
Maybe it was supposed to reference the -force-pkg-config option, which
I haven't tried.

> I suspect you could define PKG_CONFIG_LIBDIR=/ or anywhere that
> simply exists and it will still work because our wrapper redefines that
> variable anyway.
>
> >   - This isn't for real cross-compiling.  There are places where it
> > tries to execute cross-compiled programs that I haven't investigated
> > yet, so this is only for building a sysroot for an architecture
> > compatible with the build system for now.
>
> Understood. I did try to do cross-compiling with Qt4 once upon a time
> and I did make a little headway but it wasn't fun.
>
> >   - The qt packages depend on each other being installed in / as well as
> > the sysroot, so their ebuilds will need BDEPENDs added.
>
> I imagine you'd at least need qtcore for qmake and moc. Probably not
> the rest though?

I needed qtcore, qtgui, and qtwidgets in /, but it's possible there
are just bad configure scripts that I didn't dig into yet.  As for VLC
deps:
  - qtcore works as is
  - qtgui requires qtcore for bootstrap-private in /
  - qtwidgets requires qtgui in / for some opengl check
  - qtsvg and qtx11extras need qmake to build, but their packages will
be empty unless qtwidgets is installed in /

> >   - I've only gotten to testing a few packages that are dependencies of
> > other applications (like VLC), so I may be missing breakages.
> >
> > The patch basically just sets -sysroot when $SYSROOT is defined.  It
> > also needs to set -extprefix to the normal prefix, since otherwise it
> > would default to installing into /sysroot/prefix.  Is anyone involved in
> > qt maintenance more experienced with this and able to comment?
>
> I'm not the Qt guy but I am the cross guy. I'm not in a position to
> test this right now but it looks good and I love the simplicity of it.
> It's a hell of a lot simpler than Qt4 was. To be honest, we should be
> setting QMAKE_PKG_CONFIG regardless.



[gentoo-dev] [PATCH] qt5-build.eclass: support sysroot builds

2020-03-27 Thread David Michael
Signed-off-by: David Michael 
---

Hi,

I'd like to be able to install qt5 packages in a sysroot for staging,
and this is an initial patch for it.  The pkg-config variables might not
be required, but it seemed appropriate to pass the sysroot-configured
versions through the build.  There are a few caveats:

  - The upstream configure scripts do some bad things like this:
https://code.qt.io/cgit/qt/qtbase.git/tree/configure.pri#n363
That makes the build fail for systems using lib64 (e.g. amd64).  I'm
able to work around this by defining PKG_CONFIG_LIBDIR for dev-qt/*.

  - This isn't for real cross-compiling.  There are places where it
tries to execute cross-compiled programs that I haven't investigated
yet, so this is only for building a sysroot for an architecture
compatible with the build system for now.

  - The qt packages depend on each other being installed in / as well as
the sysroot, so their ebuilds will need BDEPENDs added.

  - I've only gotten to testing a few packages that are dependencies of
other applications (like VLC), so I may be missing breakages.

The patch basically just sets -sysroot when $SYSROOT is defined.  It
also needs to set -extprefix to the normal prefix, since otherwise it
would default to installing into /sysroot/prefix.  Is anyone involved in
qt maintenance more experienced with this and able to comment?

Thanks.

David

 eclass/qt5-build.eclass | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 70e9be80c98..7fe39e6a23b 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -479,7 +479,7 @@ qt5_symlink_tools_to_build_dir() {
 # Runs ./configure for modules belonging to qtbase.
 qt5_base_configure() {
# setup toolchain variables used by configure
-   tc-export AR CC CXX OBJDUMP RANLIB STRIP
+   tc-export AR CC CXX OBJDUMP PKG_CONFIG RANLIB STRIP
export LD="$(tc-getCXX)"
 
# bug 633838
@@ -487,6 +487,8 @@ qt5_base_configure() {
 
# configure arguments
local conf=(
+   ${SYSROOT:+-extprefix "${QT5_PREFIX}" -sysroot "${SYSROOT}"}
+
# installation paths
-prefix "${QT5_PREFIX}"
-bindir "${QT5_BINDIR}"
@@ -677,6 +679,7 @@ qt5_qmake_args() {
QMAKE_LINK=\"$(tc-getCXX)\" \
QMAKE_LINK_SHLIB=\"$(tc-getCXX)\" \
QMAKE_OBJCOPY=\"$(tc-getOBJCOPY)\" \
+   QMAKE_PKG_CONFIG=\"$(tc-getPKG_CONFIG)\" \
QMAKE_RANLIB= \
QMAKE_STRIP=\"$(tc-getSTRIP)\" \
QMAKE_CFLAGS=\"${CFLAGS}\" \
@@ -716,6 +719,7 @@ qt5_qmake() {
QMAKE_LINK="$(tc-getCXX)" \
QMAKE_LINK_SHLIB="$(tc-getCXX)" \
QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \
+   QMAKE_PKG_CONFIG="$(tc-getPKG_CONFIG)" \
QMAKE_RANLIB= \
QMAKE_STRIP="$(tc-getSTRIP)" \
QMAKE_CFLAGS="${CFLAGS}" \
-- 
2.21.1




[gentoo-dev] Re: [PATCH v2] fixheadtails.eclass: drop the sed dependency

2020-03-25 Thread David Michael
On Fri, Mar 20, 2020 at 5:12 PM David Michael  wrote:
> Signed-off-by: David Michael 
> ---
>
> Changes since v1:
>   * Drop the dependency altogether
>
>  eclass/fixheadtails.eclass | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/eclass/fixheadtails.eclass b/eclass/fixheadtails.eclass
> index c19d33924aa..475b182843a 100644
> --- a/eclass/fixheadtails.eclass
> +++ b/eclass/fixheadtails.eclass
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2014 Gentoo Foundation
> +# Copyright 1999-2020 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>
>  # @ECLASS: fixheadtails.eclass
> @@ -8,8 +8,6 @@
>  # Original author John Mylchreest 
>  # @BLURB: functions to replace obsolete head/tail with POSIX compliant ones
>
> -DEPEND=">=sys-apps/sed-4"
> -
>  _do_sed_fix() {
> einfo " - fixed $1"
> sed -i \
> --
> 2.21.1

Can this patch be applied?

Thanks.

David



[gentoo-dev] [PATCH v2] fixheadtails.eclass: drop the sed dependency

2020-03-20 Thread David Michael
Signed-off-by: David Michael 
---

Changes since v1:
  * Drop the dependency altogether

 eclass/fixheadtails.eclass | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/eclass/fixheadtails.eclass b/eclass/fixheadtails.eclass
index c19d33924aa..475b182843a 100644
--- a/eclass/fixheadtails.eclass
+++ b/eclass/fixheadtails.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: fixheadtails.eclass
@@ -8,8 +8,6 @@
 # Original author John Mylchreest 
 # @BLURB: functions to replace obsolete head/tail with POSIX compliant ones
 
-DEPEND=">=sys-apps/sed-4"
-
 _do_sed_fix() {
einfo " - fixed $1"
sed -i \
-- 
2.21.1




[gentoo-dev] [PATCH] fixheadtails.eclass: move sed to BDEPEND for EAPI 7

2020-03-20 Thread David Michael
It executes sed at build time, so it should be installed in /.

Signed-off-by: David Michael 
---

Hi,

Here is another simple dependency move to put a required program in the
correct ROOT so it can be executed during the build.  It's basically the
same as 814ab1294edf3565fc02fe63d15d6fa7ca886429.

Thanks.

David

 eclass/fixheadtails.eclass | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eclass/fixheadtails.eclass b/eclass/fixheadtails.eclass
index c19d33924aa..5d221ca678c 100644
--- a/eclass/fixheadtails.eclass
+++ b/eclass/fixheadtails.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: fixheadtails.eclass
@@ -8,7 +8,10 @@
 # Original author John Mylchreest 
 # @BLURB: functions to replace obsolete head/tail with POSIX compliant ones
 
-DEPEND=">=sys-apps/sed-4"
+case "${EAPI:-0}" in
+   [0-6]) DEPEND=">=sys-apps/sed-4" ;;
+   *) BDEPEND=">=sys-apps/sed-4" ;;
+esac
 
 _do_sed_fix() {
einfo " - fixed $1"
-- 
2.21.1




[gentoo-dev] [PATCH v2] fcaps.eclass: use BDEPEND for EAPI 7

2020-03-13 Thread David Michael
The eclass installs libcap to execute the setcap program, so it
must be installed in /.  Optional libcap linking is handled by the
USE=caps flag, which is unrelated to this eclass, so the DEPEND
declaration is not needed on EAPI 7.

Closes: https://bugs.gentoo.org/700018
Signed-off-by: David Michael 
---

Changes since v1:
  * Inverted patterns so EAPI 7+ is the default.

 eclass/fcaps.eclass | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 467f955f5e9..2b6e5be4683 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: fcaps.eclass
@@ -34,7 +34,10 @@ _FCAPS_ECLASS=1
 IUSE="+filecaps"
 
 # We can't use libcap-ng atm due to #471414.
-DEPEND="filecaps? ( sys-libs/libcap )"
+case "${EAPI:-0}" in
+   [0-6]) DEPEND="filecaps? ( sys-libs/libcap )" ;;
+   *) BDEPEND="filecaps? ( sys-libs/libcap )" ;;
+esac
 
 # @ECLASS-VARIABLE: FILECAPS
 # @DEFAULT_UNSET
-- 
2.21.1




[gentoo-dev] [PATCH] autotools.eclass: reorder sysroot M4 include dir option

2020-03-13 Thread David Michael
The old autoconf-2.13 version requires options to be specified
before the file name argument, so packages with WANT_AUTOCONF="2.1"
would fail to build in a sysroot with the -l option at the end.

Closes: https://bugs.gentoo.org/710792
Signed-off-by: David Michael 
---
 eclass/autotools.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 9df0e1b9366..625abd0e9d1 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: autotools.eclass
@@ -512,7 +512,7 @@ autotools_run_tool() {
fi
 
if ${m4flags} ; then
-   set -- "${1}" $(autotools_m4dir_include) "${@:2}" 
$(autotools_m4sysdir_include)
+   set -- "${1}" $(autotools_m4dir_include) 
$(autotools_m4sysdir_include) "${@:2}"
fi
 
# If the caller wants to probe something, then let them do it directly.
-- 
2.21.1




[gentoo-dev] [PATCH] fcaps.eclass: use BDEPEND for EAPI 7

2020-03-13 Thread David Michael
The eclass installs libcap to execute the setcap program, so it
must be installed in /.  Optional libcap linking is handled by the
USE=caps flag, which is unrelated to this eclass, so the DEPEND
declaration is not needed on EAPI 7.

Closes: https://bugs.gentoo.org/700018
Signed-off-by: David Michael 
---
 eclass/fcaps.eclass | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 467f955f5e9..b0479f32456 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: fcaps.eclass
@@ -34,7 +34,10 @@ _FCAPS_ECLASS=1
 IUSE="+filecaps"
 
 # We can't use libcap-ng atm due to #471414.
-DEPEND="filecaps? ( sys-libs/libcap )"
+case "${EAPI:-0}" in
+   7) BDEPEND="filecaps? ( sys-libs/libcap )" ;;
+   *) DEPEND="filecaps? ( sys-libs/libcap )" ;;
+esac
 
 # @ECLASS-VARIABLE: FILECAPS
 # @DEFAULT_UNSET
-- 
2.21.1