[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Newer KDEPIM for Jessie



Hi,

> I use default /usr/local location and do as little customization of the
> build process as possible. Then I tell my KDE sessions to use /usr/local
> stuff as well like this:


This does not touch all relevant env variables (see attached script). It is 
configured to have
~/kde/src/<name>/kdepim - source
~/kde/build/<name>/kdepim - build
~/kde/inst/<name>   - install dir

after running the script you have to do something like:

setKDEEnv master

Okay it additionally also makes sure that you have different home dirs etc. 

In your case the folling env variables should be enough to set:

XDG_DATA_DIRS - needed for akonadi resources 
LD_LIBRARY_PATH - to find libs
KDEDIRS
KDEDIR
KDEHOME
PATH
QT_PLUGIN_PATH

> > If somebody would spend the work to provide patches for Jessie, would
> > there be a way to continuously update the packages in the Debian
> > infrastructure? Or would that only work with an external repo?

It can't be done inside Jessie main repo, because debian does allow updates of 
packages only for security fixes or fatal issues. Well I may be arguable, that 
there are fatal issues, but the work is not worth that need to be done to 
extratct the patches. The easier approch is to upload the newer packages to 
backports.debian.org. But this also is work, that needs to be done, so if you 
step into that, feel welcome! Keep in mind you have to support packages that 
are in backports till the end of jessie, so this is not an fire & forget.

Regards,

sandro

--

#! /bin/bash
## A script to setup some needed variables and functions for KDE 4 
development.

# Otheng kde3 seems to be in /usr/bin so /usr/sbin seems okay to leave in.
#export PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Qt
# only set Qt related variables if you compiled Qt on your own
# (which is discouraged). if you use the distro provided Qt, skip
# this section. Comment it if necessary.
#export QTDIR=$HOME/qt4
#prepend PATH $QTDIR/bin
#prepend LD_LIBRARY_PATH $QTDIR/lib
#prepend PKG_CONFIG_PATH $QTDIR/lib/pkgconfig

export BASEDIR=/home/kdetest/kde
export GLOBAL_BUILD_DIR=$BASEDIR/build
export GLOBAL_INSTALL_DIR=$BASEDIR/inst
export GLOBAL_HOME_DIR=$BASEDIR/home
export GLOBAL_TMP_DIR=/tmp
export GLOBAL_VARTMP_DIR=/var/tmp
export KDE_SRC=$BASEDIR/src

if [ -z "$ORIGINAL_PATH" ]; then
    export ORIGINAL_PATH=$PATH
fi

# KDE
export KDESYCOCA=/var/tmp/kdesycoca-custom

# XDG
unset XDG_DATA_DIRS # to avoid seeing kde3 files from /usr
unset XDG_CONFIG_DIRS

# Use makeobj instead of make, to automatically switch to the build dir.
# If you don't have makeobj, install the package named kdesdk-scripts or
# kdesdk, or check out kdesdk/scripts from svn.
alias make='nice makeobj -j3'

function printKDEenv {
    echo "KDEHOME: $KDEHOME"
    echo "KDEDIR: $KDEDIR"
    echo "KDEDIRS: $KDEDIRS"
    echo "BUILD_DIR: $BUILD_DIR"
    echo "PATH: $PATH"
    echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
    echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH"
    echo "QT_PLUGIN_PATH: $QT_PLUGIN_PATH"
    echo "CMAKE_PREFIX_PATH: $CMAKE_PREFIX_PATH"
    echo "CMAKE_LIBRARY_PATH: $CMAKE_LIBRARY_PATH"
    echo "CMAKE_INCLUDE_PATH: $CMAKE_INCLUDE_PATH"
    echo "CMAKE_INSTALL_PREFIX: $CMAKE_INSTALL_PREFIX"
    echo "XDG_DATA_DIRS: $XDG_DATA_DIRS"
}

function resetCMakePaths {
    unset CMAKE_PREFIX_PATH
    unset CMAKE_LIBRARY_PATH
    unset CMAKE_INCLUDE_PATH
    unset CMAKE_MODULE_PATH
    unset CMAKE_INSTALL_PREFIX
}

function setCMakePrefixPath {
    prefixPath="$1"
    export CMAKE_PREFIX_PATH=$prefixPath
    export CMAKE_LIBRARY_PATH=$prefixPath/lib:$CMAKE_LIBRARY_PATH
    export CMAKE_INCLUDE_PATH=$prefixPath/include:$prefixPath/include/KDE:
$CMAKE_INCLUDE_PATH
    export CMAKE_MODULE_PATH=$prefixPath/share/apps/cmake/modules:
$CMAKE_MODULE_PATH
    export CMAKE_INSTALL_PREFIX=$prefixPath
}

#Sets all kde related variables (and also resets them"
function setKDEEnv {
    envName="$1"
    setEnv $envName
    export KDEDIR="$GLOBAL_INSTALL_DIR/$envName"
    export KDEDIRS=$KDEDIR
    export KDEHOME="$GLOBAL_HOME_DIR/.$envName"
    export KDETMP="$GLOBAL_TMP_DIR/$envName-$USER"
    export KDEVARTMP="$GLOBAL_VARTMP_DIR/$envName-$USER"
    export XDG_DATA_DIRS="$GLOBAL_INSTALL_DIR/$envName/share"
    
    mkdir -p $KDETMP
    mkdir -p $KDEVARTMP

    export QT_PLUGIN_PATH=$KDEDIR/lib/kde4/plugins:
$KDEDIR/lib/plugins/sqldrivers

    export 
KDE4_AUTH_POLICY_FILES_INSTALL_DIR=$KDEDIR/usr/share/polkit-1/actions

    export XDG_CONFIG_HOME=$KDEHOME/.config
    export XDG_DATA_HOME=$KDEHOME/.local/share
}

#Sets all kde related variables (and also resets them"
function setEnv {
    envName="$1"
    echo "Setting env $envName"
    export TARGETDIR="$GLOBAL_INSTALL_DIR/$envName"
    export PATH=$TARGETDIR/bin:$ORIGINAL_PATH
    export LD_LIBRARY_PATH=$TARGETDIR/lib:$LD_LIBRARY_PATH
    export PKG_CONFIG_PATH=$TARGETDIR/lib/pkgconfig:$PKG_CONFIG_PATH
    export QT_PLUGIN_PATH=$TARGETDIR/lib/kde4:$TARGETDIR/lib/kde4/plugins

    setCMakePrefixPath "$TARGETDIR"

    export SRC_DIR=$KDE_SRC
    export BUILD_DIR=$GLOBAL_BUILD_DIR/$envName

    # Tell many scripts how to switch from source dir to build dir:
    export OBJ_REPLACEMENT="s#$SRC_DIR#$BUILD_DIR#"
}

#native build prefix and /usr/local as install prefix
function setEnvNative {
    export SRC_DIR=$KDE_SRC
    export BUILD_DIR=$HOME/devel/build/native
    resetCMakePaths
    export CMAKE_INSTALL_PREFIX=/usr/local

    # Tell many scripts how to switch from source dir to build dir:
    export OBJ_REPLACEMENT="s#$SRC_DIR#$BUILD_DIR#"
}

# A function to easily build the current directory of KDE.
function cmakekde {
    if test -n "$1"; then
        # srcFolder is defined via command line argument
        srcFolder="$1"
    else
        # get srcFolder for current dir
        srcFolder=`pwd | sed -e s,$BUILD_DIR,$SRC_DIR,`
    fi
    # we are in the src folder, change to build directory
    # Alternatively, we could just use makeobj in the commands below...
    current=`pwd`
    if [[ "$srcFolder" == "$current" ]]; then
        cb
    fi
    # Buildtypes: debug/debugfull
    # export QT_PLUGIN_PATH=$KDEDIR/lib/kde4/plugins
    # export 
KDE4_AUTH_POLICY_FILES_INSTALL_DIR=$KDEDIR/usr/share/polkit-1/actions
    # LIB_SUFFIX is for akonadi
    cmake "$srcFolder" \
        -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
        -
DKDE4_AUTH_POLICY_FILES_INSTALL_DIR="$KDE4_AUTH_POLICY_FILES_INSTALL_DIR" \
        -DCMAKE_BUILD_TYPE=debugfull \
        -DKDE4_BUILD_TESTS=TRUE
    cd "$current"
}

function cmakekolab {
    if test -n "$1"; then
        # srcFolder is defined via command line argument
        srcFolder="$1"
    else
        # get srcFolder for current dir
        srcFolder=`pwd | sed -e s,$BUILD_DIR,$SRC_DIR,`
    fi
    # we are in the src folder, change to build directory
    # Alternatively, we could just use makeobj in the commands below...
    current=`pwd`
    if [[ "$srcFolder" == "$current" ]]; then
        cb
    fi
    # Buildtypes: debug/debugfull
    cmake "$srcFolder" -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" -
DCMAKE_BUILD_TYPE=debugfull
    cd "$current"
}

type cb && unalias cb
# A function to easily change to the build directory.
function cb {
    # Make sure build directory exists.
    mkdir -p "$BUILD_DIR"

    # command line argument
    if test -n "$1"; then
        cd "$BUILD_DIR/$1"
        return
    fi
    # substitute src dir with build dir
    dest=`pwd | sed -e s,$SRC_DIR,$BUILD_DIR,`
    if test ! -d "$dest"; then
        # build directory does not exist, create
        mkdir -p "$dest"
    fi
    cd "$dest"
}

type cs && unalias cs
# Change to the source directory.
function cs {
    # Make sure source directory exists.
    mkdir -p "$SRC_DIR"

    # command line argument
    if test -n "$1"; then
        cd "$SRC_DIR/$1"
    else
        # substitute build dir with src dir
        dest=`pwd | sed -e s,$BUILD_DIR,$SRC_DIR,`
        current=`pwd`
        if [ "$dest" = "$current" ]; then
            cd "$SRC_DIR"
        else
            cd "$dest"
        fi
    fi
}

# Add autocompletion to cs function
function _cs_scandir {
    base=$1
    ext=$2
    if [ -d $base ]; then
        for d in `ls $base`; do
            if [ -d $base/$d ]; then
                dirs="$dirs $ext$d/"
            fi
        done
    fi
}

function _cs() {
        local cur dirs
        _cs_scandir "$SRC_DIR"
        _cs_scandir "$SRC_DIR/KDE" "KDE/"
        COMPREPLY=()
        cur="${COMP_WORDS[COMP_CWORD]}"
        COMPREPLY=( $(compgen -W "${dirs}" -- ${cur}) )
}

# Remove comment on next line to enable cs autocompletion
#complete -F _cs cs

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: