summaryrefslogtreecommitdiffstats
path: root/eclass/trinity-functions-2.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/trinity-functions-2.eclass')
-rw-r--r--eclass/trinity-functions-2.eclass105
1 files changed, 50 insertions, 55 deletions
diff --git a/eclass/trinity-functions-2.eclass b/eclass/trinity-functions-2.eclass
index c7150132..102e4e6d 100644
--- a/eclass/trinity-functions-2.eclass
+++ b/eclass/trinity-functions-2.eclass
@@ -1,12 +1,11 @@
# Copyright 1999-2013 Gentoo Foundation
# Copyright 2020 The Trinity Desktop Project
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
#
# Original Author: Alexander Golubev (Fat-Zer)
# Ported to git-r3 eclass and EAPI7 by E. Liddell
-# Purpose: basic trinity functions and variables
+# Purpose: Basic Trinity eclass functions and variables
#
inherit multilib
@@ -19,27 +18,27 @@ TRINITY_LIVEVER="14.1.0"
# Sets the right TRINITY_VER, TDEDIR etc...
# !!! unfinished
set-trinityver() {
- debug-print-function $FUNCNAME "$@"
-
- # set install location:
- # - 3rd party apps go into /usr, and have SLOT="0".
- # - trinity-base category ebuilds go into /usr/trinity/$ETRINITY_VER,
- # and have SLOT="$MAJORVER.$MINORVER".
- # - This function exports $PREFIX (location to install to) and $TDEDIR
- # (location of tdelibs to link against) for all ebuilds.
-
- # get version elements
- if [[ -n "$1" ]]; then
- ETRINITY_VER="$1"
+ debug-print-function ${FUNCNAME} "${@}"
+
+ # Set install location:
+ # - The third party applications and libraries go into /usr, and have SLOT="0".
+ # - The Trinity related applications and libraries go into /usr/trinity/${TRINITY_VER},
+ # and have SLOT="${TRINITY_VER}".
+ # - This function exports ${PREFIX} (location to install to) and ${TDEDIR}
+ # (location of tdelibs to link against) for all ebuilds.
+
+ # Get version elements
+ if [[ -n "${1}" ]]; then
+ ETRINITY_VER="${1}"
else
- ETRINITY_VER="$PV"
+ ETRINITY_VER="${PV}"
fi
- case "$ETRINITY_VER" in
+ case "${ETRINITY_VER}" in
9999 )
- export TRINITY_VER="$(ver_cut 1 "$TRINITY_LIVEVER" )" ;;
+ export TRINITY_VER="$(ver_cut 1 "${TRINITY_LIVEVER}" )" ;;
* )
- export TRINITY_VER="$(ver_cut 1 "$ETRINITY_VER" )" ;;
+ export TRINITY_VER="$(ver_cut 1 "${ETRINITY_VER}" )" ;;
esac
export TDEDIR="/usr/trinity/${TRINITY_VER}"
@@ -61,29 +60,26 @@ set-trinityver() {
get-trinity-libdirs() {
local rv
for libdir in $(get_all_libdirs); do
- echo " ${TDEDIR}/${libdir}"
+ echo "${TDEDIR}/${libdir}"
done
}
# @FUNCTION: adjust-trinity-paths
# @USAGE: < version >
# @DESCRIPTION:
-# Adjusts PATH LDPATH and LD_LIBRARY_PATH to see only current trinity version.
+# Adjusts PATH and LD_LIBRARY_PATH to see only current trinity version.
adjust-trinity-paths() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "${@}"
local libdir
- # this function can be called during depend phase so we shouldn't use sed here
- PATH="$(trinity_remove_path_component "$PATH" "/usr/trinity/*/bin")"
- PATH="$(trinity_remove_path_component "$PATH" "/usr/trinity/*/sbin")"
- PATH="$(trinity_prepand_path_component "$PATH" "${TDEDIR}/bin" )"
+ # This function can be called during depend phase so we shouldn't use sed here
+ PATH="$(trinity_remove_path_component "${PATH}" "/usr/trinity/*/bin")"
+ PATH="$(trinity_remove_path_component "${PATH}" "/usr/trinity/*/sbin")"
+ PATH="$(trinity_prepand_path_component "${PATH}" "${TDEDIR}/bin" )"
- # FIXME: it seems we don't need LDPATH
-# LDPATH="$(trinity_remove_path_component "$LDPATH" "/usr/trinity/*/${libdir}")"
- LD_LIBRARY_PATH="$(trinity_remove_path_component "$LD_LIBRARY_PATH" "/usr/trinity/*/${libdir}")"
+ LD_LIBRARY_PATH="$(trinity_remove_path_component "${LD_LIBRARY_PATH}" "/usr/trinity/*/${libdir}")"
for libdir in $(get-trinity-libdirs); do
-# LDPATH="$(trinity_prepand_path_component "$LDPATH" "${TDEDIR}/${libdir}" )"
- LD_LIBRARY_PATH="$(trinity_prepand_path_component "$LD_LIBRARY_PATH" "${libdir}" )"
+ LD_LIBRARY_PATH="$(trinity_prepand_path_component "${LD_LIBRARY_PATH}" "${libdir}" )"
done
export PATH
@@ -97,10 +93,10 @@ adjust-trinity-paths() {
trinity_remove_path_component() {
local i new_path path_array
- IFS=: read -ra path_array <<< "$1"
+ IFS=: read -ra path_array <<< "${1}"
for i in "${path_array[@]}"; do
- case "$i" in
- $2 ) ;; # delete specyfied entry
+ case "${i}" in
+ ${2} ) ;; # delete specyfied entry
"" ) ;;
* ) new_path="${new_path}:${i}" ;;
esac
@@ -121,18 +117,18 @@ trinity_prepand_path_component() {
# @DESCRIPTION:
# Sets the correct DEPEND and RDEPEND for the needed trinity < version >.
need-trinity() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "${@}"
local my_depend
# determine install locations
- set-trinityver $1
+ set-trinityver ${1}
adjust-trinity-paths
- my_depend=">=trinity-base/tdelibs-${ETRINITY_VER}:${TRINITY_VER}"
+ my_depend="=trinity-base/tdelibs-${ETRINITY_VER}"
- DEPEND="$DEPEND $my_depend"
- RDEPEND="$RDEPEND $my_depend"
+ DEPEND+=" ${my_depend}"
+ RDEPEND+=" ${my_depend}"
}
# @ECLASS-VARIABLE: TRINITY_NEED_ARTS
@@ -146,42 +142,41 @@ TRINITY_NEED_ARTS="no"
# @DESCRIPTION:
# This function adds DEPENDs for aRTs support.
# Possible arguments are 'yes' and 'optional' 'yes' means arts is required, 'optional' results in USE flag arts.
-# NOTE: this function modifies IUSE DEPEND and RDEPEND variables, so if you call it before setting
+# NOTE: This function modifies IUSE DEPEND and RDEPEND variables, so if you call it before setting
# those variables don't forget to include the previously set value when you set them again.
need-arts() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "${@}"
- local tdelibs my_depend
+ local arts tdelibs my_depend
- [[ -z "${1}" ]] && die "$FUNCNAME requires an argument"
+ [[ -z "${1}" ]] && die "${FUNCNAME} requires an argument"
- TRINITY_NEED_ARTS=$1;
+ TRINITY_NEED_ARTS="${1}"
case "${TRINITY_VER}" in
- "") die "You must call set-trinityver functions to set TRINITY_VER before calling $FUNCNAME.";;
- *) tdelibs="trinity-base/tdelibs";;
+ "") die "You must call the set-trinityver function to set TRINITY_VER before calling ${FUNCNAME}.";;
+ *) tdelibs="=trinity-base/tdelibs-${ETRINITY_VER}" arts="=trinity-base/arts-${ETRINITY_VER}";;
esac
- # handle trinity-base/tdelibs in special way
- if [[ "${CATEGORY}/${PN}" == "${tdelibs}" ]]; then
- if [[ "$1" == optional ]]; then
- my_depend=" arts? ( trinity-base/arts )"
+ # Handle trinity-base/tdelibs in special way
+ if [[ "=${CATEGORY}/${P}" == "${tdelibs}" ]]; then
+ if [[ "${1}" == "optional" ]]; then
+ my_depend=" arts? ( ${arts} )"
IUSE+=" arts"
else
- die "aRTs support for ${tdelibs} supposed to be optional"
+ die "aRts support for ${tdelibs} supposed to be optional"
fi
else
- case "$1" in
- yes) my_depend=" trinity-base/arts
+ case "${1}" in
+ yes) my_depend=" ${arts}
${tdelibs}[arts]" ;;
- optional) my_depend=" arts? ( trinity-base/arts
+ optional) my_depend=" arts? ( ${arts}
${tdelibs}[arts] )"
IUSE+=" arts" ;;
- *) die "bad parameter: $1"
+ *) die "bad parameter: ${1}"
esac
fi
DEPEND+=" ${my_depend}";
RDEPEND+=" ${my_depend}";
}
-