diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/git-2.eclass | 608 | ||||
-rw-r--r-- | eclass/trinity-base.eclass | 196 | ||||
-rw-r--r-- | eclass/trinity-functions.eclass | 52 | ||||
-rw-r--r-- | eclass/trinity-meta.eclass | 33 |
4 files changed, 100 insertions, 789 deletions
diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass deleted file mode 100644 index 3dedf642..00000000 --- a/eclass/git-2.eclass +++ /dev/null @@ -1,608 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -# @ECLASS: git-2.eclass -# @MAINTAINER: -# Michał Górny <mgorny@gentoo.org> -# Donnie Berkholz <dberkholz@gentoo.org> -# @BLURB: Eclass for fetching and unpacking git repositories. -# @DESCRIPTION: -# Eclass for easing maitenance of live ebuilds using git as remote repository. -# Eclass support working with git submodules and branching. -# -# This eclass is DEPRECATED. Please use git-r3 instead. - -if [[ ${EAPI} == 6 ]]; then - die "${ECLASS}.eclass is banned in EAPI ${EAPI}" -fi - -# This eclass support all EAPIs -EXPORT_FUNCTIONS src_unpack - -DEPEND="dev-vcs/git" - -# @ECLASS-VARIABLE: EGIT_SOURCEDIR -# @DESCRIPTION: -# This variable specifies destination where the cloned -# data are copied to. -# -# EGIT_SOURCEDIR="${S}" - -# @ECLASS-VARIABLE: EGIT_STORE_DIR -# @DESCRIPTION: -# Storage directory for git sources. -# -# EGIT_STORE_DIR="${DISTDIR}/egit-src" - -# @ECLASS-VARIABLE: EGIT_HAS_SUBMODULES -# @DEFAULT_UNSET -# @DESCRIPTION: -# If non-empty this variable enables support for git submodules in our -# checkout. Also this makes the checkout to be non-bare for now. - -# @ECLASS-VARIABLE: EGIT_OPTIONS -# @DEFAULT_UNSET -# @DESCRIPTION: -# Variable specifying additional options for fetch command. - -# @ECLASS-VARIABLE: EGIT_MASTER -# @DESCRIPTION: -# Variable for specifying master branch. -# Usefull when upstream don't have master branch or name it differently. -# -# EGIT_MASTER="master" - -# @ECLASS-VARIABLE: EGIT_PROJECT -# @DESCRIPTION: -# Variable specifying name for the folder where we check out the git -# repository. Value of this variable should be unique in the -# EGIT_STORE_DIR as otherwise you would override another repository. -# -# EGIT_PROJECT="${EGIT_REPO_URI##*/}" - -# @ECLASS-VARIABLE: EGIT_DIR -# @DESCRIPTION: -# Directory where we want to store the git data. -# This variable should not be overriden. -# -# EGIT_DIR="${EGIT_STORE_DIR}/${EGIT_PROJECT}" - -# @ECLASS-VARIABLE: EGIT_REPO_URI -# @REQUIRED -# @DEFAULT_UNSET -# @DESCRIPTION: -# URI for the repository -# e.g. http://foo, git://bar -# -# It can be overriden via env using packagename_LIVE_REPO -# variable. -# -# Support multiple values: -# EGIT_REPO_URI="git://a/b.git http://c/d.git" - -# @ECLASS-VARIABLE: EVCS_OFFLINE -# @DEFAULT_UNSET -# @DESCRIPTION: -# If non-empty this variable prevents performance of any online -# operations. - -# @ECLASS-VARIABLE: EGIT_BRANCH -# @DESCRIPTION: -# Variable containing branch name we want to check out. -# It can be overriden via env using packagename_LIVE_BRANCH -# variable. -# -# EGIT_BRANCH="${EGIT_MASTER}" - -# @ECLASS-VARIABLE: EGIT_COMMIT -# @DESCRIPTION: -# Variable containing commit hash/tag we want to check out. -# It can be overriden via env using packagename_LIVE_COMMIT -# variable. -# -# EGIT_COMMIT="${EGIT_BRANCH}" - -# @ECLASS-VARIABLE: EGIT_REPACK -# @DEFAULT_UNSET -# @DESCRIPTION: -# If non-empty this variable specifies that repository will be repacked to -# save space. However this can take a REALLY LONG time with VERY big -# repositories. - -# @ECLASS-VARIABLE: EGIT_PRUNE -# @DEFAULT_UNSET -# @DESCRIPTION: -# If non-empty this variable enables pruning all loose objects on each fetch. -# This is useful if upstream rewinds and rebases branches often. - -# @ECLASS-VARIABLE: EGIT_NONBARE -# @DEFAULT_UNSET -# @DESCRIPTION: -# If non-empty this variable specifies that all checkouts will be done using -# non bare repositories. This is useful if you can't operate with bare -# checkouts for some reason. - -# @ECLASS-VARIABLE: EGIT_NOUNPACK -# @DEFAULT_UNSET -# @DESCRIPTION: -# If non-empty this variable bans unpacking of ${A} content into the srcdir. -# Default behaviour is to unpack ${A} content. - -# @FUNCTION: git-2_init_variables -# @INTERNAL -# @DESCRIPTION: -# Internal function initializing all git variables. -# We define it in function scope so user can define -# all the variables before and after inherit. -git-2_init_variables() { - debug-print-function ${FUNCNAME} "$@" - - local esc_pn liverepo livebranch livecommit - esc_pn=${PN//[-+]/_} - - : ${EGIT_SOURCEDIR="${S}"} - - : ${EGIT_STORE_DIR:="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/egit-src"} - - : ${EGIT_HAS_SUBMODULES:=} - - : ${EGIT_OPTIONS:=} - - : ${EGIT_MASTER:=master} - - liverepo=${esc_pn}_LIVE_REPO - EGIT_REPO_URI=${!liverepo:-${EGIT_REPO_URI}} - [[ ${EGIT_REPO_URI} ]] || die "EGIT_REPO_URI must have some value" - - : ${EVCS_OFFLINE:=} - - livebranch=${esc_pn}_LIVE_BRANCH - [[ ${!livebranch} ]] && ewarn "QA: using \"${esc_pn}_LIVE_BRANCH\" variable, you won't get any support" - EGIT_BRANCH=${!livebranch:-${EGIT_BRANCH:-${EGIT_MASTER}}} - - livecommit=${esc_pn}_LIVE_COMMIT - [[ ${!livecommit} ]] && ewarn "QA: using \"${esc_pn}_LIVE_COMMIT\" variable, you won't get any support" - EGIT_COMMIT=${!livecommit:-${EGIT_COMMIT:-${EGIT_BRANCH}}} - - : ${EGIT_REPACK:=} - - : ${EGIT_PRUNE:=} -} - -# @FUNCTION: git-2_submodules -# @INTERNAL -# @DESCRIPTION: -# Internal function wrapping the submodule initialisation and update. -git-2_submodules() { - debug-print-function ${FUNCNAME} "$@" - if [[ ${EGIT_HAS_SUBMODULES} ]]; then - if [[ ${EVCS_OFFLINE} ]]; then - # for submodules operations we need to be online - debug-print "${FUNCNAME}: not updating submodules in offline mode" - return 1 - fi - - debug-print "${FUNCNAME}: working in \"${1}\"" - pushd "${EGIT_DIR}" > /dev/null || die - - debug-print "${FUNCNAME}: git submodule init" - git submodule init || die - debug-print "${FUNCNAME}: git submodule sync" - git submodule sync || die - debug-print "${FUNCNAME}: git submodule update" - git submodule update || die - - popd > /dev/null || die - fi -} - -# @FUNCTION: git-2_branch -# @INTERNAL -# @DESCRIPTION: -# Internal function that changes branch for the repo based on EGIT_COMMIT and -# EGIT_BRANCH variables. -git-2_branch() { - debug-print-function ${FUNCNAME} "$@" - - local branchname src - - debug-print "${FUNCNAME}: working in \"${EGIT_SOURCEDIR}\"" - pushd "${EGIT_SOURCEDIR}" > /dev/null || die - - local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH} - if [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]]; then - branchname=tree-${EGIT_COMMIT} - src=${EGIT_COMMIT} - fi - debug-print "${FUNCNAME}: git checkout -b ${branchname} ${src}" - git checkout -b ${branchname} ${src} \ - || die "${FUNCNAME}: changing the branch failed" - - popd > /dev/null || die -} - -# @FUNCTION: git-2_gc -# @INTERNAL -# @DESCRIPTION: -# Internal function running garbage collector on checked out tree. -git-2_gc() { - debug-print-function ${FUNCNAME} "$@" - - local args - - if [[ ${EGIT_REPACK} || ${EGIT_PRUNE} ]]; then - pushd "${EGIT_DIR}" > /dev/null || die - ebegin "Garbage collecting the repository" - [[ ${EGIT_PRUNE} ]] && args='--prune' - debug-print "${FUNCNAME}: git gc ${args}" - git gc ${args} - eend $? - popd > /dev/null || die - fi -} - -# @FUNCTION: git-2_prepare_storedir -# @INTERNAL -# @DESCRIPTION: -# Internal function preparing directory where we are going to store SCM -# repository. -git-2_prepare_storedir() { - debug-print-function ${FUNCNAME} "$@" - - local clone_dir - - # initial clone, we have to create master git storage directory and play - # nicely with sandbox - if [[ ! -d ${EGIT_STORE_DIR} ]]; then - debug-print "${FUNCNAME}: Creating git main storage directory" - addwrite / - mkdir -m 775 -p "${EGIT_STORE_DIR}" \ - || die "${FUNCNAME}: can't mkdir \"${EGIT_STORE_DIR}\"" - fi - - # allow writing into EGIT_STORE_DIR - addwrite "${EGIT_STORE_DIR}" - - # calculate git.eclass store dir for data - # We will try to clone the old repository, - # and we will remove it if we don't need it anymore. - EGIT_OLD_CLONE= - if [[ ${EGIT_STORE_DIR} == */egit-src ]]; then - local old_store_dir=${EGIT_STORE_DIR/%egit-src/git-src} - local old_location=${old_store_dir}/${EGIT_PROJECT:-${PN}} - - if [[ -d ${old_location} ]]; then - EGIT_OLD_CLONE=${old_location} - # required to remove the old clone - addwrite "${old_store_dir}" - fi - fi - - # calculate the proper store dir for data - # If user didn't specify the EGIT_DIR, we check if he did specify - # the EGIT_PROJECT or get the folder name from EGIT_REPO_URI. - EGIT_REPO_URI=${EGIT_REPO_URI%/} - if [[ ! ${EGIT_DIR} ]]; then - if [[ ${EGIT_PROJECT} ]]; then - clone_dir=${EGIT_PROJECT} - else - local strippeduri=${EGIT_REPO_URI%/.git} - clone_dir=${strippeduri##*/} - fi - EGIT_DIR=${EGIT_STORE_DIR}/${clone_dir} - - if [[ ${EGIT_OLD_CLONE} && ! -d ${EGIT_DIR} ]]; then - elog "${FUNCNAME}: ${CATEGORY}/${PF} will be cloned from old location." - elog "It will be necessary to rebuild the package to fetch updates." - EGIT_REPO_URI="${EGIT_OLD_CLONE} ${EGIT_REPO_URI}" - fi - fi - export EGIT_DIR=${EGIT_DIR} - debug-print "${FUNCNAME}: Storing the repo into \"${EGIT_DIR}\"." -} - -# @FUNCTION: git-2_move_source -# @INTERNAL -# @DESCRIPTION: -# Internal function moving sources from the EGIT_DIR to EGIT_SOURCEDIR dir. -git-2_move_source() { - debug-print-function ${FUNCNAME} "$@" - - debug-print "${FUNCNAME}: ${MOVE_COMMAND} \"${EGIT_DIR}\" \"${EGIT_SOURCEDIR}\"" - pushd "${EGIT_DIR}" > /dev/null || die - mkdir -p "${EGIT_SOURCEDIR}" \ - || die "${FUNCNAME}: failed to create ${EGIT_SOURCEDIR}" - ${MOVE_COMMAND} "${EGIT_SOURCEDIR}" \ - || die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed" - popd > /dev/null || die -} - -# @FUNCTION: git-2_initial_clone -# @INTERNAL -# @DESCRIPTION: -# Internal function running initial clone on specified repo_uri. -git-2_initial_clone() { - debug-print-function ${FUNCNAME} "$@" - - local repo_uri - - EGIT_REPO_URI_SELECTED="" - for repo_uri in ${EGIT_REPO_URI}; do - debug-print "${FUNCNAME}: git clone ${EGIT_LOCAL_OPTIONS} \"${repo_uri}\" \"${EGIT_DIR}\"" - if git clone ${EGIT_LOCAL_OPTIONS} "${repo_uri}" "${EGIT_DIR}"; then - # global variable containing the repo_name we will be using - debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\"" - EGIT_REPO_URI_SELECTED="${repo_uri}" - break - fi - done - - [[ ${EGIT_REPO_URI_SELECTED} ]] \ - || die "${FUNCNAME}: can't fetch from ${EGIT_REPO_URI}" -} - -# @FUNCTION: git-2_update_repo -# @INTERNAL -# @DESCRIPTION: -# Internal function running update command on specified repo_uri. -git-2_update_repo() { - debug-print-function ${FUNCNAME} "$@" - - local repo_uri - - if [[ ${EGIT_LOCAL_NONBARE} ]]; then - # checkout master branch and drop all other local branches - git checkout ${EGIT_MASTER} || die "${FUNCNAME}: can't checkout master branch ${EGIT_MASTER}" - for x in $(git branch | grep -v "* ${EGIT_MASTER}" | tr '\n' ' '); do - debug-print "${FUNCNAME}: git branch -D ${x}" - git branch -D ${x} > /dev/null - done - fi - - EGIT_REPO_URI_SELECTED="" - for repo_uri in ${EGIT_REPO_URI}; do - # git urls might change, so reset it - git config remote.origin.url "${repo_uri}" - - debug-print "${EGIT_UPDATE_CMD}" - if ${EGIT_UPDATE_CMD} > /dev/null; then - # global variable containing the repo_name we will be using - debug-print "${FUNCNAME}: EGIT_REPO_URI_SELECTED=\"${repo_uri}\"" - EGIT_REPO_URI_SELECTED="${repo_uri}" - break - fi - done - - [[ ${EGIT_REPO_URI_SELECTED} ]] \ - || die "${FUNCNAME}: can't update from ${EGIT_REPO_URI}" -} - -# @FUNCTION: git-2_fetch -# @INTERNAL -# @DESCRIPTION: -# Internal function fetching repository from EGIT_REPO_URI and storing it in -# specified EGIT_STORE_DIR. -git-2_fetch() { - debug-print-function ${FUNCNAME} "$@" - - local oldsha cursha repo_type - - [[ ${EGIT_LOCAL_NONBARE} ]] && repo_type="non-bare repository" || repo_type="bare repository" - - if [[ ! -d ${EGIT_DIR} ]]; then - git-2_initial_clone - pushd "${EGIT_DIR}" > /dev/null || die - cursha=$(git rev-parse ${UPSTREAM_BRANCH}) - echo "GIT NEW clone -->" - echo " repository: ${EGIT_REPO_URI_SELECTED}" - echo " at the commit: ${cursha}" - - popd > /dev/null || die - elif [[ ${EVCS_OFFLINE} ]]; then - pushd "${EGIT_DIR}" > /dev/null || die - cursha=$(git rev-parse ${UPSTREAM_BRANCH}) - echo "GIT offline update -->" - echo " repository: $(git config remote.origin.url)" - echo " at the commit: ${cursha}" - popd > /dev/null || die - else - pushd "${EGIT_DIR}" > /dev/null || die - oldsha=$(git rev-parse ${UPSTREAM_BRANCH}) - git-2_update_repo - cursha=$(git rev-parse ${UPSTREAM_BRANCH}) - - # fetch updates - echo "GIT update -->" - echo " repository: ${EGIT_REPO_URI_SELECTED}" - # write out message based on the revisions - if [[ "${oldsha}" != "${cursha}" ]]; then - echo " updating from commit: ${oldsha}" - echo " to commit: ${cursha}" - else - echo " at the commit: ${cursha}" - fi - - # print nice statistic of what was changed - git --no-pager diff --stat ${oldsha}..${UPSTREAM_BRANCH} - popd > /dev/null || die - fi - # export the version the repository is at - export EGIT_VERSION="${cursha}" - # log the repo state - [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]] \ - && echo " commit: ${EGIT_COMMIT}" - echo " branch: ${EGIT_BRANCH}" - echo " storage directory: \"${EGIT_DIR}\"" - echo " checkout type: ${repo_type}" - - # Cleanup after git.eclass - if [[ ${EGIT_OLD_CLONE} ]]; then - einfo "${FUNCNAME}: removing old clone in ${EGIT_OLD_CLONE}." - rm -rf "${EGIT_OLD_CLONE}" - fi -} - -# @FUNCTION: git_bootstrap -# @INTERNAL -# @DESCRIPTION: -# Internal function that runs bootstrap command on unpacked source. -git-2_bootstrap() { - debug-print-function ${FUNCNAME} "$@" - - # @ECLASS-VARIABLE: EGIT_BOOTSTRAP - # @DESCRIPTION: - # Command to be executed after checkout and clone of the specified - # repository. - # enviroment the package will fail if there is no update, thus in - # combination with --keep-going it would lead in not-updating - # pakcages that are up-to-date. - if [[ ${EGIT_BOOTSTRAP} ]]; then - pushd "${EGIT_SOURCEDIR}" > /dev/null || die - einfo "Starting bootstrap" - - if [[ -f ${EGIT_BOOTSTRAP} ]]; then - # we have file in the repo which we should execute - debug-print "${FUNCNAME}: bootstraping with file \"${EGIT_BOOTSTRAP}\"" - - if [[ -x ${EGIT_BOOTSTRAP} ]]; then - eval "./${EGIT_BOOTSTRAP}" \ - || die "${FUNCNAME}: bootstrap script failed" - else - eerror "\"${EGIT_BOOTSTRAP}\" is not executable." - eerror "Report upstream, or bug ebuild maintainer to remove bootstrap command." - die "\"${EGIT_BOOTSTRAP}\" is not executable" - fi - else - # we execute some system command - debug-print "${FUNCNAME}: bootstraping with commands \"${EGIT_BOOTSTRAP}\"" - - eval "${EGIT_BOOTSTRAP}" \ - || die "${FUNCNAME}: bootstrap commands failed" - fi - - einfo "Bootstrap finished" - popd > /dev/null || die - fi -} - -# @FUNCTION: git-2_migrate_repository -# @INTERNAL -# @DESCRIPTION: -# Internal function migrating between bare and normal checkout repository. -# This is based on usage of EGIT_SUBMODULES, at least until they -# start to work with bare checkouts sanely. -# This function also set some global variables that differ between -# bare and non-bare checkout. -git-2_migrate_repository() { - debug-print-function ${FUNCNAME} "$@" - - local bare returnstate - - # first find out if we have submodules - # or user explicitly wants us to use non-bare clones - if ! [[ ${EGIT_HAS_SUBMODULES} || ${EGIT_NONBARE} ]]; then - bare=1 - fi - - # test if we already have some repo and if so find out if we have - # to migrate the data - if [[ -d ${EGIT_DIR} ]]; then - if [[ ${bare} && -d ${EGIT_DIR}/.git ]]; then - debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to bare copy" - - ebegin "Converting \"${EGIT_DIR}\" from non-bare to bare copy" - mv "${EGIT_DIR}/.git" "${EGIT_DIR}.bare" - export GIT_DIR="${EGIT_DIR}.bare" - git config core.bare true > /dev/null - returnstate=$? - unset GIT_DIR - rm -rf "${EGIT_DIR}" - mv "${EGIT_DIR}.bare" "${EGIT_DIR}" - eend ${returnstate} - elif [[ ! ${bare} && ! -d ${EGIT_DIR}/.git ]]; then - debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" to non-bare copy" - - ebegin "Converting \"${EGIT_DIR}\" from bare to non-bare copy" - git clone -l "${EGIT_DIR}" "${EGIT_DIR}.nonbare" > /dev/null - returnstate=$? - rm -rf "${EGIT_DIR}" - mv "${EGIT_DIR}.nonbare" "${EGIT_DIR}" - eend ${returnstate} - fi - fi - if [[ ${returnstate} -ne 0 ]]; then - debug-print "${FUNCNAME}: converting \"${EGIT_DIR}\" failed, removing to start from scratch" - - # migration failed, remove the EGIT_DIR to play it safe - einfo "Migration failed, removing \"${EGIT_DIR}\" to start from scratch." - rm -rf "${EGIT_DIR}" - fi - - # set various options to work with both targets - if [[ ${bare} ]]; then - debug-print "${FUNCNAME}: working in bare repository for \"${EGIT_DIR}\"" - EGIT_LOCAL_OPTIONS+="${EGIT_OPTIONS} --bare" - MOVE_COMMAND="git clone -l -s -n ${EGIT_DIR// /\\ }" - EGIT_UPDATE_CMD="git fetch -t -f -u origin ${EGIT_BRANCH}:${EGIT_BRANCH}" - UPSTREAM_BRANCH="${EGIT_BRANCH}" - EGIT_LOCAL_NONBARE= - else - debug-print "${FUNCNAME}: working in bare repository for non-bare \"${EGIT_DIR}\"" - MOVE_COMMAND="cp -pPR ." - EGIT_LOCAL_OPTIONS="${EGIT_OPTIONS}" - EGIT_UPDATE_CMD="git pull -f ${EGIT_OPTIONS}" - UPSTREAM_BRANCH="origin/${EGIT_BRANCH}" - EGIT_LOCAL_NONBARE="true" - fi -} - -# @FUNCTION: git-2_cleanup -# @INTERNAL -# @DESCRIPTION: -# Internal function cleaning up all the global variables -# that are not required after the unpack has been done. -git-2_cleanup() { - debug-print-function ${FUNCNAME} "$@" - - # Here we can unset only variables that are GLOBAL - # defined by the eclass, BUT NOT subject to change - # by user (like EGIT_PROJECT). - # If ebuild writer polutes his environment it is - # his problem only. - unset EGIT_DIR - unset MOVE_COMMAND - unset EGIT_LOCAL_OPTIONS - unset EGIT_UPDATE_CMD - unset UPSTREAM_BRANCH - unset EGIT_LOCAL_NONBARE -} - -# @FUNCTION: git-2_src_unpack -# @DESCRIPTION: -# Default git src_unpack function. -git-2_src_unpack() { - debug-print-function ${FUNCNAME} "$@" - - git-2_init_variables - git-2_prepare_storedir - git-2_migrate_repository - git-2_fetch "$@" - git-2_gc - git-2_submodules - git-2_move_source - git-2_branch - git-2_bootstrap - git-2_cleanup - echo ">>> Unpacked to ${EGIT_SOURCEDIR}" - - # Users can specify some SRC_URI and we should - # unpack the files too. - if [[ ! ${EGIT_NOUNPACK} ]]; then - if has ${EAPI:-0} 0 1; then - [[ ${A} ]] && unpack ${A} - else - default_src_unpack - fi - fi -} diff --git a/eclass/trinity-base.eclass b/eclass/trinity-base.eclass index ff116ba9..b4e4b2a4 100644 --- a/eclass/trinity-base.eclass +++ b/eclass/trinity-base.eclass @@ -4,28 +4,25 @@ # # Original Author: fat-zer -# Purpose: support planty of ebuilds for trinity project (a kde3 fork). +# Purpose: support ebuilds for the trinity project (a kde3 fork). # RESTRICT=network-sandbox -inherit trinity-functions cmake-utils base +inherit trinity-functions cmake-utils -# FIXME we don't need to write to both -addwrite "/usr/qt/3/etc/settings" -addpredict "/usr/qt/3/etc/settings" addwrite "/usr/tqt3/etc/settings" addpredict "/usr/tqt3/etc/settings" -# ban EAPI 0, 1 and 2 +# ban EAPI 0-6 case $EAPI in - 0|1|2|3|4) die "EAPI=${EAPI} is not supported" ;; - 5) ;; + 0|1|2|3|4|5|6) die "EAPI=${EAPI} is not supported" ;; + 7) ;; *) die "Unknown EAPI=${EAPI}" esac # @ECLASS-VARIABLE: BUILD_TYPE # @DESCRIPTION: -# Determins he build type: live or release +# Determines the build type: live or release if [[ ${PV} = *9999* ]]; then BUILD_TYPE="live" else @@ -41,8 +38,7 @@ echo "${TRINITY_MODULE_NAME:=${PN}}" >/dev/null # @ECLASS-VARIABLE: TRINITY_SCM # @DESCRIPTION: -# Determins from what version control system code is chiking out for live -# ebuilds. +# Determines which version control system code is checking out live ebuilds from. # @ECLASS-VARIABLE: TMP_DOCDIR # @DESCRIPTION: @@ -50,8 +46,8 @@ echo "${TRINITY_MODULE_NAME:=${PN}}" >/dev/null # # @ECLASS-VARIABLE: TRINTY_BASE_NO_INSTALL_DOC # @DESCRIPTION: -# if setted to anything except "no" this variable prevents -# trinity-base_src_install() to install documentation +# if set to anything except "no" this variable prevents +# trinity-base_src_install() from installing documentation # # @ECLASS-VARIABLE: TRINTY_LANGS @@ -59,8 +55,7 @@ echo "${TRINITY_MODULE_NAME:=${PN}}" >/dev/null # This is a whitespace-separated list of translations this ebuild supports. # These translations are automatically added to IUSE. Therefore ebuilds must set # this variable before inheriting any eclasses. To enable only selected -# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does -# this for you. +# translations, ebuilds must call enable_selected_linguas(). # @ECLASS-VARIABLE: TRINTY_DOC_LANGS # @DESCRIPTION: @@ -75,7 +70,7 @@ echo "${TRINITY_MODULE_NAME:=${PN}}" >/dev/null # Set to enable handbook in application. Possible values are 'always', 'optional' # (handbook USE flag) and 'never'. # This variable must be set before inheriting any eclasses. Defaults to 'never'. -# As well It ensures buildtime and runtime dependencies. +# Also ensures buildtime and runtime dependencies are met. TRINITY_HANDBOOK="${TRINITY_HANDBOOK:-never}" # @ECLASS-VARIABLE: TRINITY_EXTRAGEAR_PACKAGING @@ -87,8 +82,8 @@ TRINITY_HANDBOOK="${TRINITY_HANDBOOK:-never}" # @ECLASS-VARIABLE: TRINITY_GIT_MIRROR # @DESCRIPTION: -# User (or ebuild) can decide another git mirror if it's needed; -# Defaults to http://scm.trinitydesktop.org/scm/git +# User (or ebuild) can select another git mirror if it's needed; +# Defaults to https://mirror.git.trinitydesktop.org/gitea/TDE/ # @ECLASS-VARIABLE: TRINITY_GIT_BRANCH # @DESCRIPTION: @@ -96,7 +91,7 @@ TRINITY_HANDBOOK="${TRINITY_HANDBOOK:-never}" # @ECLASS-VARIABLE: TRINITY_COMMON_DOCS # @DESCRIPTION: -# Common doc names that was found in trinity project's dirs. +# Common doc names that were found in trinity project's dirs. TRINITY_COMMON_DOCS="AUTHORS BUGS CHANGELOG CHANGES COMMENTS COMPLIANCE COMPILING CONFIG_FORMAT CONFIGURING COPYING COPYRIGHT CREDITS DEBUG DESIGN FAQ HACKING HISTORY HOWTO IDEAS INSTALL LICENSE MAINTAINERS NAMING NEWS @@ -110,8 +105,7 @@ TRINITY_COMMON_DOCS="AUTHORS BUGS CHANGELOG CHANGES COMMENTS COMPLIANCE COMPILIN # @ECLASS-VARIABLE: TRINITY_BASE_SRC_URI # @DESCRIPTION: # The top SRC_URI for all trinity packages -TRINITY_BASE_SRC_URI="http://www.mirrorservice.org/sites/trinitydesktop.org/trinity/releases/" -# TRINITY_BASE_SRC_URI="http://trinity.blackmag.net/releases" # the old one +TRINITY_BASE_SRC_URI="http://www.mirrorservice.org/sites/trinitydesktop.org/trinity/releases" #reset TRINITY_SCM and inherit proper eclass if [[ ${BUILD_TYPE} = live ]]; then @@ -119,40 +113,27 @@ if [[ ${BUILD_TYPE} = live ]]; then [[ -z "$TRINITY_SCM" ]] && TRINITY_SCM=git case ${TRINITY_SCM} in - git) inherit git-2 ;; + git) inherit git-r3 ;; *) die "Unsupported TRINITY_SCM=${TRINITY_SCM}" ;; esac - #set some varyables - case ${TRINITY_SCM} in - git) - EGIT_REPO_URI="${TRINITY_GIT_MIRROR:=https://mirror.git.trinitydesktop.org/gitea/TDE}/${TRINITY_MODULE_NAME}" - EGIT_BRANCH="${TRINITY_GIT_BRANCH:=master}" - EGIT_PROJECT="trinity/${TRINITY_MODULE_NAME}" - EGIT_HAS_SUBMODULES="yes" - ;; - esac - S="${WORKDIR}/${TRINITY_MODULE_NAME}" + #set some variables + EGIT_REPO_URI="${TRINITY_GIT_MIRROR:=https://mirror.git.trinitydesktop.org/gitea/TDE/${TRINITY_MODULE_NAME}}" + EGIT_BRANCH="${TRINITY_GIT_BRANCH:=master}" + +# S="${WORKDIR}/${TRINITY_MODULE_NAME}" elif [[ "${BUILD_TYPE}" == release ]]; then mod_name="${TRINITY_MODULE_NAME}" mod_ver="${TRINITY_MODULE_VER:=${PV}}" - - case ${mod_ver} in - 3.5.13.1) - full_mod_name="${mod_name}-${mod_ver}" - TRINITY_TARBALL="${full_mod_name}.tar.gz" ;; - 3.5.13.2) - full_mod_name="${mod_name}-trinity-${mod_ver}" - TRINITY_TARBALL="${full_mod_name}.tar.xz" ;; - *) - full_mod_name="${mod_name}-${mod_ver}" - TRINITY_TARBALL="${full_mod_name}.tar.xz" - esac + + #Note: Only releases in the 14.0 series are presently supported. + full_mod_name="${mod_name}-trinity-${mod_ver}" + TRINITY_TARBALL="${full_mod_name}.tar.xz" if [[ -n "${TRINITY_MODULE_TYPE}" ]] ; then - SRC_URI="${TRINITY_BASE_SRC_URI}/${mod_ver}/${TRINITY_MODULE_TYPE}/$TRINITY_TARBALL" + SRC_URI="${TRINITY_BASE_SRC_URI}/R${mod_ver}/main/${TRINITY_MODULE_TYPE}/$TRINITY_TARBALL" else - SRC_URI="${TRINITY_BASE_SRC_URI}/${mod_ver}/$TRINITY_TARBALL" + SRC_URI="${TRINITY_BASE_SRC_URI}/R${mod_ver}/main/$TRINITY_TARBALL" fi S="${WORKDIR}/${full_mod_name}" @@ -197,16 +178,10 @@ fi # @FUNCTION: trinity-base_src_unpack # @DESCRIPTION: -# A default src unpack function to be call git-2_src_unpack either +# A default src unpack function to be call git-v3_src_unpack either trinity-base_src_unpack() { if [[ ${BUILD_TYPE} = live ]]; then - case "${TRINITY_SCM}" in - - git) - git-2_src_unpack - ;; - *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" ;; - esac + git-v3_src_unpack else base_src_unpack fi @@ -219,27 +194,17 @@ trinity-base_src_unpack() { trinity-base_src_prepare() { debug-print-function ${FUNCNAME} "$@" -# # Only enable selected languages, used for KDE extragear apps. -# if [[ -n ${KDE_LINGUAS} ]]; then -# enable_selected_linguas -# fi local dir lang - # SCM bootstrap - if [[ ${BUILD_TYPE} = live ]]; then - case ${TRINITY_SCM} in - svn) subversion_src_prepare ;; - git) ;; - *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" - esac - fi + # SCM bootstrap--removed on the grounds that if you got this far, + # you have to be using git # Apply patches - base_src_prepare + eapply_user - # Handle documentation and translations for extragear packages + # Handle documentation and translations for extragear packages if [[ -n "$TRINITY_EXTRAGEAR_PACKAGING" ]]; then - # remove not selected languages + # remove languages that have not been selected if [[ -n $TRINITY_LANGS ]]; then einfo "Removing unselected translations from ${TEG_PO_DIR}" for dir in $(find ${TEG_PO_DIR} -mindepth 1 -maxdepth 1 -type d ); do @@ -273,12 +238,14 @@ trinity-base_src_prepare() { done fi fi + + cmake-utils_src_prepare } # @FUNCTION: trinity-base_src_configure # @DESCRIPTION: -# Call standart cmake-utils_src_onfigure and add some common arguments. +# Call standard cmake-utils_src_onfigure and add some common arguments. trinity-base_src_configure() { debug-print-function ${FUNCNAME} "$@" local eg_cmakeargs @@ -302,10 +269,12 @@ trinity-base_src_configure() { mycmakeargs=( -DCMAKE_INSTALL_PREFIX="${EPREFIX}${TDEDIR}" -DCMAKE_INSTALL_RPATH="${EPREFIX}${TDEDIR}" - $([[ "${TRINITY_NEED_ARTS}" == "optional" ]] && cmake-utils_use_with arts ARTS) "${eg_cmakeargs[@]}" "${mycmakeargs[@]}" ) + +# $([[ "${TRINITY_NEED_ARTS}" == "optional" ]] && (cmake-utils_use_with arts ARTS)) + cmake-utils_src_configure } @@ -363,15 +332,6 @@ trinity-base_create_tmp_docfiles() { done done -# if [[ "${TRINITY_INSTALL_ROOT_DOCS}" == "yes" && " ${srcdirs} " == "* ./ *" ]]; then -# for doc in ${TRINITY_COMMON_DOCS}; do -# for docfile in $(ls ./"*${doc}*"); do -# targetdoc="${docfile//\//.}" -# targetdoc="${targetdoc#..}" -# cp "${docfile}" "$TMP_DOCDIR/${targetdoc}" -# done -# done -# fi } # @FUNCTION: trinity-base_install_docfiles @@ -393,48 +353,48 @@ trinity-base_install_docfiles() { } # @FUNCTION: trinity-base_fix_desktop_files -# @DESCRIPTION: +# @DESCRIPTION: OBSOLETE?????? # Perform desktop files modifications according to current version. You can pass # either desktop files or direcories to the parametrs. In case you'd pass a # directory the function will recursively search for all desktop files and # modify them. If no argument specified the function assume to work on the ${D}; -trinity-base_fix_desktop_files() { - - # Test if we have to perform any file fixing for current version - case "3.5" in - *${TRINITY_VER}*);; - *) return 0 ;; - esac +#trinity-base_fix_desktop_files() { - local file_list dir_list f - - if [ "$#" != 0 ]; then - # Get directories and files from arguments - for f in $@; do - if [ -f "$f" ]; then - file_list+=" $f" - elif [ -d "$f" ]; then - dir_list+=" $f" - else - eerror "${FUNCNAME}: bad argument type: $(stat -c %F "$f")" - fi - done - else - dir_list="${D}" - fi - - # Recursivly search for desktop files in directories - for f in $dir_list; do - file_list+="$(find ${f} -type f -name '*.desktop')" - done - - # Performe the updates - case "${TRINITY_VER}" in - 3.5) - for f in $file_list; do - sed -i '/^OnlyShowIn=/s/KDE/TDE/g' "$f" - done;; - esac -} +# # Test if we have to perform any file fixing for current version +# case "3.5" in +# *${TRINITY_VER}*);; +# *) return 0 ;; +# esac +# +# local file_list dir_list f +# +# if [ "$#" != 0 ]; then +# # Get directories and files from arguments +# for f in $@; do +# if [ -f "$f" ]; then +# file_list+=" $f" +# elif [ -d "$f" ]; then +# dir_list+=" $f" +# else +# eerror "${FUNCNAME}: bad argument type: $(stat -c %F "$f")" +# fi +# done +# else +# dir_list="${D}" +# fi +# +# # Recursivly search for desktop files in directories +# for f in $dir_list; do +# file_list+="$(find ${f} -type f -name '*.desktop')" +# done +# +# # Performe the updates +# case "${TRINITY_VER}" in +# 3.5) +# for f in $file_list; do +# sed -i '/^OnlyShowIn=/s/KDE/TDE/g' "$f" +# done;; +# esac +#} EXPORT_FUNCTIONS src_configure src_compile src_install src_prepare diff --git a/eclass/trinity-functions.eclass b/eclass/trinity-functions.eclass index 6e15321d..ae904157 100644 --- a/eclass/trinity-functions.eclass +++ b/eclass/trinity-functions.eclass @@ -7,9 +7,9 @@ # Purpose: basic trinity functions and variables # -inherit versionator multilib +inherit multilib -TRINITY_LIVEVER="14.0.0" +TRINITY_LIVEVER="14.1.0" # @FUNCTION: set-trinityver # @USAGE: < version > @@ -21,16 +21,10 @@ set-trinityver() { # set install location: # - 3rd party apps go into /usr, and have SLOT="0". - # - kde-base category ebuilds go into /usr/kde/$MAJORVER.$MINORVER, + # - kde-base category ebuilds go into /usr/trinity/$ETRINITY_VER, # and have SLOT="$MAJORVER.$MINORVER". - # - This function exports $PREFIX (location to install to) and $KDEDIR + # - This function exports $PREFIX (location to install to) and $TDEDIR # (location of kdelibs to link against) for all ebuilds. - # - # -- Overrides - deprecated but working for now: -- - # - If $KDEPREFIX is defined (in the profile or env), it overrides everything - # and both base and 3rd party kde stuff goes in there. - # - If $KDELIBSDIR is defined, the kdelibs installed in that location will be - # used, even by kde-base packages. # get version elements if [[ -n "$1" ]]; then @@ -40,28 +34,20 @@ set-trinityver() { fi case "$ETRINITY_VER" in - 3.* ) - export TRINITY_VER="$(get_version_component_range 1-2 "${ETRINITY_VER}")" ;; 9999 ) - export TRINITY_VER="$(get_major_version "$TRINITY_LIVEVER" )" ;; + export TRINITY_VER="$(ver_cut 1 "$TRINITY_LIVEVER" )" ;; * ) - export TRINITY_VER="$(get_major_version "$ETRINITY_VER" )" ;; + export TRINITY_VER="$(ver_cut 1 "$ETRINITY_VER" )" ;; esac export TDEDIR="/usr/trinity/${TRINITY_VER}" export TDEDIRS="/usr/trinity/${TRINITY_VER}" - # 3.5.x still uses KDE* variables - if [ "${TRINITY_VER}" = "3.5" ]; then - export KDEDIR="$TDEDIR" - export KDEDIRS="$TDEDIRS" - fi - - # this sould solve problems like "cannot find libraries" espessialy when - # compiling kdelibs - # NOTE: That can breaks compilation of tdelibs: - # binaries which runs during compilation are tring to load shared - # libraries from the TDE's directory wich may be broken. + # this sould solve problems like "cannot find libraries", especially when + # compiling tdelibs + # NOTE: binaries which run during compilation and try to load shared + # libraries from the TDE directory (which may be broken) may still + # break compilation of tdelibs(?) # TODO: fix that issue for tdelibs adjust-trinity-paths } @@ -101,7 +87,7 @@ adjust-trinity-paths() { export PATH export LD_LIBRARY_PATH - # Unset home paths so aplications wouldn't try to write to root's dir while build + # Unset home paths so applications wouldn't try to write to root's dir while building unset TDEHOME unset TDEROOTHOME } @@ -141,12 +127,7 @@ need-trinity() { set-trinityver $1 adjust-trinity-paths - case "$1" in - 3.5*) - my_depend=">=trinity-base/kdelibs-${ETRINITY_VER}:3.5";; - *) - my_depend=">=trinity-base/tdelibs-${ETRINITY_VER}:${TRINITY_VER}";; - esac + my_depend=">=trinity-base/tdelibs-${ETRINITY_VER}:${TRINITY_VER}" DEPEND="$DEPEND $my_depend" RDEPEND="$RDEPEND $my_depend" @@ -154,14 +135,14 @@ need-trinity() { # @ECLASS-VARIABLE: TRINITY_NEED_ARTS # @DESCRIPTION: -# This variable is setted by need-arts function. Possible arguments values 'yes', 'no' and 'optional' +# This variable is set by the need-arts function. Possible arguments values 'yes', 'no' and 'optional' # Default is 'no' TRINITY_NEED_ARTS="no" # @FUNCTION: need-arts # @USAGE: need-arts <yes|optional> # @DESCRIPTION: -# This function adds DEPEND's for aRTs-support Possible arguments are 'yes' and 'optinal' +# This function adds DEPENDs for aRTs support. Possible arguments are 'yes' and 'optinal' # '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 # those variables don't forget to include the priviously setted value into them. @@ -175,8 +156,7 @@ need-arts() { TRINITY_NEED_ARTS=$1; case "${TRINITY_VER}" in - "") die "You must call set-trinityver unctions to set TRINITY_VER before calling $FUNCNAME.";; - 3.5*) tdelibs="trinity-base/kdelibs";; + "") die "You must call set-trinityver functions to set TRINITY_VER before calling $FUNCNAME.";; *) tdelibs="trinity-base/tdelibs";; esac diff --git a/eclass/trinity-meta.eclass b/eclass/trinity-meta.eclass index b6ddb073..87f3b773 100644 --- a/eclass/trinity-meta.eclass +++ b/eclass/trinity-meta.eclass @@ -16,17 +16,13 @@ HOMEPAGE="http://www.trinitydesktop.org/" set-trinityver [[ -z "$SLOT" ]] && SLOT="$TRINITY_VER" -if [[ "$TRINITY_VER" == "3.5" ]]; then # common dependencies - DEPEND="trinity-base/kdelibs:${SLOT}" -else - DEPEND="trinity-base/tdelibs:${SLOT}" -fi +DEPEND="trinity-base/tdelibs:${SLOT}" # @FUNCTION: trinity-meta_set_trinity_submodule # @DESCRIPTION: -# sets the TRINITY_SUBMODULE variable to vth value aptained from ${PN} -# if it doesn't set yet +# sets the TRINITY_SUBMODULE variable to nth value obtained from ${PN} +# if it isn't set yet trinity-meta_set_trinity_submodule() { debug-print-function $FUNCNAME "$@" @@ -49,18 +45,12 @@ trinity-meta_pkg_setup() { # @FUNCTION: trinity-meta_src_unpack # @DESCRIPTION: # Default source extract function. It tries to unpack only -# nessecary files. +# necessary files. trinity-meta_src_unpack() { debug-print-function ${FUNCNAME} "$@" if [[ ${BUILD_TYPE} = live ]]; then case "${TRINITY_SCM}" in - svn) - mkdir -p "$S" - ESVN_RESTRICT="export" subversion_src_unpack - subversion_wc_info - subversion_bootstrap - ;; git) git-2_src_unpack ;; @@ -82,8 +72,7 @@ trinity-meta_src_extract() { if [[ "${BUILD_TYPE}" = live ]]; then einfo "Exporting parts of working copy to ${S}" case "$TRINITY_SCM" in - svn) trinity-meta_rsync_copy ;; - git) # we nothing can do to prevent git from unpacking code + git) # nothing we can do to prevent git from unpacking code ;; *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" esac @@ -127,7 +116,6 @@ trinity-meta_rsync_copy() { local rsync_options subdir targetdir wc_path escm case "${TRINITY_SCM}" in - svn) wc_path="${ESVN_WC_PATH}";; git) wc_path="${EGIT_STORE_DIR}/${EGIT_PROJECT}";; *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" ;; esac @@ -167,10 +155,8 @@ trinity-meta_create_extractlists() { # add package-specific files and directories case "${TRINITY_MODULE_NAME}" in - kdebase) TSM_EXTRACT_LIST+=" kcontrol/ kdmlib/" ;; tdebase) TSM_EXTRACT_LIST+=" kcontrol/" ;; - *) ;; # nothing special for over modules -# *) die "TRINITY_MODULE_NAME ${TRINITY_MODULE_NAME} is not supported by function ${FUNCNAME}" ;; + *) ;; # nothing special for other modules esac TSM_EXTRACT_LIST+=" ${TSM_EXTRACT} ${TSM_EXTRACT_ALSO} cmake/ CMakeLists.txt" @@ -205,13 +191,6 @@ trinity-meta_src_prepare() { done; fi -# fix bad cmake code fo 3.5.13.1 - if [ $PV == "3.5.13.1" ]; then - [ -f "cmake/modules/FindTDE.cmake" ] && \ - sed -ie 's!HINTS\s\+${\w*BIN\w*}!HINTS "${TDE_PREFIX}/bin" ${BIN_INSTALL_DIR}!' \ - cmake/modules/FindTDE.cmake - fi - trinity-base_src_prepare } |