diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-11-28 02:34:44 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-11-28 02:34:44 +0100 |
commit | 644110a847c5911c2eb04eb53c93031740561efc (patch) | |
tree | 9658dde1cc70b52b233957b7852f87d997e98156 /eclass | |
download | tde-packaging-gentoo-644110a847c5911c2eb04eb53c93031740561efc.tar.gz tde-packaging-gentoo-644110a847c5911c2eb04eb53c93031740561efc.zip |
Initial import of an ebuilds tree
from Fat-Zer's (Alexander Golubev) repository.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/git-2.eclass | 608 | ||||
-rw-r--r-- | eclass/kde-functions.eclass | 706 | ||||
-rw-r--r-- | eclass/kde.eclass | 608 | ||||
-rw-r--r-- | eclass/qt3.eclass | 97 | ||||
-rw-r--r-- | eclass/trinity-base.eclass | 439 | ||||
-rw-r--r-- | eclass/trinity-functions.eclass | 205 | ||||
-rw-r--r-- | eclass/trinity-meta.eclass | 262 | ||||
-rw-r--r-- | eclass/trinity-shared-files/kdetoys-3.5.13.1/patches/add-initial-cmake-support.patch.bz2 | bin | 0 -> 5469 bytes | |||
-rw-r--r-- | eclass/trinity-shared-files/kdeutils-3.5.13.1/patches/add-initial-cmake-support-1.patch.bz2 | bin | 0 -> 12405 bytes |
9 files changed, 2925 insertions, 0 deletions
diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass new file mode 100644 index 00000000..3dedf642 --- /dev/null +++ b/eclass/git-2.eclass @@ -0,0 +1,608 @@ +# 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/kde-functions.eclass b/eclass/kde-functions.eclass new file mode 100644 index 00000000..f1094e7c --- /dev/null +++ b/eclass/kde-functions.eclass @@ -0,0 +1,706 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.175 2009/11/01 20:26:34 abcd Exp $ + +# @ECLASS: kde-functions.eclass +# @MAINTAINER: +# kde@gentoo.org +# Original author Dan Armak <danarmak@gentoo.org> +# +# @BLURB: This contains everything except things that modify ebuild variables and +# @DESCRIPTION: +# This contains everything except things that modify ebuild variables +# and functions (e.g. $P, src_compile() etc.) + +inherit qt3 eutils + +# map of the monolithic->split ebuild derivation; used to build deps describing +# the relationships between them +KDE_DERIVATION_MAP=' +kde-base/kdeaccessibility kde-base/kbstateapplet +kde-base/kdeaccessibility kde-base/kdeaccessibility-iconthemes +kde-base/kdeaccessibility kde-base/kmag +kde-base/kdeaccessibility kde-base/kmousetool +kde-base/kdeaccessibility kde-base/kmouth +kde-base/kdeaccessibility kde-base/kttsd +kde-base/kdeaccessibility kde-base/ksayit +kde-base/kdeaddons kde-base/atlantikdesigner +kde-base/kdeaddons kde-base/kaddressbook-plugins +kde-base/kdeaddons kde-base/kate-plugins +kde-base/kdeaddons kde-base/kdeaddons-docs-konq-plugins +kde-base/kdeaddons kde-base/kdeaddons-kfile-plugins +kde-base/kdeaddons kde-base/kicker-applets +kde-base/kdeaddons kde-base/knewsticker-scripts +kde-base/kdeaddons kde-base/konq-plugins +kde-base/kdeaddons kde-base/konqueror-akregator +kde-base/kdeaddons kde-base/ksig +kde-base/kdeaddons kde-base/noatun-plugins +kde-base/kdeaddons kde-base/renamedlg-audio +kde-base/kdeaddons kde-base/renamedlg-images +kde-base/kdeadmin kde-base/kcron +kde-base/kdeadmin kde-base/kdat +kde-base/kdeadmin kde-base/kdeadmin-kfile-plugins +kde-base/kdeadmin kde-base/knetworkconf +kde-base/kdeadmin kde-base/kpackage +kde-base/kdeadmin kde-base/ksysv +kde-base/kdeadmin kde-base/kuser +kde-base/kdeadmin kde-base/lilo-config +kde-base/kdeadmin kde-base/secpolicy +kde-base/kdeartwork kde-base/kdeartwork-emoticons +kde-base/kdeartwork kde-base/kdeartwork-icewm-themes +kde-base/kdeartwork kde-base/kdeartwork-iconthemes +kde-base/kdeartwork kde-base/kdeartwork-kscreensaver +kde-base/kdeartwork kde-base/kdeartwork-kwin-styles +kde-base/kdeartwork kde-base/kdeartwork-kworldclock +kde-base/kdeartwork kde-base/kdeartwork-kworldwatch +kde-base/kdeartwork kde-base/kdeartwork-sounds +kde-base/kdeartwork kde-base/kdeartwork-styles +kde-base/kdeartwork kde-base/kdeartwork-wallpapers +kde-base/kdebase kde-base/drkonqi +kde-base/kdebase kde-base/kappfinder +kde-base/kdebase kde-base/kate +kde-base/kdebase kde-base/kcheckpass +kde-base/kdebase kde-base/kcminit +kde-base/kdebase kde-base/kcontrol +kde-base/kdebase kde-base/kdcop +kde-base/kdebase kde-base/kdebase-data +kde-base/kdebase kde-base/kdebase-kioslaves +kde-base/kdebase kde-base/kdebase-startkde +kde-base/kdebase kde-base/kdebugdialog +kde-base/kdebase kde-base/kdepasswd +kde-base/kdebase kde-base/kdeprint +kde-base/kdebase kde-base/kdesktop +kde-base/kdebase kde-base/kdesu +kde-base/kdebase kde-base/kdialog +kde-base/kdebase kde-base/kdm +kde-base/kdebase kde-base/kfind +kde-base/kdebase kde-base/khelpcenter +kde-base/kdebase kde-base/khotkeys +kde-base/kdebase kde-base/kicker +kde-base/kdebase kde-base/klipper +kde-base/kdebase kde-base/kmenuedit +kde-base/kdebase kde-base/knetattach +kde-base/kdebase kde-base/konqueror +kde-base/kdebase kde-base/konsole +kde-base/kdebase kde-base/kpager +kde-base/kdebase kde-base/kpersonalizer +kde-base/kdebase kde-base/kreadconfig +kde-base/kdebase kde-base/kscreensaver +kde-base/kdebase kde-base/ksmserver +kde-base/kdebase kde-base/ksplashml +kde-base/kdebase kde-base/kstart +kde-base/kdebase kde-base/ksysguard +kde-base/kdebase kde-base/ksystraycmd +kde-base/kdebase kde-base/ktip +kde-base/kdebase kde-base/kwin +kde-base/kdebase kde-base/kxkb +kde-base/kdebase kde-base/libkonq +kde-base/kdebase kde-base/nsplugins +kde-base/kdebindings kde-base/dcopc +kde-base/kdebindings kde-base/dcopjava +kde-base/kdebindings kde-base/dcopperl +kde-base/kdebindings kde-base/dcoppython +kde-base/kdebindings kde-base/kalyptus +kde-base/kdebindings kde-base/kdejava +kde-base/kdebindings kde-base/kjsembed +kde-base/kdebindings kde-base/korundum +kde-base/kdebindings kde-base/pykde +kde-base/kdebindings kde-base/qtjava +kde-base/kdebindings kde-base/qtruby +kde-base/kdebindings kde-base/qtsharp +kde-base/kdebindings kde-base/smoke +kde-base/kdebindings kde-base/xparts +kde-base/kdeedu kde-base/blinken +kde-base/kdeedu kde-base/kalzium +kde-base/kdeedu kde-base/kanagram +kde-base/kdeedu kde-base/kbruch +kde-base/kdeedu kde-base/kdeedu-applnk +kde-base/kdeedu kde-base/keduca +kde-base/kdeedu kde-base/kgeography +kde-base/kdeedu kde-base/khangman +kde-base/kdeedu kde-base/kig +kde-base/kdeedu kde-base/kiten +kde-base/kdeedu kde-base/klatin +kde-base/kdeedu kde-base/klettres +kde-base/kdeedu kde-base/kmathtool +kde-base/kdeedu kde-base/kmessedwords +kde-base/kdeedu kde-base/kmplot +kde-base/kdeedu kde-base/kpercentage +kde-base/kdeedu kde-base/kstars +kde-base/kdeedu kde-base/ktouch +kde-base/kdeedu kde-base/kturtle +kde-base/kdeedu kde-base/kverbos +kde-base/kdeedu kde-base/kvoctrain +kde-base/kdeedu kde-base/kwordquiz +kde-base/kdeedu kde-base/libkdeedu +kde-base/kdegames kde-base/atlantik +kde-base/kdegames kde-base/kasteroids +kde-base/kdegames kde-base/katomic +kde-base/kdegames kde-base/kbackgammon +kde-base/kdegames kde-base/kbattleship +kde-base/kdegames kde-base/kblackbox +kde-base/kdegames kde-base/kbounce +kde-base/kdegames kde-base/kenolaba +kde-base/kdegames kde-base/kfouleggs +kde-base/kdegames kde-base/kgoldrunner +kde-base/kdegames kde-base/kjumpingcube +kde-base/kdegames kde-base/klickety +kde-base/kdegames kde-base/klines +kde-base/kdegames kde-base/kmahjongg +kde-base/kdegames kde-base/kmines +kde-base/kdegames kde-base/knetwalk +kde-base/kdegames kde-base/kolf +kde-base/kdegames kde-base/konquest +kde-base/kdegames kde-base/kpat +kde-base/kdegames kde-base/kpoker +kde-base/kdegames kde-base/kreversi +kde-base/kdegames kde-base/ksame +kde-base/kdegames kde-base/kshisen +kde-base/kdegames kde-base/ksirtet +kde-base/kdegames kde-base/ksmiletris +kde-base/kdegames kde-base/ksnake +kde-base/kdegames kde-base/ksokoban +kde-base/kdegames kde-base/kspaceduel +kde-base/kdegames kde-base/ktron +kde-base/kdegames kde-base/ktuberling +kde-base/kdegames kde-base/kwin4 +kde-base/kdegames kde-base/libkdegames +kde-base/kdegames kde-base/libksirtet +kde-base/kdegames kde-base/lskat +kde-base/kdegraphics kde-base/kamera +kde-base/kdegraphics kde-base/kcoloredit +kde-base/kdegraphics kde-base/kdegraphics-kfile-plugins +kde-base/kdegraphics kde-base/kdvi +kde-base/kdegraphics kde-base/kfax +kde-base/kdegraphics kde-base/kgamma +kde-base/kdegraphics kde-base/kghostview +kde-base/kdegraphics kde-base/kiconedit +kde-base/kdegraphics kde-base/kmrml +kde-base/kdegraphics kde-base/kolourpaint +kde-base/kdegraphics kde-base/kooka +kde-base/kdegraphics kde-base/kpdf +kde-base/kdegraphics kde-base/kpovmodeler +kde-base/kdegraphics kde-base/kruler +kde-base/kdegraphics kde-base/ksnapshot +kde-base/kdegraphics kde-base/ksvg +kde-base/kdegraphics kde-base/kuickshow +kde-base/kdegraphics kde-base/kview +kde-base/kdegraphics kde-base/kviewshell +kde-base/kdegraphics kde-base/libkscan +kde-base/kdemultimedia kde-base/akode +kde-base/kdemultimedia kde-base/artsplugin-akode +kde-base/kdemultimedia kde-base/artsplugin-audiofile +kde-base/kdemultimedia kde-base/artsplugin-mpeglib +kde-base/kdemultimedia kde-base/artsplugin-mpg123 +kde-base/kdemultimedia kde-base/artsplugin-xine +kde-base/kdemultimedia kde-base/juk +kde-base/kdemultimedia kde-base/kaboodle +kde-base/kdemultimedia kde-base/kaudiocreator +kde-base/kdemultimedia kde-base/kdemultimedia-arts +kde-base/kdemultimedia kde-base/kdemultimedia-kappfinder-data +kde-base/kdemultimedia kde-base/kdemultimedia-kfile-plugins +kde-base/kdemultimedia kde-base/kdemultimedia-kioslaves +kde-base/kdemultimedia kde-base/kmid +kde-base/kdemultimedia kde-base/kmix +kde-base/kdemultimedia kde-base/krec +kde-base/kdemultimedia kde-base/kscd +kde-base/kdemultimedia kde-base/libkcddb +kde-base/kdemultimedia kde-base/mpeglib +kde-base/kdemultimedia kde-base/noatun +kde-base/kdenetwork kde-base/dcoprss +kde-base/kdenetwork kde-base/kdenetwork-filesharing +kde-base/kdenetwork kde-base/kdenetwork-kfile-plugins +kde-base/kdenetwork kde-base/kdict +kde-base/kdenetwork kde-base/kdnssd +kde-base/kdenetwork kde-base/kget +kde-base/kdenetwork kde-base/knewsticker +kde-base/kdenetwork kde-base/kopete +kde-base/kdenetwork kde-base/kpf +kde-base/kdenetwork kde-base/kppp +kde-base/kdenetwork kde-base/krdc +kde-base/kdenetwork kde-base/krfb +kde-base/kdenetwork kde-base/ksirc +kde-base/kdenetwork kde-base/ktalkd +kde-base/kdenetwork kde-base/kwifimanager +kde-base/kdenetwork kde-base/librss +kde-base/kdenetwork kde-base/lisa +kde-base/kdepim kde-base/akregator +kde-base/kdepim kde-base/certmanager +kde-base/kdepim kde-base/kaddressbook +kde-base/kdepim kde-base/kalarm +kde-base/kdepim kde-base/kandy +kde-base/kdepim kde-base/karm +kde-base/kdepim kde-base/kdepim-kioslaves +kde-base/kdepim kde-base/kdepim-kresources +kde-base/kdepim kde-base/kdepim-wizards +kde-base/kdepim kde-base/kitchensync +kde-base/kdepim kde-base/kmail +kde-base/kdepim kde-base/kmailcvt +kde-base/kdepim kde-base/knode +kde-base/kdepim kde-base/knotes +kde-base/kdepim kde-base/kode +kde-base/kdepim kde-base/konsolekalendar +kde-base/kdepim kde-base/kontact +kde-base/kdepim kde-base/kontact-specialdates +kde-base/kdepim kde-base/korganizer +kde-base/kdepim kde-base/korn +kde-base/kdepim kde-base/kpilot +kde-base/kdepim kde-base/ksync +kde-base/kdepim kde-base/ktnef +kde-base/kdepim kde-base/libkcal +kde-base/kdepim kde-base/libkdenetwork +kde-base/kdepim kde-base/libkdepim +kde-base/kdepim kde-base/libkholidays +kde-base/kdepim kde-base/libkmime +kde-base/kdepim kde-base/libkpgp +kde-base/kdepim kde-base/libkpimexchange +kde-base/kdepim kde-base/libkpimidentities +kde-base/kdepim kde-base/libksieve +kde-base/kdepim kde-base/mimelib +kde-base/kdepim kde-base/networkstatus +kde-base/kdesdk kde-base/cervisia +kde-base/kdesdk kde-base/kapptemplate +kde-base/kdesdk kde-base/kbabel +kde-base/kdesdk kde-base/kbugbuster +kde-base/kdesdk kde-base/kcachegrind +kde-base/kdesdk kde-base/kdesdk-kfile-plugins +kde-base/kdesdk kde-base/kdesdk-kioslaves +kde-base/kdesdk kde-base/kdesdk-misc +kde-base/kdesdk kde-base/kdesdk-scripts +kde-base/kdesdk kde-base/kmtrace +kde-base/kdesdk kde-base/kompare +kde-base/kdesdk kde-base/kspy +kde-base/kdesdk kde-base/kuiviewer +kde-base/kdesdk kde-base/umbrello +kde-base/kdetoys kde-base/amor +kde-base/kdetoys kde-base/eyesapplet +kde-base/kdetoys kde-base/fifteenapplet +kde-base/kdetoys kde-base/kmoon +kde-base/kdetoys kde-base/kodo +kde-base/kdetoys kde-base/kteatime +kde-base/kdetoys kde-base/ktux +kde-base/kdetoys kde-base/kweather +kde-base/kdetoys kde-base/kworldclock +kde-base/kdetoys kde-base/kworldwatch +kde-base/kdeutils kde-base/ark +kde-base/kdeutils kde-base/kcalc +kde-base/kdeutils kde-base/kcharselect +kde-base/kdeutils kde-base/kdelirc +kde-base/kdeutils kde-base/kdf +kde-base/kdeutils kde-base/kedit +kde-base/kdeutils kde-base/kfloppy +kde-base/kdeutils kde-base/kgpg +kde-base/kdeutils kde-base/khexedit +kde-base/kdeutils kde-base/kjots +kde-base/kdeutils kde-base/klaptopdaemon +kde-base/kdeutils kde-base/kmilo +kde-base/kdeutils kde-base/kregexpeditor +kde-base/kdeutils kde-base/ksim +kde-base/kdeutils kde-base/ktimer +kde-base/kdeutils kde-base/kwalletmanager +kde-base/kdeutils kde-base/superkaramba +kde-base/kdewebdev kde-base/kfilereplace +kde-base/kdewebdev kde-base/kimagemapeditor +kde-base/kdewebdev kde-base/klinkstatus +kde-base/kdewebdev kde-base/kommander +kde-base/kdewebdev kde-base/kxsldbg +kde-base/kdewebdev kde-base/quanta +app-office/koffice app-office/karbon +app-office/koffice app-office/kchart +app-office/koffice app-office/kexi +app-office/koffice app-office/kformula +app-office/koffice app-office/kivio +app-office/koffice app-office/koffice-data +app-office/koffice app-office/koffice-libs +app-office/koffice app-office/koffice-meta +app-office/koffice app-office/koshell +app-office/koffice app-office/kplato +app-office/koffice app-office/kpresenter +app-office/koffice app-office/krita +app-office/koffice app-office/kspread +app-office/koffice app-office/kugar +app-office/koffice app-office/kword +' + +# @FUNCTION: get-parent-package +# @USAGE: < name of split-ebuild > +# @DESCRIPTION: +# accepts 1 parameter, the name of a split ebuild; echoes the name of its mother package +get-parent-package() { + local parent child + while read parent child; do + if [[ ${child} == $1 ]]; then + echo ${parent} + return 0 + fi + done <<EOF +$KDE_DERIVATION_MAP +EOF + die "Package $1 not found in KDE_DERIVATION_MAP, please report bug" +} + +# @FUNCTION: get-child-packages +# @USAGE: < name of monolithic package > +# @DESCRIPTION: +# accepts 1 parameter, the name of a monolithic package; echoes the names of all ebuilds derived from it +get-child-packages() { + local parent child + while read parent child; do + [[ ${parent} == $1 ]] && echo -n "${child} " + done <<EOF +$KDE_DERIVATION_MAP +EOF +} + +# @FUNCTION: is-parent-package +# @USAGE: < name > +# @RETURN: 0 if <name> is a parent package, otherwise 1 +is-parent-package() { + local parent child + while read parent child; do + [[ "${parent}" == "$1" ]] && return 0 + done <<EOF +$KDE_DERIVATION_MAP +EOF + return 1 +} + +# --------------------------------------------------------------- +# kde/qt directory management etc. functions, was kde-dirs.ebuild +# --------------------------------------------------------------- + +# @FUNCTION: need-kde-at-least +# @USAGE: < version > +# @DESCRIPTION: +# Sets the correct DEPEND and RDEPEND for the needed minimum kde < version >. Also takes +# care of the correct Qt-version and correct RDEPEND handling. +need-kde-at-least() { + debug-print-function $FUNCNAME "$@" + + KDEVER="$1" + + # determine install locations + set-kdedir ${KDEVER} + + if [[ "${RDEPEND-unset}" != "unset" ]]; then + x_DEPEND="${RDEPEND}" + else + x_DEPEND="${DEPEND}" + fi + + DEPEND="${DEPEND} >=kde-base/kdelibs-$KDEVER" + RDEPEND="${x_DEPEND} >=kde-base/kdelibs-$KDEVER" + + qtver-from-kdever ${KDEVER} + need-qt ${selected_version} + + if [[ -n "${KDEBASE}" ]]; then + SLOT="$KDEMAJORVER.$KDEMINORVER" + else + : ${SLOT="0"} + fi +} + +# --------------------------------------------------------------- +# kde/qt directory management etc. functions, was kde-dirs.ebuild +# --------------------------------------------------------------- + +# @FUNCTION: need-kde +# @USAGE: < version > +# @DESCRIPTION: +# Sets the correct DEPEND and RDEPEND for the needed kde < version >. Also takes +# care of the correct Qt-version and correct RDEPEND handling. +need-kde() { + debug-print-function $FUNCNAME "$@" + + KDEVER="$1" + + # determine install locations + set-kdedir ${KDEVER} + + if [[ "${RDEPEND-unset}" != "unset" ]]; then + x_DEPEND="${RDEPEND}" + else + x_DEPEND="${DEPEND}" + fi + if [[ -n "${KDEBASE}" ]]; then + # If we're a kde-base package, we need at least our own version of kdelibs. + # Note: we only set RDEPEND if it is already set, otherwise + # we break packages relying on portage copying RDEPEND from DEPEND. + DEPEND="${DEPEND} ~kde-base/kdelibs-$PV" + RDEPEND="${x_DEPEND} ~kde-base/kdelibs-${PV}" + else + # Things outside kde-base need a minimum version, + # but kde-base/kdelibs:kde-4 mustn't satisfy it. + min-kde-ver ${KDEVER} + DEPEND="${DEPEND} =kde-base/kdelibs-3.5*" + RDEPEND="${x_DEPEND} =kde-base/kdelibs-3.5*" + fi + + qtver-from-kdever ${KDEVER} + need-qt ${selected_version} + + if [[ -n "${KDEBASE}" ]]; then + SLOT="$KDEMAJORVER.$KDEMINORVER" + else + : ${SLOT="0"} + fi +} + +# @FUNCTION: set-kdedir +# @USAGE: < version > +# @DESCRIPTION: +# Sets the right directories for the kde <version> wrt what kind of package will +# be installed, e. g. third-party-apps, kde-base-packages, ... +set-kdedir() { + debug-print-function $FUNCNAME "$@" + + + # set install location: + # - 3rd party apps go into /usr, and have SLOT="0". + # - kde-base category ebuilds go into /usr/kde/$MAJORVER.$MINORVER, + # and have SLOT="$MAJORVER.$MINORVER". + # - kde-base category cvs ebuilds have major version 5 and go into + # /usr/kde/cvs; they have SLOT="cvs". + # - Backward-compatibility exceptions: all kde2 packages (kde-base or otherwise) + # go into /usr/kde/2. kde 3.0.x goes into /usr/kde/3 (and not 3.0). + # - kde-base category ebuilds always depend on their exact matching version of + # kdelibs and link against it. Other ebuilds link aginst the latest one found. + # - This function exports $PREFIX (location to install to) and $KDEDIR + # (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 + IFSBACKUP="$IFS" + IFS=".-_" + for x in $1; do + if [[ -z "$KDEMAJORVER" ]]; then KDEMAJORVER=$x + else if [[ -z "$KDEMINORVER" ]]; then KDEMINORVER=$x + else if [[ -z "$KDEREVISION" ]]; then KDEREVISION=$x + fi; fi; fi + done + [[ -z "$KDEMINORVER" ]] && KDEMINORVER="0" + [[ -z "$KDEREVISION" ]] && KDEREVISION="0" + IFS="$IFSBACKUP" + debug-print "$FUNCNAME: version breakup: KDEMAJORVER=$KDEMAJORVER KDEMINORVER=$KDEMINORVER KDEREVISION=$KDEREVISION" + + # install prefix + if [[ -n "$KDEPREFIX" ]]; then + export PREFIX="$KDEPREFIX" + else + if [[ -z "$KDEBASE" ]]; then + PREFIX="/usr/kde/3.5" + else + case $KDEMAJORVER.$KDEMINORVER in + 3*) export PREFIX="/usr/kde/3.5";; + 5.0) export PREFIX="/usr/kde/svn";; + *) die "failed to set PREFIX";; + esac + fi + fi + + # kdelibs location + if [[ -n "$KDELIBSDIR" ]]; then + export KDEDIR="$KDELIBSDIR" + else + if [[ -z "$KDEBASE" ]]; then + # find the latest kdelibs installed + for x in /usr/kde/{svn,3.5} "${PREFIX}" \ + "${KDE3LIBSDIR}" "${KDELIBSDIR}" "${KDE3DIR}" "${KDEDIR}" /usr/kde/*; do + if [[ -f "${x}/include/kwin.h" ]]; then + debug-print found + export KDEDIR="$x" + break + fi + done + else + # kde-base ebuilds must always use the exact version of kdelibs they came with + case $KDEMAJORVER.$KDEMINORVER in + 3*) export KDEDIR="/usr/kde/3.5";; + 5.0) export KDEDIR="/usr/kde/svn";; + *) die "failed to set KDEDIR";; + esac + fi + fi + + debug-print "$FUNCNAME: Will use the kdelibs installed in $KDEDIR, and install into $PREFIX." +} + +# @FUNCTION: need-qt +# @USAGE: < version > +# @DESCRIPTION: +# Sets the DEPEND and RDEPEND for Qt <version>. +need-qt() { + debug-print-function $FUNCNAME "${@}" + + QTVER="$1" + + QT=qt + + if [[ "${RDEPEND-unset}" != "unset" ]]; then + x_DEPEND="${RDEPEND}" + else + x_DEPEND="${DEPEND}" + fi + + case ${QTVER} in + 3*) DEPEND="${DEPEND} =dev-qt/qt-meta-3*" + RDEPEND="${RDEPEND} =dev-qt/qt-meta-3*" + ;; + *) echo "!!! error: $FUNCNAME() called with invalid parameter: \"$QTVER\", please report bug" && exit 1;; + esac + +} + +# @FUNCTION: set-qtdir +# @DESCRIPTION: +# This function is not needed anymore. +set-qtdir() { + : +} + +# @FUNCTION: qtver-from-kdever +# @USAGE: < kde-version > +# @DESCRIPTION: +# returns minimal qt version needed for specified kde version +qtver-from-kdever() { + debug-print-function $FUNCNAME "$@" + + local ver + + case $1 in + 3.1*) ver=3.1;; + 3.2*) ver=3.2;; + 3.3*) ver=3.3;; + 3.4*) ver=3.3;; + 3.5*) ver=3.3;; + 3*) ver=3.0.5;; + 5) ver=3.3;; # cvs version + *) echo "!!! error: $FUNCNAME called with invalid parameter: \"$1\", please report bug" && exit 1;; + esac + + selected_version="$ver" + +} + +min-kde-ver() { + debug-print-function $FUNCNAME "$@" + + case $1 in + 3.0*) selected_version="3.0";; + 3.1*) selected_version="3.1";; + 3.2*) selected_version="3.2";; + 3.3*) selected_version="3.3";; + 3.4*) selected_version="3.4";; + 3.5*) selected_version="3.5";; + 3*) selected_version="3.0";; + 5) selected_version="5";; + *) echo "!!! error: $FUNCNAME() called with invalid parameter: \"$1\", please report bug" && exit 1;; + esac + +} + +# @FUNCTION: kde_sandbox_patch +# @USAGE: < dir > [ dir ] [ dir ] [...] +# @DESCRIPTION: +# generic makefile sed for sandbox compatibility. for some reason when the kde makefiles (of many packages +# and versions) try to chown root and chmod 4755 some binaries (after installing, target install-exec-local), +# they do it to the files in $(bindir), not $(DESTDIR)/$(bindir). Most of these have been fixed in latest cvs +# but a few remain here and there. +# +# Pass a list of dirs to sed, Makefile.{am,in} in these dirs will be sed'ed. +# This should be harmless if the makefile doesn't need fixing. +kde_sandbox_patch() { + debug-print-function $FUNCNAME "$@" + + while [[ -n "$1" ]]; do + # can't use dosed, because it only works for things in ${D}, not ${S} + cd $1 + for x in Makefile.am Makefile.in Makefile + do + if [[ -f "$x" ]]; then + echo Running sed on $x + cp $x ${x}.orig + sed -e 's: $(bindir): $(DESTDIR)/$(bindir):g' -e 's: $(kde_datadir): $(DESTDIR)/$(kde_datadir):g' -e 's: $(TIMID_DIR): $(DESTDIR)/$(TIMID_DIR):g' ${x}.orig > ${x} + rm ${x}.orig + fi + done + shift + done + +} + +# @FUNCTION: kde_remove_flag +# @USAGE: < dir > < flag > +# @DESCRIPTION: +# remove an optimization flag from a specific subdirectory's makefiles. +# currently kdebase and koffice use it to compile certain subdirs without +# -fomit-frame-pointer which breaks some things. +kde_remove_flag() { + debug-print-function $FUNCNAME "$@" + + cd "${S}"/${1} || die "cd to '${S}/${1}' failed." + [[ -n "$2" ]] || die "missing argument to kde_remove_flag" + + cp Makefile Makefile.orig + sed -e "/CFLAGS/ s/${2}//g +/CXXFLAGS/ s/${2}//g" Makefile.orig > Makefile + + cd "${OLDPWD}" + +} + +buildsycoca() { + [[ $EBUILD_PHASE != postinst ]] && [[ $EBUILD_PHASE != postrm ]] && \ + die "buildsycoca() has to be calles in pkg_postinst() and pkg_postrm()." + + if [[ -x ${KDEDIR}/bin/kbuildsycoca ]] && [[ -z ${ROOT} || ${ROOT} == "/" ]] ; then + # First of all, make sure that the /usr/share/services directory exists + # and it has the right permissions + mkdir -p /usr/share/services + chown root:0 /usr/share/services + chmod 0755 /usr/share/services + + ebegin "Running kbuildsycoca to build global database" + # Filter all KDEDIRs not belonging to the current SLOT from XDG_DATA_DIRS + # before running kbuildsycoca. This makes sure they don't show up in the + # 3.5 K-menu unless the user manually adds them. + XDG_DATA_DIRS="/usr/share:${KDEDIR}/share:/usr/local/share" + "${KDEDIR}"/bin/kbuildsycoca --global --noincremental &> /dev/null + eend $? + fi +} + +postprocess_desktop_entries() { + [[ $EBUILD_PHASE != preinst ]] && [[ $EBUILD_PHASE != install ]] && \ + die "postprocess_desktop_entries() has to be called in src_install() or pkg_preinst()." + + if [[ -d ${D}${PREFIX}/share/applnk ]] ; then + # min/max depth is _important_ as it excludes legacy KDE stuff. Moving it would cause breakage. + local desktop_entries="$(find "${D}${PREFIX}/share/applnk" -mindepth 2 -maxdepth 2 \ + -name '*\.desktop' -not -path '*.hidden*' 2>/dev/null)" + + if [[ -n ${desktop_entries} ]]; then + for entry in ${desktop_entries} ; do + if ! [[ -f "${D}${PREFIX}"/share/applications/kde/${entry##*/} ]] ; then + dodir "${PREFIX}"/share/applications/kde + mv ${entry} "${D}${PREFIX}"/share/applications/kde + fi + done + fi + fi + + validate_desktop_entries "${PREFIX}"/share/applications +} + +# is this a kde-base ebuid? +if [[ "${CATEGORY}" == "kde-base" ]]; then + debug-print "${ECLASS}: KDEBASE ebuild recognized" + export KDEBASE="true" + export KDEREVISION +fi diff --git a/eclass/kde.eclass b/eclass/kde.eclass new file mode 100644 index 00000000..b85a9bb8 --- /dev/null +++ b/eclass/kde.eclass @@ -0,0 +1,608 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.223 2009/05/12 12:55:46 tampakrap Exp $ + +# @ECLASS: kde.eclass +# @MAINTAINER: +# kde@gentoo.org +# +# original author Dan Armak <danarmak@gentoo.org> +# +# Revisions Caleb Tennis <caleb@gentoo.org> +# @BLURB: The kde eclass is inherited by all kde-* eclasses. +# @DESCRIPTION: +# This eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here. + +[[ -z ${WANT_AUTOMAKE} ]] && WANT_AUTOMAKE="1.9" + +inherit base eutils kde-functions flag-o-matic libtool autotools + +DESCRIPTION="Based on the $ECLASS eclass" +HOMEPAGE="http://www.kde.org/" +IUSE="debug elibc_FreeBSD" + + +if [[ ${CATEGORY} == "kde-base" ]]; then + if [[ ${PV##*.} -lt 10 ]] ; then + # Keep old ebuilds as is + IUSE="${IUSE} kdeenablefinal" + else + # Don't use --enable-final anymore. Does only cause problems for users and + # as an unwelcome extra invalid bug reports, without any reasonable benefit. + + # Get the aRts dependencies right - finally. + case "${PN}" in + blinken|juk|kalarm|kanagram|kbounce|kcontrol|konq-plugins|kscd|kscreensaver|kttsd|kwifimanager|kdelibs) ARTS_REQUIRED="" ;; + artsplugin-*|kaboodle|kasteroids|kdemultimedia-arts|kolf|krec|ksayit|noatun*) ARTS_REQUIRED="yes" ;; + *) ARTS_REQUIRED="never" ;; + esac + fi +fi + +if [[ ${ARTS_REQUIRED} != "yes" && ${ARTS_REQUIRED} != "never" && ${PN} != "arts" ]]; then + IUSE="${IUSE} arts" +fi + +# @ECLASS-VARIABLE: KDE_S +# @DESCRIPTION: +# Like the 'normal' ${S} this variable takes the path to the temporary build +# directory. If unset ${S} will be used. + +# @ECLASS-VARIABLE: USE_KEG_PACKAGING +# @DESCRIPTION: +# Set USE_KEG_PACKAGING=1 before inheriting if the package use extragear-like +# packaging and then supports ${LANGS} and ${LANGS_DOC} variables. By default +# translations are found in the po subdirectory of ${S}. Set KEG_PO_DIR to +# override this default. +if [[ -n ${USE_KEG_PACKAGING} && -n "${LANGS}${LANGS_DOC}" ]]; then + for lang in ${LANGS} ${LANGS_DOC}; do + IUSE="${IUSE} linguas_${lang}" + done +fi + +DEPEND="sys-devel/make + dev-util/pkgconfig + dev-lang/perl" + +if [[ ${CATEGORY} != "kde-base" ]] || [[ ${CATEGORY} == "kde-base" && ${PV##*.} -lt 10 ]] ; then + DEPEND="${DEPEND} + x11-libs/libXt + x11-proto/xf86vidmodeproto + xinerama? ( x11-proto/xineramaproto )" + RDEPEND="xinerama? ( x11-libs/libXinerama )" + IUSE="${IUSE} xinerama" +else + RDEPEND="" +fi + +if [[ ${ARTS_REQUIRED} == "yes" ]]; then + DEPEND="${DEPEND} kde-base/arts" + RDEPEND="${RDEPEND} kde-base/arts" +elif [[ ${ARTS_REQUIRED} != "never" && ${PN} != "arts" ]]; then + DEPEND="${DEPEND} arts? ( kde-base/arts )" + RDEPEND="${RDEPEND} arts? ( kde-base/arts )" +fi + +# overridden in other places like kde-dist, kde-source and some individual ebuilds +SLOT="0" + +# @ECLASS-VARIABLE: ARTS_REQUIRED +# @DESCRIPTION: +# Is aRTs-support required or not? Possible values are 'yes', 'never'. Otherwise +# leave this variable unset. This results in an arts USE flag. + +# @FUNCTION: kde_pkg_setup +# @DESCRIPTION: +# Some basic test about arts-support. It also filters some compiler flags +kde_pkg_setup() { + if [[ ${PN} != "arts" ]] && [[ ${PN} != "kdelibs" ]] ; then + if [[ ${ARTS_REQUIRED} == 'yes' ]] || \ + ( [[ ${ARTS_REQUIRED} != "never" ]] && use arts ) ; then + if ! built_with_use =kde-base/kdelibs-3.5* arts ; then + if has arts ${IUSE} && use arts; then + eerror "You are trying to compile ${CATEGORY}/${PF} with the \"arts\" USE flag enabled." + else + eerror "The package ${CATEGORY}/${PF} you're trying to merge requires aRTs." + fi + eerror "However, $(best_version =kde-base/kdelibs-3.5*) was compiled with the arts USE flag disabled." + eerror + if has arts ${IUSE} && use arts; then + eerror "You must either disable this USE flag, or recompile" + else + eerror "To build this package you have to recompile" + fi + eerror "$(best_version =kde-base/kdelibs-3.5*) with the arts USE flag enabled." + die "kdelibs missing arts" + fi + fi + fi + + if [[ "${PN}" = "kdelibs" ]]; then + use doc && if ! built_with_use =dev-qt/qt-meta-3* doc ; then + eerror "Building kdelibs with the doc USE flag requires qt to be built with the doc USE flag." + eerror "Please re-emerge qt-3 with this USE flag enabled." + fi + fi + + # Let filter visibility flags that will *really* hurt your KDE + # _experimental_ support for this is enabled by kdehiddenvisibility useflag + filter-flags -fvisibility=hidden -fvisibility-inlines-hidden +} + +# @FUNCTION: kde_src_unpack +# @DESCRIPTION: +# This function unpacks the sources. +# For EAPI 0 and 1 it allso runs kde_src_prepare. +kde_src_unpack() { + debug-print-function $FUNCNAME "$@" + [[ -z "$*" ]] || die "$FUNCNAME no longer supports stages." + [[ -z "${KDE_S}" ]] && KDE_S="${S}" + # Don't use base_src_unpack, as that will call base_src_prepare + # in the wrong place + [[ -d "${KDE_S}" ]] || unpack ${A} + case ${EAPI:-0} in + 0|1) kde_src_prepare ;; + esac +} + +# @FUNCTION: kde_src_prepare +# @DESCRIPTION: +# This function patches the sources. The patches need to be named +# $PN-$PV-*{diff,patch} +# +# This function also handles the linguas if extragear-like packaging is enabled. +# (See USE_KEG_PACKAGING) +kde_src_prepare() { + debug-print-function $FUNCNAME "$@" + local PATCHDIR="${WORKDIR}/patches/" + + # Unpack first and deal with KDE patches after examing possible patch sets. + # To be picked up, patches need to be named $PN-$PV-*{diff,patch} and be + # placed in $PATCHDIR. Monolithic ebuilds will use the split ebuild patches. + if [[ -d "${PATCHDIR}" ]] ; then + local packages p f + if is-parent-package ${CATEGORY}/${PN} ; then + packages="$(get-child-packages ${CATEGORY}/${PN})" + packages="${packages//${CATEGORY}\//} ${PN}" + else + packages="${PN}" + fi + if [[ -n ${PATCHES[@]} && $(declare -p PATCHES) != 'declare -a '* ]]; then + PATCHES=(${PATCHES}) + fi + for p in ${packages}; do + for f in "${PATCHDIR}"/${p}-${PV}-*{diff,patch}; do + [[ -e ${f} ]] && PATCHES+=("${f}") + done + if [[ -n "${KDEBASE}" ]]; then + for f in "${PATCHDIR}"/${p}-${SLOT}-*{diff,patch}; do + [[ -e ${f} ]] && PATCHES+=("${f}") + done + fi + done + fi + + base_src_prepare + + # if extragear-like packaging is enabled, set the translations and the + # documentation depending on LINGUAS settings + if [[ -n ${USE_KEG_PACKAGING} ]]; then + if [[ -z ${LINGUAS} ]]; then + einfo "You can drop some of the translations of the interface and" + einfo "documentation by setting the \${LINGUAS} variable to the" + einfo "languages you want installed." + einfo + einfo "Enabling all languages" + else + # we sanitise LINGUAS to avoid issues when a user specifies the same + # linguas twice. bug #215016. + local sanitised_linguas=$(echo "${LINGUAS}" | tr '[[:space:]]' '\n' | sort | uniq) + if [[ -n ${LANGS} ]]; then + MAKE_PO=$(echo "${sanitised_linguas} ${LANGS}" | tr '[[:space:]]' '\n' | sort | uniq -d | tr '\n' ' ') + einfo "Enabling translations for: ${MAKE_PO}" + sed -i -e "s:^SUBDIRS[ \t]*=.*:SUBDIRS = ${MAKE_PO}:" "${KDE_S}/${KEG_PO_DIR:-po}/Makefile.am" \ + || die "sed for locale failed" + rm -f "${KDE_S}/configure" + fi + + if [[ -n ${LANGS_DOC} ]]; then + MAKE_DOC=$(echo "${sanitised_linguas} ${LANGS_DOC}" | tr '[[:space:]]' '\n' | sort | uniq -d | tr '\n' ' ') + einfo "Enabling documentation for: ${MAKE_DOC}" + [[ -n ${MAKE_DOC} ]] && [[ -n ${DOC_DIR_SUFFIX} ]] && MAKE_DOC=$(echo "${MAKE_DOC}" | tr '\n' ' ') && MAKE_DOC="${MAKE_DOC// /${DOC_DIR_SUFFIX} }" + sed -i -e "s:^SUBDIRS[ \t]*=.*:SUBDIRS = ${MAKE_DOC} ${PN}:" \ + "${KDE_S}/doc/Makefile.am" || die "sed for locale failed" + rm -f "${KDE_S}/configure" + fi + fi + fi + + # fix the 'languageChange undeclared' bug group: touch all .ui files, so that the + # makefile regenerate any .cpp and .h files depending on them. + cd "${KDE_S}" + debug-print "$FUNCNAME: Searching for .ui files in ${PWD}" + UIFILES="$(find . -name '*.ui' -print)" + debug-print "$FUNCNAME: .ui files found:" + debug-print "$UIFILES" + # done in two stages, because touch doens't have a silent/force mode + if [[ -n "$UIFILES" ]]; then + debug-print "$FUNCNAME: touching .ui files..." + touch $UIFILES + fi + + if [[ -d "${WORKDIR}/admin" ]] && [[ -d "${KDE_S}/admin" ]]; then + ebegin "Updating admin/ directory..." + rm -rf "${KDE_S}/admin" "${KDE_S}/configure" || die "Unable to remove old admin/ directory" + ln -s "${WORKDIR}/admin" "${KDE_S}/admin" || die "Unable to symlink the new admin/ directory" + eend 0 + fi +} + +# @FUNCTION: kde_src_configure +# @USAGE: [ myconf ] [ configure ] [ all ] +# @DESCRIPTION: +# This function compiles the sources. It takes care of "cannot write to .kde +# or .qt"-problem due to sandbox and some other sandbox issues. +# +# If no argument is given, all is assumed. +kde_src_configure() { + debug-print-function $FUNCNAME "$@" + + [[ -z "$1" ]] && kde_src_configure all + + [[ -z "${KDE_S}" ]] && KDE_S="${S}" + cd "${KDE_S}" + + export kde_widgetdir="$KDEDIR/$(get_libdir)/kde3/plugins/designer" + + # fix the sandbox errors "can't writ to .kde or .qt" problems. + # this is a fake homedir that is writeable under the sandbox, so that the build process + # can do anything it wants with it. + REALHOME="$HOME" + mkdir -p "${T}"/fakehome/.kde + mkdir -p "${T}"/fakehome/.qt + export HOME="${T}"/fakehome + addwrite "${QTDIR}/etc/settings" + + # Fix bug 96177: if KDEROOTHOME is defined, the ebuild accesses the real homedir via it, and not our exported $HOME + unset KDEHOME + unset KDEROOTHOME + + # things that should access the real homedir + [[ -d "$REALHOME/.ccache" ]] && ln -sf "$REALHOME/.ccache" "$HOME/" + + while [[ "$1" ]]; do + + case $1 in + myconf) + debug-print-section myconf + if [[ ${CATEGORY} != "kde-base" ]] || [[ ${CATEGORY} == "kde-base" && ${PV##*.} -lt 10 ]] ; then + myconf+=" --with-x --enable-mitshm $(use_with xinerama) --with-qt-dir=${QTDIR} --enable-mt --with-qt-libraries=${QTDIR}/$(get_libdir)" + else + myconf+=" --with-qt-dir=${QTDIR} --enable-mt --with-qt-libraries=${QTDIR}/$(get_libdir)" + fi + # calculate dependencies separately from compiling, enables ccache to work on kde compiles + myconf="$myconf --disable-dependency-tracking" + if use debug ; then + myconf="$myconf --enable-debug=full --with-debug" + else + myconf="$myconf --disable-debug --without-debug" + fi + if hasq kdeenablefinal ${IUSE}; then + myconf="$myconf $(use_enable kdeenablefinal final)" + fi + if [[ ${ARTS_REQUIRED} == "never" ]]; then + myconf="$myconf --without-arts" + elif [[ ${ARTS_REQUIRED} != 'yes' && ${PN} != "arts" ]]; then + # This might break some external package until + # ARTS_REQUIRED="yes" is set on them, KDE 3.2 is no more + # supported anyway. + myconf="$myconf $(use_with arts)" + fi + debug-print "$FUNCNAME: myconf: set to ${myconf}" + ;; + configure) + debug-print-section configure + debug-print "$FUNCNAME::configure: myconf=$myconf" + + export WANT_AUTOMAKE + + # rebuild configure script, etc + # This can happen with e.g. a cvs snapshot + if [[ ! -f "./configure" ]]; then + # This is needed to fix building with autoconf 2.60. + # Many thanks to who preferred such a stupid check rather + # than a working arithmetic comparison. + if [[ -f admin/cvs.sh ]]; then + sed -i -e '/case $AUTO\(CONF\|HEADER\)_VERSION in/,+1 s/2\.5/2.[56]/g' \ + admin/cvs.sh + fi + + # Replace the detection script with a dummy, let our wrappers do the work + if [[ -f admin/detect-autoconf.sh ]]; then + cat - > admin/detect-autoconf.sh <<EOF +#!/bin/sh +export AUTOCONF="autoconf" +export AUTOHEADER="autoheader" +export AUTOM4TE="autom4te" +export AUTOMAKE="automake" +export ACLOCAL="aclocal" +export WHICH="which" +EOF + fi + + # Make build succeed with >=autoconf-2.65, see http://tinyurl.com/yc4nbhq + if [[ -f admin/acinclude.m4.in ]] && \ + [[ ! -f ${T}/acinclude.m4.in ]]; then + cp admin/acinclude.m4.in "${T}" + einfo "Patching admin/acinclude.m4.in" + patch -f --ignore-whitespace admin/acinclude.m4.in <<'EOF' +--- admin/acinclude.m4.in ++++ admin/acinclude.m4.in +@@ -3081,6 +3081,13 @@ + fi + ]) + ++AC_DEFUN([GENTOO_DUMMY_CFLAGS], ++[ ++ dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS ++ CFLAGS=" $CFLAGS" ++]) ++AC_BEFORE([GENTOO_DUMMY_CFLAGS],[AC_PROG_CC]) ++ + AC_DEFUN([AC_CHECK_COMPILERS], + [ + AC_ARG_ENABLE(debug, +@@ -3141,12 +3148,10 @@ + [kde_use_profiling="no"] + ) + +- dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS +- CFLAGS=" $CFLAGS" +- +- AC_PROG_CC ++ AC_REQUIRE([GENTOO_DUMMY_CFLAGS]) ++ AC_REQUIRE([AC_PROG_CC]) + +- AC_PROG_CPP ++ AC_REQUIRE([AC_PROG_CPP]) + + if test "$GCC" = "yes"; then + if test "$kde_use_debug_code" != "no"; then +@@ -3176,7 +3181,7 @@ + + CXXFLAGS=" $CXXFLAGS" + +- AC_PROG_CXX ++ AC_REQUIRE([AC_PROG_CXX]) + + KDE_CHECK_FOR_BAD_COMPILER + +EOF + if [[ $? != 0 ]]; then + ewarn "Failed to patch admin/acinclude.m4.in" + cp "${T}/acinclude.m4.in" admin/acinclude.m4.in + fi + fi + for x in Makefile.cvs admin/Makefile.common; do + if [[ -f "$x" && -z "$makefile" ]]; then makefile="$x"; fi + done + if [[ -f "$makefile" ]]; then + debug-print "$FUNCNAME: configure: generating configure script, running make -f $makefile" + emake -f $makefile + fi + [[ -f "./configure" ]] || die "no configure script found, generation unsuccessful" + fi + + export PATH="${KDEDIR}/bin:${PATH}" + + # configure doesn't need to know about the other KDEs installed. + # in fact, if it does, it sometimes tries to use the wrong dcopidl, etc. + # due to the messed up way configure searches for things + export KDEDIRS="${PREFIX}:${KDEDIR}" + + # Visiblity stuff is broken. Just disable it when it's present. + export kde_cv_prog_cxx_fvisibility_hidden=no + + if hasq kdehiddenvisibility ${IUSE} && use kdehiddenvisibility; then + if [[ $(gcc-major-version)$(gcc-minor-version) -ge 41 ]]; then + if [[ ${PN} != "kdelibs" && ${PN} != "arts" ]] && \ + ! fgrep -q "#define __KDE_HAVE_GCC_VISIBILITY" "${KDEDIR}/include/kdemacros.h"; then + + eerror "You asked to enable hidden visibility, but your kdelibs was" + eerror "built without its support. Please rebuild kdelibs with the" + eerror "kdehiddenvisibility useflag enabled." + die "kdelibs without hidden visibility" + else + unset kde_cv_prog_cxx_fvisibility_hidden + myconf="$myconf $(use_enable kdehiddenvisibility gcc-hidden-visibility)" + fi + else + eerror "You're trying to enable hidden visibility, but" + eerror "you are using an old GCC version. Hidden visibility" + eerror "can be enabled only with GCC 4.1 and later." + fi + fi + + # If we're in a kde-base ebuild, set the prefixed directories to + # override the ones set by econf. + if [[ -n ${PREFIX} && ${PREFIX} != "/usr" ]]; then + myconf="${myconf} --prefix=${PREFIX} + --mandir=${PREFIX}/share/man + --infodir=${PREFIX}/share/info + --datadir=${PREFIX}/share + --sysconfdir=${PREFIX}/etc" + fi + + # Use libsuffix to keep KDE happy, the --libdir parameter get + # still honored. + if [[ $(get_libdir) != "lib" ]] ; then + myconf="${myconf} --enable-libsuffix=$(get_libdir | sed s/lib//)" + fi + + export PATH="${KDEDIR}/bin:${PATH}" + + # The configure checks for kconfig_compiler do not respect PATH + export KCONFIG_COMPILER="${KDEDIR}/bin/kconfig_compiler" + + # Sometimes it doesn't get the include and library paths right, + # so hints them. + if [[ -z ${PREFIX} || ${PREFIX} != ${KDEDIR} ]]; then + myconf="${myconf} --with-extra-includes=${KDEDIR}/include + --with-extra-libs=${KDEDIR}/$(get_libdir)" + fi + + if grep "cope with newer libtools" "${KDE_S}/admin/ltconfig" &> /dev/null; then + einfo "Removing the dummy ltconfig file." + rm "${KDE_S}/admin/ltconfig" + fi + + use elibc_FreeBSD && myconf="${myconf} --disable-pie" + + elibtoolize + econf ${myconf} + + # Seems ./configure add -O2 by default but hppa don't want that but we need -ffunction-sections + if [[ "${ARCH}" = "hppa" ]] + then + einfo "Fixing Makefiles" + find "${KDE_S}" -name Makefile -print0 | xargs -0 sed -i -e \ + 's:-O2:-ffunction-sections:g' + fi + ;; + all) + debug-print-section all + kde_src_configure myconf configure + ;; + esac + + shift + done + +} +# @FUNCTION: kde_src_compile +# @USAGE: [ myconf ] [ configure ] [ make ] [ all ] +# @DESCRIPTION: +# This function compiles the sources. It takes care of "cannot write to .kde +# or .qt"-problem due to sandbox and some other sandbox issues. +# +# If no argument is given, all is assumed. +kde_src_compile() { + debug-print-function $FUNCNAME "$@" + + [[ -z "$1" ]] && kde_src_compile all + + [[ -z "${KDE_S}" ]] && KDE_S="${S}" + cd "${KDE_S}" + while [[ "$1" ]]; do + case $1 in + make) + debug-print-section make + emake || die "died running emake, $FUNCNAME:make" + ;; + all) + case ${EAPI:-0} in + 0|1) kde_src_configure all ;; + esac + kde_src_compile make + ;; + *) + case ${EAPI:-0} in + 0|1) kde_src_configure $1 ;; + esac + ;; + esac + + shift + done +} + +# @FUNCTION: kde_src_install +# @USAGE: [ make ] [ dodoc ] [ all ] +# @DESCRIPTION: +# This installs the software, including the right handling of the +# "/usr/share/doc/kde"-dir, but it only installs AUTHORS, ChangeLog*, README*, +# NEWS, and TODO (if available) as docs. +# +# If no argument is given, all is assumed +kde_src_install() { + debug-print-function $FUNCNAME "$@" + + [[ -z "$1" ]] && kde_src_install all + + [[ -z ${KDE_S} ]] && KDE_S="${S}" + cd "${KDE_S}" + + # Ensure that KDE binaries take precedence + export PATH="${KDEDIR}/bin:${PATH}" + + while [[ "$1" ]]; do + + case $1 in + make) + debug-print-section make + emake install DESTDIR="${D}" destdir="${D}" || die "died running make install, $FUNCNAME:make" + ;; + dodoc) + debug-print-section dodoc + for doc in AUTHORS ChangeLog* README* NEWS TODO; do + [[ -s "$doc" ]] && dodoc $doc + done + ;; + all) + debug-print-section all + kde_src_install make dodoc + ;; + esac + + shift + done + + if [[ -n ${KDEBASE} && "${PN}" != "arts" && -d "${D}"/usr/share/doc/${PF} ]]; then + # work around bug #97196 + dodir /usr/share/doc/kde && \ + mv "${D}"/usr/share/doc/${PF} "${D}"/usr/share/doc/kde/ || \ + die "Failed to move docs to kde/ failed." + fi +} + +# @FUNCTION: slot_rebuild +# @USAGE: [ list_of_packages_to_check ] +# @RETURN: False, if no rebuild is required +# @DESCRIPTION: +# Unneeded and therefore deprecated for a long, long time now. Ebuilds are still +# referencing it, so replacing with a stub. +# Looks for packages in the supplied list of packages which have not been linked +# against this kde SLOT. It does this by looking for lib*.la files that doesn't +# contain the current ${KDEDIR}. If it finds any thus broken packages it prints +# eerrors and return True. +# +# Thanks to Carsten Lohrke in bug 98425. +slot_rebuild() { + : +} + +# @FUNCTION: kde_pkg_preinst +# @DESCRIPTION: +# Calls postprocess_desktop_entries +kde_pkg_preinst() { + postprocess_desktop_entries +} + +# @FUNCTION: kde_pkg_postinst +# @DESCRIPTION: +# Calls buildsycoca +kde_pkg_postinst() { + buildsycoca +} + +# @FUNCTION: kde_pkg_postrm +# @DESCRIPTION: +# Calls buildsycoca +kde_pkg_postrm() { + buildsycoca +} + +case ${EAPI:-0} in + 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_preinst;; + 2) EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_install pkg_postinst pkg_postrm pkg_preinst;; +esac diff --git a/eclass/qt3.eclass b/eclass/qt3.eclass new file mode 100644 index 00000000..f24091e7 --- /dev/null +++ b/eclass/qt3.eclass @@ -0,0 +1,97 @@ +# Copyright 2005-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/qt3.eclass,v 1.41 2009/05/17 15:17:03 hwoarang Exp $ + +# @ECLASS: qt3.eclass +# @MAINTAINER: +# kde-sunset overlay maintainers +# @BLURB: Eclass for Qt3 packages +# @DESCRIPTION: +# This eclass contains various functions that may be useful +# when dealing with packages using Qt3 libraries. + +inherit toolchain-funcs versionator eutils + +if [[ -z "${QTDIR}" ]]; then + export QTDIR="/usr/qt/3" +fi + +addwrite "${QTDIR}/etc/settings" +addpredict "${QTDIR}/etc/settings" + +# @FUNCTION: eqmake3 +# @USAGE: [.pro file] [additional parameters to qmake] +# @MAINTAINER: +# Przemyslaw Maciag <troll@gentoo.org> +# Davide Pesavento <davidepesa@gmail.com> +# @DESCRIPTION: +# Runs qmake on the specified .pro file (defaults to +# ${PN}.pro if eqmake3 was called with no argument). +# Additional parameters are passed unmodified to qmake. +eqmake3() { + local LOGFILE="${T}/qmake-$$.out" + local projprofile="${1}" + [[ -z ${projprofile} ]] && projprofile="${PN}.pro" + shift 1 + + ebegin "Processing qmake ${projprofile}" + + # file exists? + if [[ ! -f ${projprofile} ]]; then + echo + eerror "Project .pro file \"${projprofile}\" does not exist" + eerror "qmake cannot handle non-existing .pro files" + echo + eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org" + echo + die "Project file not found in ${PN} sources" + fi + + echo >> ${LOGFILE} + echo "****** qmake ${projprofile} ******" >> ${LOGFILE} + echo >> ${LOGFILE} + + # some standard config options + local configoptplus="CONFIG += no_fixpath" + local configoptminus="CONFIG -=" + if has debug ${IUSE} && use debug; then + configoptplus="${configoptplus} debug" + configoptminus="${configoptminus} release" + else + configoptplus="${configoptplus} release" + configoptminus="${configoptminus} debug" + fi + + ${QTDIR}/bin/qmake ${projprofile} \ + QTDIR=${QTDIR} \ + QMAKE=${QTDIR}/bin/qmake \ + QMAKE_CC=$(tc-getCC) \ + QMAKE_CXX=$(tc-getCXX) \ + QMAKE_LINK=$(tc-getCXX) \ + QMAKE_CFLAGS_RELEASE="${CFLAGS}" \ + QMAKE_CFLAGS_DEBUG="${CFLAGS}" \ + QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ + QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ + QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ + QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ + "${configoptminus}" \ + "${configoptplus}" \ + QMAKE_RPATH= \ + QMAKE_STRIP= \ + ${@} >> ${LOGFILE} 2>&1 + + local result=$? + eend ${result} + + # was qmake successful? + if [[ ${result} -ne 0 ]]; then + echo + eerror "Running qmake on \"${projprofile}\" has failed" + echo + eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org" + echo + die "qmake failed on ${projprofile}" + fi + + return ${result} +} diff --git a/eclass/trinity-base.eclass b/eclass/trinity-base.eclass new file mode 100644 index 00000000..52b1c399 --- /dev/null +++ b/eclass/trinity-base.eclass @@ -0,0 +1,439 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# +# Original Author: fat-zer +# Purpose: support planty of ebuilds for trinity project (a kde3 fork). +# + +inherit trinity-functions cmake-utils base + +# 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 +case $EAPI in + 0|1|2|3|4) die "EAPI=${EAPI} is not supported" ;; + 5) ;; + *) die "Unknown EAPI=${EAPI}" +esac + +# @ECLASS-VARIABLE: BUILD_TYPE +# @DESCRIPTION: +# Determins he build type: live or release +if [[ ${PV} = *9999* ]]; then + BUILD_TYPE="live" +else + BUILD_TYPE="release" +fi +export BUILD_TYPE + +# @ECLASS-VARIABLE: TRINITY_MODULE_NAME +# @DESCRIPTION: +# The name of trinity module; It's used for multiple purposes. First of all it +# determines the tarball name (git repository for live packages) +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. + +# @ECLASS-VARIABLE: TMP_DOCDIR +# @DESCRIPTION: +# A temporary directory used to copy common documentation before installing it +# +# @ECLASS-VARIABLE: TRINTY_BASE_NO_INSTALL_DOC +# @DESCRIPTION: +# if setted to anything except "no" this variable prevents +# trinity-base_src_install() to install documentation +# + +# @ECLASS-VARIABLE: TRINTY_LANGS +# @DESCRIPTION: +# 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. + +# @ECLASS-VARIABLE: TRINTY_DOC_LANGS +# @DESCRIPTION: +# 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. + +# @ECLASS-VARIABLE: TRINITY_HANDBOOK +# @DESCRIPTION: +# 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. +TRINITY_HANDBOOK="${TRINITY_HANDBOOK:-never}" + +# @ECLASS-VARIABLE: TRINITY_EXTRAGEAR_PACKAGING +# @DESCRIPTION: +# Set TRINITY_EXTRAGEAR_PACKAGING=yes before inheriting if the package use extragear-like +# packaging and then supports ${TRINITY_LANGS}, ${TRINITY_DOC_LANGS} and +# ${TRINITY_HANDBOOK} variables. The translations are found in the directory +# pointed by the TEG_PO_DIR variable. + +# @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 + +# @ECLASS-VARIABLE: TRINITY_GIT_BRANCH +# @DESCRIPTION: +# Specify git branch for live ebuilds. Default: master + +# @ECLASS-VARIABLE: TRINITY_COMMON_DOCS +# @DESCRIPTION: +# Common doc names that was 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 + NOTES PLUGINS PORTING README SECURITY-HOLES TASKGROUPS TEMPLATE + TESTCASES THANKS THOUGHTS TODO VERSION" + +# @ECLASS-VARIABLE: TRINITY_TARBALL +# @DESCRIPTION: +# This variable holds the name of the tarboll with current module's source code. + +# @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 + +#reset TRINITY_SCM and inherit proper eclass +if [[ ${BUILD_TYPE} = live ]]; then + # set default TRINITY_SCM if not set + [[ -z "$TRINITY_SCM" ]] && TRINITY_SCM=git + + case ${TRINITY_SCM} in + git) inherit git-2 ;; + *) die "Unsupported TRINITY_SCM=${TRINITY_SCM}" ;; + esac + + #set some varyables + case ${TRINITY_SCM} in + git) + EGIT_REPO_URI="${TRINITY_GIT_MIRROR:=http://scm.trinitydesktop.org/scm/git}/${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}" +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 + + if [[ -n "${TRINITY_MODULE_TYPE}" ]] ; then + SRC_URI="${TRINITY_BASE_SRC_URI}/${mod_ver}/${TRINITY_MODULE_TYPE}/$TRINITY_TARBALL" + else + SRC_URI="${TRINITY_BASE_SRC_URI}/${mod_ver}/$TRINITY_TARBALL" + fi + + S="${WORKDIR}/${full_mod_name}" +else + die "Unknown BUILD_TYPE=${BUILD_TYPE}" +fi + + +if [[ -n "${TRINITY_EXTRAGEAR_PACKAGING}" ]]; then +# @ECLASS-VARIABLE: TEG_PO_DIR +# @DESCRIPTION: +# Change the translation directory for extragear packages. The default is ${S}/po + TEG_PO_DIR="${TEG_PO_DIR:-${S}/po}" + +# @ECLASS-VARIABLE: TEG_DOC_DIR +# @DESCRIPTION: +# Change the documentation directory for extragear packages. The default is +# ${S}/doc + TEG_DOC_DIR="${TEG_DOC_DIR:-${S}/doc}" + + if [[ -n "${TRINITY_LANGS}" || -n "${TRINITY_DOC_LANGS}" ]]; then + for lang in ${TRINITY_LANGS} ${TRINITY_DOC_LANGS}; do + IUSE="${IUSE} linguas_${lang}" + done + + trinityhandbookdepend=" + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xsl-stylesheets + " + case ${TRINITY_HANDBOOK} in + yes | always) + DEPEDND+=" ${trinityhandbookdepend}" + ;; + optional) + IUSE+=" +handbook" + DEPEND+=" handbook? ( ${trinityhandbookdepend} )" + ;; + *) ;; + esac + fi +fi + +# @FUNCTION: trinity-base_src_unpack +# @DESCRIPTION: +# A default src unpack function to be call git-2_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 + else + base_src_unpack + fi +} + + +# @FUNCTION: trinity-base_src_prepare +# @DESCRIPTION: +# General pre-configure and pre-compile function for Trinity applications. +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 + + # Apply patches + base_src_prepare + + # Handle documentation and translations for extragear packages + if [[ -n "$TRINITY_EXTRAGEAR_PACKAGING" ]]; then + # remove not selected languages + 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 + lang="$(basename "$dir")" + if ! has "$lang" ${TRINITY_LANGS}; then + eerror "Translation $lang seems to present in the package but is not supported by the ebuild" + elif ! has $lang ${LINGUAS}; then + rm -rf $dir + fi + done + fi + + # if we removed all translations we should point it + if [[ -z $(find ${TEG_PO_DIR} -mindepth 1 -maxdepth 1 -type d) ]]; then + TRINITY_NO_TRANSLATIONS=yes + fi + + # remove not selected documentation + if [[ -n $TRINITY_DOC_LANGS ]]; then + einfo "Removing unselected documentation from ${TEG_DOC_DIR}" + for dir in $(find ${TEG_DOC_DIR} -mindepth 1 -maxdepth 1 -type d ); do + lang="$(basename "$dir")" + if [[ "$lang" == "${PN}" || \ + "$lang" == "${TRINITY_MODULE_NAME}" ]] ; then + echo -n; # do nothing it's main documentation + elif ! has "$lang" ${TRINITY_LANGS}; then + eerror "Documentation translated to language $lang seems to present in the package but is not supported by the ebuild" + elif ! has $lang ${LINGUAS}; then + rm -rf $dir + fi + done + fi + fi +} + + +# @FUNCTION: trinity-base_src_configure +# @DESCRIPTION: +# Call standart cmake-utils_src_onfigure and add some common arguments. +trinity-base_src_configure() { + debug-print-function ${FUNCNAME} "$@" + local eg_cmakeargs + + [[ -n "${PREFIX}" ]] && export PREFIX="${TDEDIR}" + + if [[ -n "$TRINITY_EXTRAGEAR_PACKAGING" ]]; then + eg_cmakeargs=( -DBUILD_ALL=ON ) + if [[ "$TRINITY_NO_TRANSLATIONS" == "yes" ]]; then + eg_cmakeargs=( -DBUILD_TRANSLATIONS=OFF "${eg_cmakeargs[@]}" ) + else + eg_cmakeargs=( -DBUILD_TRANSLATIONS=ON "${eg_cmakeargs[@]}" ) + fi + if [[ "${TRINITY_HANDBOOK}" == optional ]]; then + eg_cmakeargs=( + $(cmake-utils_use_with handbook DOC) + "${eg_cmakeargs[@]}" ) + fi + fi + + mycmakeargs=( + -DCMAKE_INSTALL_PREFIX="${EPREFIX}${TDEDIR}" + -DCMAKE_INSTALL_RPATH="${EPREFIX}${TDEDIR}" + $([[ "${TRINITY_NEED_ARTS}" == "optional" ]] && cmake-utils_use_with arts ARTS) + "${eg_cmakeargs[@]}" + "${mycmakeargs[@]}" + ) + cmake-utils_src_configure +} + +# @FUNCTION: trinity-base_src_compile +# @DESCRIPTION: +# Just call cmake-utils_src_compile. +trinity-base_src_compile() { + debug-print-function ${FUNCNAME} "$@" + + cmake-utils_src_compile +} + +# @FUNCTION: trinity-base_src_install +# @DESCRIPTION: +# Call standart cmake-utils_src_install and installs common documentation. +trinity-base_src_install() { + debug-print-function ${FUNCNAME} "$@" + cmake-utils_src_install + + trinity-base_fix_desktop_files + if [[ -z "$TRINITY_BASE_NO_INSTALL_DOC" || + "$TRINITY_BASE_NO_INSTALL_DOC" == "no" ]]; then + trinity-base_create_tmp_docfiles + trinity-base_install_docfiles + fi +} + +# @FUNCTION: trinity-base_create_tmp_docfiles +# @DESCRIPTION: +# Create docfiles in the form ${TMP_DOCDIR}/path.to.docfile.COMMON_NAME +# Also see the description for TRINITY_COMMON_DOCS and TMP_DOCDIR. +trinity-base_create_tmp_docfiles() { + debug-print-function ${FUNCNAME} "$@" + local srcdirs dir docfile targetdoc + + if [[ -z "$TMP_DOCDIR" || ! -d "$TMP_DOCDIR" ]] ; then + TMP_DOCDIR="$T/docs" + mkdir -p ${TMP_DOCDIR} + fi + + if [[ -z "$@" ]] ; then + srcdirs="./" + else + srcdirs="$@" + fi + + einfo "Generating documentation list..." + for dir in $srcdirs; do + for doc in ${TRINITY_COMMON_DOCS}; do + for docfile in $(find $dir -type f -name "*${doc}*"); do + targetdoc="${docfile//\//.}" + targetdoc="${targetdoc#..}" + cp "${docfile}" "$TMP_DOCDIR/${targetdoc}" + done + 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 +# @DESCRIPTION: +# Install documentation from ${TMP_DOCDIR} or from first argument. +trinity-base_install_docfiles() { + debug-print-function ${FUNCNAME} "$@" + local doc docdir + [[ -n "$TMP_DOCDIR" ]] && docdir="$TMP_DOCDIR" + [[ -n "$1" ]] && docdir="$1" + [[ -z "$docdir" ]] && die "docdir is not set in ${FUNCNAME}." + + pushd "${docdir}" >/dev/null + find . -maxdepth 1 -type f | while read doc; do + einfo "Installing documentation: ${doc##*/}" + dodoc "${doc}" + done + popd >/dev/null +} + +# @FUNCTION: trinity-base_fix_desktop_files +# @DESCRIPTION: +# 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 + + 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 new file mode 100644 index 00000000..6e15321d --- /dev/null +++ b/eclass/trinity-functions.eclass @@ -0,0 +1,205 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# +# Original Author: Alexander Golubev (Fat-Zer) +# Purpose: basic trinity functions and variables +# + +inherit versionator multilib + +TRINITY_LIVEVER="14.0.0" + +# @FUNCTION: set-trinityver +# @USAGE: < version > +# @DESCRIPTION: +# 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". + # - kde-base category ebuilds go into /usr/kde/$MAJORVER.$MINORVER, + # and have SLOT="$MAJORVER.$MINORVER". + # - This function exports $PREFIX (location to install to) and $KDEDIR + # (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 + ETRINITY_VER="$1" + else + ETRINITY_VER="$PV" + 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="$(get_major_version "$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. + # TODO: fix that issue for tdelibs + adjust-trinity-paths +} + +# @FUNCTION: get-trinity-libdirs +# @USAGE: +# @DESCRIPTION: +# lists all the trinity library directories +get-trinity-libdirs() { + local rv + for libdir in $(get_all_libdirs); do + echo " ${TDEDIR}/${libdir}" + done +} + +# @FUNCTION: adjust-trinity-paths +# @USAGE: < version > +# @DESCRIPTION: +# Adjust PATH LDPATH and LD_LIBRARY_PATH to see only current trinity version +adjust-trinity-paths() { + 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" )" + + # 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}")" + 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}" )" + done + + export PATH + export LD_LIBRARY_PATH + + # Unset home paths so aplications wouldn't try to write to root's dir while build + unset TDEHOME + unset TDEROOTHOME +} + +trinity_remove_path_component() { + local i new_path path_array + + IFS=: read -ra path_array <<< "$1" + for i in "${path_array[@]}"; do + case "$i" in + $2 ) ;; # delete specyfied entry + "" ) ;; + * ) new_path="${new_path}:${i}" ;; + esac + done + + echo "${new_path#:}" +} + +trinity_prepand_path_component() { + local new_path + + new_path="${2%:}:${1#:}" + echo "${new_path%:}" +} + +# @FUNCTION: need-trinity +# @USAGE: < version > +# @DESCRIPTION: +# Sets the correct DEPEND and RDEPEND for the needed trinity < version >. +need-trinity() { + debug-print-function $FUNCNAME "$@" + + local my_depend + + # determine install locations + 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 + + DEPEND="$DEPEND $my_depend" + RDEPEND="$RDEPEND $my_depend" +} + +# @ECLASS-VARIABLE: TRINITY_NEED_ARTS +# @DESCRIPTION: +# This variable is setted by 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' +# '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. +need-arts() { + debug-print-function $FUNCNAME "$@" + + local tdelibs my_depend + + [[ -z "${1}" ]] && die "$FUNCNAME requires an argument" + + 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";; + *) tdelibs="trinity-base/tdelibs";; + esac + + # handle trinity-base/tdelibs in special way + if [[ "${CATEGORY}/${PN}" == "${tdelibs}" ]]; then + if [[ "$1" == optional ]]; then + my_depend=" arts? ( trinity-base/arts )" + IUSE+=" arts" + else + die "aRTs support for ${tdelibs} supposed to be optional" + fi + else + case "$1" in + yes) my_depend=" trinity-base/arts + ${tdelibs}[arts]" ;; + optional) my_depend=" arts? ( trinity-base/arts + ${tdelibs}[arts] )" + IUSE+=" arts" ;; + *) die "bad parameter: $1" + esac + fi + + DEPEND+=" ${my_depend}"; + RDEPEND+=" ${my_depend}"; +} + diff --git a/eclass/trinity-meta.eclass b/eclass/trinity-meta.eclass new file mode 100644 index 00000000..b6ddb073 --- /dev/null +++ b/eclass/trinity-meta.eclass @@ -0,0 +1,262 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# +# Original Author: fat-zer +# Purpose: make easy to install trinity ebuilds. +# + +inherit trinity-base trinity-functions cmake-utils + +LICENSE="GPL-2 LGPL-2" +HOMEPAGE="http://www.trinitydesktop.org/" + +# set slot, TDEDIR, TRINITY_VER and PREFIX +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 + +# @FUNCTION: trinity-meta_set_trinity_submodule +# @DESCRIPTION: +# sets the TRINITY_SUBMODULE variable to vth value aptained from ${PN} +# if it doesn't set yet +trinity-meta_set_trinity_submodule() { + debug-print-function $FUNCNAME "$@" + + if [[ -z "$TRINITY_SUBMODULE" ]]; then + TRINITY_SUBMODULE="${PN#${TRINITY_MODULE_NAME}-}" + fi +} + +# @FUNCTION: trinity-meta_src_pkg_setup +# @DESCRIPTION: +# Default pkg_setup function. It sets the correct ${S} +# nessecary files. +trinity-meta_pkg_setup() { + debug-print-function ${FUNCNAME} "$@" + adjust-trinity-paths + + trinity-meta_set_trinity_submodule +} + +# @FUNCTION: trinity-meta_src_unpack +# @DESCRIPTION: +# Default source extract function. It tries to unpack only +# nessecary 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 + ;; + *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" ;; + esac + fi + trinity-meta_src_extract +} + +# @FUNCTION: trinity-meta_src_extract +# @DESCRIPTION: +# A function to extract the source for a split KDE ebuild. +# Also see KMMODULE, KMEXTRACT +trinity-meta_src_extract() { + debug-print-function ${FUNCNAME} "$@" + + trinity-meta_create_extractlists + + 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 + ;; + *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" + esac + else + local tarfile tarparams f extractlist + + case $TRINITY_TARBALL in + *.gz) + tarparams=" --gzip" + ;; + *.xz) + tarparams=" --xz" + ;; + esac + + # Full path to source tarball + tarfile="${DISTDIR}/${TRINITY_TARBALL}" + + # Detect real toplevel dir from tarball name - it will be used upon extraction + topdir="${TRINITY_TARBALL%.tar.*}" + + ebegin "Unpacking parts of ${TRINITY_TARBALL} to ${WORKDIR}" + + for f in $TSM_EXTRACT_LIST; do + extractlist+=" ${topdir}/${f}" + done + + tar -xpf "${tarfile}" ${tarparams} -C "${WORKDIR}" ${extractlist} 2> /dev/null \ + || echo "tar extract command failed at least partially - continuing anyway" + + # Make sure $S points to right place + [[ "${WORKDIR}/${topdir}" != "${S}" ]] && S="${WORKDIR}/${topdir}" + fi +} + +# @FUNCTION: trinity-meta_rsync_copy +# @DESCRIPTION: +# Copies files from svn or git repository to $S +trinity-meta_rsync_copy() { + debug-print-function ${FUNCNAME} "$@" + + 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 + + rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/" + + # Copy ${TRINITY_MODULE_NAME} non-recursively (toplevel files) + rsync ${rsync_options} "${wc_path}"/* "${S}" \ + || die "rsync: can't export toplevel files to '${S}'." + # Copy cmake directory + if [[ -d "${wc_path}/cmake" ]]; then + rsync --recursive ${rsync_options} "${wc_path}/cmake" "${S}" \ + || die "rsync: can't export cmake files to '${S}'." + fi + # Copy all subdirectories listed in $TSM_EXTRACT_LIST + for subdir in ${TSM_EXTRACT_LIST}; do + rsync --recursive ${rsync_options} "${wc_path}/${subdir}" \ + "${S}/$(dirname subdir)" \ + || die "rsync: can't export object '${wc_path}/${subdir}' to '${S}'." + done +} + +# @FUNCTION: trinity-meta_create_extractlists +# @DESCRIPTION: +# Create lists of files and subdirectories to extract. +# Also see descriptions of KMMODULE and KMEXTRACT +trinity-meta_create_extractlists() { + debug-print-function ${FUNCNAME} "$@" + local submod + + # if $TSM_EXTRACT is not set assign it to dirs named in TRINITY_SUBMODULE + if [ -z "${TSM_EXTRACT}" ]; then + for submod in ${TRINITY_SUBMODULE}; do + TSM_EXTRACT="${TSM_EXTRACT} ${submod}/" + done + fi + + # 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}" ;; + esac + + TSM_EXTRACT_LIST+=" ${TSM_EXTRACT} ${TSM_EXTRACT_ALSO} cmake/ CMakeLists.txt" + TSM_EXTRACT_LIST+=" config.h.cmake ConfigureChecks.cmake" + + debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: TSM_EXTRACT_LIST=\"${TSM_EXTRACT_LIST}\"" +} + +# @FUNCTION: trinity-meta_src_prepare +# @DESCRIPTION: +# Default src prepare function. Currently it's only a stub. +trinity-meta_src_prepare() { + debug-print-function ${FUNCNAME} "$@" + local shared_patch_dir f f_name; + + shared_patch_dir="${FILESDIR}/shared/${TRINITY_MODULE_NAME}-${PV}/patches/" + if [ -d "${shared_patch_dir}" ]; then + find "${shared_patch_dir}" -type f | while read f; do + f_name="$(basename "${f}")" + case "${f_name}" in + *.diff | *.patch ) epatch "${f}" ;; + *.gz ) cp "${f}" "${T}" + gunzip ${T}/${f_name} + epatch ${T}/${f_name%.gz} + ;; + *.bz2 ) cp "${f}" "${T}" + bunzip2 ${T}/${f_name} + epatch ${T}/${f_name%.bz2} + ;; + *) die "unknown patch type in the patch directory" ;; + esac + 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 +} + +# @FUNCTION: trinity-meta_src_configure +# @DESCRIPTION: +# Default source configure function. It sets apropriate cmake args. +# Also see description of KMMODULE +trinity-meta_src_configure() { + debug-print-function ${FUNCNAME} "$@" + + local item tsmargs mod + + for item in $TRINITY_SUBMODULE; do + mod="${item^^}" + mod="${mod//-/_}" + tsmargs+=" -DBUILD_${mod}=ON" + done + + mycmakeargs=( + "${mycmakeargs[@]}" + ${tsmargs} + ) + + trinity-base_src_configure +} + +# @FUNCTION: trinity-meta_src_compile +# @DESCRIPTION: +# Just call trinity-base_src_compile. +trinity-meta_src_compile() { + debug-print-function ${FUNCNAME} "$@" + + trinity-base_src_compile +} + +# @FUNCTION: trinity-meta_src_install +# @DESCRIPTION: +# Call default cmake install function. and install documentation. +trinity-meta_src_install() { + debug-print-function ${FUNCNAME} "$@" + + TRINITY_BASE_NO_INSTALL_DOC="yes" trinity-base_src_install + + trinity-base_create_tmp_docfiles $TSM_EXTRACT + trinity-base_install_docfiles +} + +EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_unpack pkg_setup diff --git a/eclass/trinity-shared-files/kdetoys-3.5.13.1/patches/add-initial-cmake-support.patch.bz2 b/eclass/trinity-shared-files/kdetoys-3.5.13.1/patches/add-initial-cmake-support.patch.bz2 Binary files differnew file mode 100644 index 00000000..00ab641c --- /dev/null +++ b/eclass/trinity-shared-files/kdetoys-3.5.13.1/patches/add-initial-cmake-support.patch.bz2 diff --git a/eclass/trinity-shared-files/kdeutils-3.5.13.1/patches/add-initial-cmake-support-1.patch.bz2 b/eclass/trinity-shared-files/kdeutils-3.5.13.1/patches/add-initial-cmake-support-1.patch.bz2 Binary files differnew file mode 100644 index 00000000..e48e0921 --- /dev/null +++ b/eclass/trinity-shared-files/kdeutils-3.5.13.1/patches/add-initial-cmake-support-1.patch.bz2 |