From ab3895a75a3e62ea72cb233767ab8f56fc235450 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Sun, 31 Dec 2023 15:38:17 +0300 Subject: trinity-base/tdebase-starttde: modify PATH for Gentoo Signed-off-by: Alexander Golubev --- .../files/tdebase-starttde-14-gentoo.patch | 90 ++++++++++++++++++++++ .../tdebase-starttde-14.1.0-r1.ebuild | 86 +++++++++++++++++++++ .../tdebase-starttde-14.1.0.ebuild | 84 -------------------- .../tdebase-starttde-14.1.1-r1.ebuild | 86 +++++++++++++++++++++ .../tdebase-starttde-14.1.1.ebuild | 84 -------------------- .../tdebase-starttde/tdebase-starttde-9999.ebuild | 2 + 6 files changed, 264 insertions(+), 168 deletions(-) create mode 100644 trinity-base/tdebase-starttde/files/tdebase-starttde-14-gentoo.patch create mode 100644 trinity-base/tdebase-starttde/tdebase-starttde-14.1.0-r1.ebuild delete mode 100644 trinity-base/tdebase-starttde/tdebase-starttde-14.1.0.ebuild create mode 100644 trinity-base/tdebase-starttde/tdebase-starttde-14.1.1-r1.ebuild delete mode 100644 trinity-base/tdebase-starttde/tdebase-starttde-14.1.1.ebuild diff --git a/trinity-base/tdebase-starttde/files/tdebase-starttde-14-gentoo.patch b/trinity-base/tdebase-starttde/files/tdebase-starttde-14-gentoo.patch new file mode 100644 index 00000000..0b53033c --- /dev/null +++ b/trinity-base/tdebase-starttde/files/tdebase-starttde-14-gentoo.patch @@ -0,0 +1,90 @@ +diff --git a/starttde b/starttde +index 66360e228..512bff7d5 100755 +--- a/starttde ++++ b/starttde +@@ -3,18 +3,6 @@ + # DEFAULT TRINITY STARTUP SCRIPT + # + +-# This block might not be appropriate for all systems. +-# It should work for command line logins but graphical +-# login managers might already source these files. +-# Multiple sourcing is not a problem when the files are only +-# containers for environment variables and such. +-if [ -r /etc/xprofile ]; then +- . /etc/xprofile +-fi +-if [ -r $HOME/.xprofile ]; then +- . $HOME/.xprofile +-fi +- + # Some functions to parse and check path correctly ... + # Usage: is_in_path PATH /usr/bin + is_in_path() { +@@ -68,6 +56,31 @@ remove_from_path() { + eval export $var=${NPATH#:} + } + ++# Gentoo: In Gentoo $TDE_DIR/bin is in PATH by default, but it's located after /usr/bin, ++# so to avoid running kf5 apps instead of TDE's one make sure it goes first ++ ++TDE_BIN_DIR="$(dirname -- "$0")" ++if ! is_before_in_path PATH "$TDE_BIN_DIR" "/usr/bin"; then ++ remove_from_path PATH "$TDE_BIN_DIR" ++ place_before_in_path PATH "$TDE_BIN_DIR" "/usr/bin" ++fi ++unset TDE_BIN_DIR ++ ++# Gentoo: to avoid messing PATH that user might have set we moved .xprofile ++# import here rather from the very begining of the script ++# ++# This block might not be appropriate for all systems. ++# It should work for command line logins but graphical ++# login managers might already source these files. ++# Multiple sourcing is not a problem when the files are only ++# containers for environment variables and such. ++if [ -r /etc/xprofile ]; then ++ . /etc/xprofile ++fi ++if [ -r $HOME/.xprofile ]; then ++ . $HOME/.xprofile ++fi ++ + # Portable alternative to the file operator -nt (among shells) + is_newer() { + if test -n "$(find $1 -prune -newer $2 -print)" +@@ -205,19 +218,21 @@ fi + + # Modify the following environment variables only as necessary. + +- if ! is_in_path PATH "$TDEDIR/games" ; then +- # Respect the traditional path order. Don't blindly place $TDEDIR/games +- # first in the path. Only place $TDEDIR/games before /usr/games. If packagers +- # are adding $TDEDIR/games elsewhere, then they need to ensure the traditional +- # search patch is respected. +- # Is there a way we can check that $TDEDIR/games is always placed only just before +- # /usr/games in the search path? +- if is_in_path PATH "/usr/games"; then +- place_before_in_path PATH "$TDEDIR/games" "/usr/games" +- else +- export PATH=$TDEDIR/games:$PATH +- fi +- fi ++# Gentoo: there is no */games/bin directories in gentoo ++# ++# if ! is_in_path PATH "$TDEDIR/games" ; then ++# # Respect the traditional path order. Don't blindly place $TDEDIR/games ++# # first in the path. Only place $TDEDIR/games before /usr/games. If packagers ++# # are adding $TDEDIR/games elsewhere, then they need to ensure the traditional ++# # search patch is respected. ++# # Is there a way we can check that $TDEDIR/games is always placed only just before ++# # /usr/games in the search path? ++# if is_in_path PATH "/usr/games"; then ++# place_before_in_path PATH "$TDEDIR/games" "/usr/games" ++# else ++# export PATH=$TDEDIR/games:$PATH ++# fi ++# fi + + if ! is_in_path PATH "$TDEDIR/bin" ; then + # Respect the traditional path order. Don't blindly place $TDEDIR/bin diff --git a/trinity-base/tdebase-starttde/tdebase-starttde-14.1.0-r1.ebuild b/trinity-base/tdebase-starttde/tdebase-starttde-14.1.0-r1.ebuild new file mode 100644 index 00000000..8215e74a --- /dev/null +++ b/trinity-base/tdebase-starttde/tdebase-starttde-14.1.0-r1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2023 Gentoo Authors +# Copyright 2020-2023 The Trinity Desktop Project +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +TRINITY_MODULE_NAME="tdebase" +TRINITY_MODULE_TYPE="core" +TSM_EXTRACT="starttde README.pam INSTALL AUTHORS COPYING COPYING-DOCS tdm r14-xdg-update migratekde3" +inherit trinity-meta-2 + +DESCRIPTION="Starttde script, which starts a complete Trinity session, and associated scripts" +if [[ ${PV} != *9999* ]] ; then + KEYWORDS="~amd64 ~arm64 ~x86" +fi + +RDEPEND="x11-apps/xmessage + x11-apps/xsetroot + x11-apps/xset + x11-apps/xrandr + x11-apps/mkfontscale + x11-apps/xprop + ~trinity-base/kdesktop-${PV} + ~trinity-base/kcminit-${PV} + ~trinity-base/ksmserver-${PV} + ~trinity-base/twin-${PV} + ~trinity-base/kpersonalizer-${PV} + ~trinity-base/kreadconfig-${PV} + ~trinity-base/ksplashml-${PV} + ~trinity-base/tdeinit-${PV}" + +PATCHES=( "${FILESDIR}/${PN}-14-gentoo.patch" ) + +src_prepare() { + trinity-base-2_src_prepare +} + +src_configure() { + echo -n ""; +} + +src_compile() { + # List all the multilib libdirs + local _libdir _libdirs + for _libdir in $(get_all_libdirs); do + _libdirs="${_libdirs}:${TDEDIR}/${_libdir}" + done + _libdirs=${_libdirs#:} +} + +src_install() { + # starttde script + exeinto "${TDEDIR}/bin" + doexe starttde + doexe r14-xdg-update + doexe migratekde3 + + # startup and shutdown scripts + exeinto "${TDEDIR}/env" + doexe "${FILESDIR}/agent-startup.sh" + + exeinto "${TDEDIR}/shutdown" + doexe "${FILESDIR}/agent-shutdown.sh" + + # x11 session script + cat < "${T}/tde-${SLOT}" +#!/bin/sh +exec ${TDEDIR}/bin/starttde +EOF + exeinto /etc/X11/Sessions + doexe "${T}/tde-${SLOT}" # FIXME: change script branding to trinity + + # (not really) freedesktop compliant session script + sed -e "s:@TDE_BINDIR@:${TDEDIR}/bin:g;s:Name=Trinity:Name=Trinity ${SLOT}:" \ + "${S}/tdm/kfrontend/sessions/tde.desktop.in" > "${T}/tde-${SLOT}.desktop" + insinto /usr/share/xsessions + doins "${T}/tde-${SLOT}.desktop" +} + +pkg_postinst () { + echo + elog "To enable gpg-agent and/or ssh-agent in Trinity sessions," + elog "edit ${TDEDIR}/env/agent-startup.sh and" + elog "${TDEDIR}/shutdown/agent-shutdown.sh" + echo +} diff --git a/trinity-base/tdebase-starttde/tdebase-starttde-14.1.0.ebuild b/trinity-base/tdebase-starttde/tdebase-starttde-14.1.0.ebuild deleted file mode 100644 index 512a478c..00000000 --- a/trinity-base/tdebase-starttde/tdebase-starttde-14.1.0.ebuild +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Copyright 2020-2023 The Trinity Desktop Project -# Distributed under the terms of the GNU General Public License v2 - -EAPI="8" - -TRINITY_MODULE_NAME="tdebase" -TRINITY_MODULE_TYPE="core" -TSM_EXTRACT="starttde README.pam INSTALL AUTHORS COPYING COPYING-DOCS tdm r14-xdg-update migratekde3" -inherit trinity-meta-2 - -DESCRIPTION="Starttde script, which starts a complete Trinity session, and associated scripts" -if [[ ${PV} != *9999* ]] ; then - KEYWORDS="~amd64 ~arm64 ~x86" -fi - -RDEPEND="x11-apps/xmessage - x11-apps/xsetroot - x11-apps/xset - x11-apps/xrandr - x11-apps/mkfontscale - x11-apps/xprop - ~trinity-base/kdesktop-${PV} - ~trinity-base/kcminit-${PV} - ~trinity-base/ksmserver-${PV} - ~trinity-base/twin-${PV} - ~trinity-base/kpersonalizer-${PV} - ~trinity-base/kreadconfig-${PV} - ~trinity-base/ksplashml-${PV} - ~trinity-base/tdeinit-${PV}" - -src_prepare() { - trinity-base-2_src_prepare -} - -src_configure() { - echo -n ""; -} - -src_compile() { - # List all the multilib libdirs - local _libdir _libdirs - for _libdir in $(get_all_libdirs); do - _libdirs="${_libdirs}:${TDEDIR}/${_libdir}" - done - _libdirs=${_libdirs#:} -} - -src_install() { - # starttde script - exeinto "${TDEDIR}/bin" - doexe starttde - doexe r14-xdg-update - doexe migratekde3 - - # startup and shutdown scripts - exeinto "${TDEDIR}/env" - doexe "${FILESDIR}/agent-startup.sh" - - exeinto "${TDEDIR}/shutdown" - doexe "${FILESDIR}/agent-shutdown.sh" - - # x11 session script - cat < "${T}/tde-${SLOT}" -#!/bin/sh -exec ${TDEDIR}/bin/starttde -EOF - exeinto /etc/X11/Sessions - doexe "${T}/tde-${SLOT}" # FIXME: change script branding to trinity - - # (not really) freedesktop compliant session script - sed -e "s:@TDE_BINDIR@:${TDEDIR}/bin:g;s:Name=Trinity:Name=Trinity ${SLOT}:" \ - "${S}/tdm/kfrontend/sessions/tde.desktop.in" > "${T}/tde-${SLOT}.desktop" - insinto /usr/share/xsessions - doins "${T}/tde-${SLOT}.desktop" -} - -pkg_postinst () { - echo - elog "To enable gpg-agent and/or ssh-agent in Trinity sessions," - elog "edit ${TDEDIR}/env/agent-startup.sh and" - elog "${TDEDIR}/shutdown/agent-shutdown.sh" - echo -} diff --git a/trinity-base/tdebase-starttde/tdebase-starttde-14.1.1-r1.ebuild b/trinity-base/tdebase-starttde/tdebase-starttde-14.1.1-r1.ebuild new file mode 100644 index 00000000..8215e74a --- /dev/null +++ b/trinity-base/tdebase-starttde/tdebase-starttde-14.1.1-r1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2023 Gentoo Authors +# Copyright 2020-2023 The Trinity Desktop Project +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +TRINITY_MODULE_NAME="tdebase" +TRINITY_MODULE_TYPE="core" +TSM_EXTRACT="starttde README.pam INSTALL AUTHORS COPYING COPYING-DOCS tdm r14-xdg-update migratekde3" +inherit trinity-meta-2 + +DESCRIPTION="Starttde script, which starts a complete Trinity session, and associated scripts" +if [[ ${PV} != *9999* ]] ; then + KEYWORDS="~amd64 ~arm64 ~x86" +fi + +RDEPEND="x11-apps/xmessage + x11-apps/xsetroot + x11-apps/xset + x11-apps/xrandr + x11-apps/mkfontscale + x11-apps/xprop + ~trinity-base/kdesktop-${PV} + ~trinity-base/kcminit-${PV} + ~trinity-base/ksmserver-${PV} + ~trinity-base/twin-${PV} + ~trinity-base/kpersonalizer-${PV} + ~trinity-base/kreadconfig-${PV} + ~trinity-base/ksplashml-${PV} + ~trinity-base/tdeinit-${PV}" + +PATCHES=( "${FILESDIR}/${PN}-14-gentoo.patch" ) + +src_prepare() { + trinity-base-2_src_prepare +} + +src_configure() { + echo -n ""; +} + +src_compile() { + # List all the multilib libdirs + local _libdir _libdirs + for _libdir in $(get_all_libdirs); do + _libdirs="${_libdirs}:${TDEDIR}/${_libdir}" + done + _libdirs=${_libdirs#:} +} + +src_install() { + # starttde script + exeinto "${TDEDIR}/bin" + doexe starttde + doexe r14-xdg-update + doexe migratekde3 + + # startup and shutdown scripts + exeinto "${TDEDIR}/env" + doexe "${FILESDIR}/agent-startup.sh" + + exeinto "${TDEDIR}/shutdown" + doexe "${FILESDIR}/agent-shutdown.sh" + + # x11 session script + cat < "${T}/tde-${SLOT}" +#!/bin/sh +exec ${TDEDIR}/bin/starttde +EOF + exeinto /etc/X11/Sessions + doexe "${T}/tde-${SLOT}" # FIXME: change script branding to trinity + + # (not really) freedesktop compliant session script + sed -e "s:@TDE_BINDIR@:${TDEDIR}/bin:g;s:Name=Trinity:Name=Trinity ${SLOT}:" \ + "${S}/tdm/kfrontend/sessions/tde.desktop.in" > "${T}/tde-${SLOT}.desktop" + insinto /usr/share/xsessions + doins "${T}/tde-${SLOT}.desktop" +} + +pkg_postinst () { + echo + elog "To enable gpg-agent and/or ssh-agent in Trinity sessions," + elog "edit ${TDEDIR}/env/agent-startup.sh and" + elog "${TDEDIR}/shutdown/agent-shutdown.sh" + echo +} diff --git a/trinity-base/tdebase-starttde/tdebase-starttde-14.1.1.ebuild b/trinity-base/tdebase-starttde/tdebase-starttde-14.1.1.ebuild deleted file mode 100644 index 512a478c..00000000 --- a/trinity-base/tdebase-starttde/tdebase-starttde-14.1.1.ebuild +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Copyright 2020-2023 The Trinity Desktop Project -# Distributed under the terms of the GNU General Public License v2 - -EAPI="8" - -TRINITY_MODULE_NAME="tdebase" -TRINITY_MODULE_TYPE="core" -TSM_EXTRACT="starttde README.pam INSTALL AUTHORS COPYING COPYING-DOCS tdm r14-xdg-update migratekde3" -inherit trinity-meta-2 - -DESCRIPTION="Starttde script, which starts a complete Trinity session, and associated scripts" -if [[ ${PV} != *9999* ]] ; then - KEYWORDS="~amd64 ~arm64 ~x86" -fi - -RDEPEND="x11-apps/xmessage - x11-apps/xsetroot - x11-apps/xset - x11-apps/xrandr - x11-apps/mkfontscale - x11-apps/xprop - ~trinity-base/kdesktop-${PV} - ~trinity-base/kcminit-${PV} - ~trinity-base/ksmserver-${PV} - ~trinity-base/twin-${PV} - ~trinity-base/kpersonalizer-${PV} - ~trinity-base/kreadconfig-${PV} - ~trinity-base/ksplashml-${PV} - ~trinity-base/tdeinit-${PV}" - -src_prepare() { - trinity-base-2_src_prepare -} - -src_configure() { - echo -n ""; -} - -src_compile() { - # List all the multilib libdirs - local _libdir _libdirs - for _libdir in $(get_all_libdirs); do - _libdirs="${_libdirs}:${TDEDIR}/${_libdir}" - done - _libdirs=${_libdirs#:} -} - -src_install() { - # starttde script - exeinto "${TDEDIR}/bin" - doexe starttde - doexe r14-xdg-update - doexe migratekde3 - - # startup and shutdown scripts - exeinto "${TDEDIR}/env" - doexe "${FILESDIR}/agent-startup.sh" - - exeinto "${TDEDIR}/shutdown" - doexe "${FILESDIR}/agent-shutdown.sh" - - # x11 session script - cat < "${T}/tde-${SLOT}" -#!/bin/sh -exec ${TDEDIR}/bin/starttde -EOF - exeinto /etc/X11/Sessions - doexe "${T}/tde-${SLOT}" # FIXME: change script branding to trinity - - # (not really) freedesktop compliant session script - sed -e "s:@TDE_BINDIR@:${TDEDIR}/bin:g;s:Name=Trinity:Name=Trinity ${SLOT}:" \ - "${S}/tdm/kfrontend/sessions/tde.desktop.in" > "${T}/tde-${SLOT}.desktop" - insinto /usr/share/xsessions - doins "${T}/tde-${SLOT}.desktop" -} - -pkg_postinst () { - echo - elog "To enable gpg-agent and/or ssh-agent in Trinity sessions," - elog "edit ${TDEDIR}/env/agent-startup.sh and" - elog "${TDEDIR}/shutdown/agent-shutdown.sh" - echo -} diff --git a/trinity-base/tdebase-starttde/tdebase-starttde-9999.ebuild b/trinity-base/tdebase-starttde/tdebase-starttde-9999.ebuild index 2ddc9dd7..0be7001e 100644 --- a/trinity-base/tdebase-starttde/tdebase-starttde-9999.ebuild +++ b/trinity-base/tdebase-starttde/tdebase-starttde-9999.ebuild @@ -29,6 +29,8 @@ RDEPEND="x11-apps/xmessage ~trinity-base/ksplashml-${PV} ~trinity-base/tdeinit-${PV}" +PATCHES=( "${FILESDIR}/${PN}-14-gentoo.patch" ) + src_prepare() { trinity-base-2_src_prepare } -- cgit v1.2.1