From f3fd75d2a3f90aff79896f4cf5e7f8679ef0f996 Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Tue, 14 Jul 2026 15:02:40 +0300
Subject: trinity-base-2.eclass: move addwrite/addpredict to src_configure()

The permissions are probably no longer necessary (the same goes for
likewise permissions in tqt) and should be removed in future, but it
will require some additional testing.

As for now move from global scope to trinity-base-2_src_configure()
because due to changes in portage sandboxing policies[1] it creates too
much problems.

[1]: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4671dba39326c02d2e649b95f211e16aa46cd275

Bug: https://mirror.git.trinitydesktop.org/gitea/TDE/tde-packaging-gentoo/issues/516
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 eclass/trinity-base-2.eclass | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/eclass/trinity-base-2.eclass b/eclass/trinity-base-2.eclass
index e37fcb5a..784bce7d 100644
--- a/eclass/trinity-base-2.eclass
+++ b/eclass/trinity-base-2.eclass
@@ -40,9 +40,6 @@ esac
 # Don't use Gentoo mirrors
 RESTRICT="mirror"
 
-addwrite "/usr/tqt3/etc/settings"
-addpredict "/usr/tqt3/etc/settings"
-
 # ban EAPI 0-6
 case ${EAPI} in
 	0|1|2|3|4|5|6) die "EAPI=${EAPI} is not supported" ;;
@@ -397,6 +394,15 @@ trinity-base-2_src_configure() {
 	debug-print-function ${FUNCNAME} "${@}"
 	local eg_cmakeargs
 
+	# FIXME: The permissions are probably no longer necessary (the same goes
+	#        for likewise permissions in tqt) and should be removed in future.
+	#        As for now they were moved from global scope here due to changes
+	#        in portage sandboxing policies.
+	# See: https://mirror.git.trinitydesktop.org/gitea/TDE/tde-packaging-gentoo/issues/516
+	addwrite "/usr/tqt3/etc/settings"
+	addpredict "/usr/tqt3/etc/settings"
+
+
 	[[ -n "${PREFIX}" ]] && export PREFIX="${TDEDIR}"
 
 	if [[ -n "${TRINITY_EXTRAGEAR_PACKAGING}" ]]; then
-- 
cgit v1.2.3

