Reply to topic

correct setup check

User avatar of_darkness
Registered Member

correct setup check

Sun Oct 26, 2008 9:40 pm
as i find im getting alot of errors in kdesvn-build i thought to check that my env is sane.

[code] path

[code]## A script to setup some needed variables and functions for KDE 4 development.
## This should normally go in the ~/.bashrc file of your kde-devel user, so
## that it is executed when a session for that user is started.
## If you don't use a separate user, the first section with the
## environment variables should go into a separate script.

prepend() { [ -d "$2" ] && eval $1="$2${$1:+':'$$1}" && export $1 ; }

# Other
# you might want to set a full value for PATH rather than prepend'ing, to make
# sure the your kde3 path isn't in here.
prepend PATH /opt/kde4/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/qt-copy
prepend PATH $QTDIR/bin
prepend PKG_CONFIG_PATH $QTDIR/lib/pkgconfig

export KDEDIR=$HOME/kde
export KDEHOME=$HOME/.kde4
export KDETMP=/tmp/kde4-$USER
mkdir -p $KDETMP
prepend PATH $KDEDIR/bin
prepend PKG_CONFIG_PATH $KDEDIR/lib/pkgconfig
prepend QT_PLUGIN_PATH $KDEDIR/lib/kde4/plugins

export PATH

# CMake
# Make sure CMake searches the right places.
prepend CMAKE_PREFIX_PATH /home/blutengel-kde4/kde/bin


# DBus
# only set DBUS related variables if you compiled dbus on your own
# (which is really discouraged). if you use the distro provided dbus,
# skip this variable. Uncomment it if necessary.
#prepend PKG_CONFIG_PATH $DBUSDIR/lib/pkgconfig

# only needed on some strange systems for compiling Qt. do not set
# it unless you have to.
#export YACC='byacc -d'

unset XDG_DATA_DIRS # to avoid seeing kde3 files from /usr

# you might want to change these:
export KDE_BUILD=$HOME/kde/build
export KDE_SRC=$HOME/kde/src

# make the debug output prettier

# Make
# Tell many scripts how to switch from source dir to build dir:
# 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=makeobj

# Uncomment the following lines if DBus does not work. DBus is not
# working if, when you run `dbus-uuidgen --ensure && qdbus`, you get an error.
# alias dbusstart="eval `PATH=$DBUSDIR/bin
# $DBUSDIR/bin/dbus-launch --auto-syntax`"

# A function to easily build the current directory of KDE.
# This builds only the sources in the current ~/{src,build}/KDE subdirectory.
# Usage: cs KDE/kdebase && cmakekde
# will build/rebuild the sources in ~/src/KDE/kdebase
function cmakekde {
local srcFolder current

if test -n "$1"; then
# srcFolder is defined via command line argument
# get srcFolder for current dir
srcFolder=`pwd | sed -e s,$KDE_BUILD,$KDE_SRC,`
# we are in the src folder, change to build directory
# Alternatively, we could just use makeobj in the commands below...
if [ "$srcFolder" = "$current" ]; then
#To enable tests, uncomment -DKDE4_BUILD_TESTS=TRUE.
# If you are building to debug or develop, it is reccommended to
# uncomment the line -DCMAKE_BUILD_TYPE=debugfull. Be sure to move
# it above the -DKDE4_BUILD_TESTS=TRUE line if you leave that one
# commented out. You can also change "debugfull" to "debug" to save
# disk space.
# Some distributions use a suffix for their library directory when
# on x86_64 (i.e. /usr/lib64) if so, you have to add -DLIB_SUFFIX=64
# for example.
# -DCMAKE_BUILD_TYPE=debugfull

# uncomment the following two lines to make builds wait after
# configuration step, so that the user can check configure output
#echo "Press to continue..."
#read userinput

# Note: To speed up compiling, change 'make -j2' to 'make -jx',
# where x is your number of processors +1
nice make -j3 &&
make install;

# for the lazy ones, add/comment other directories
function cmakekdeall {
cs kdesupport && svn up && cmakekde
cs KDE/kdelibs && svn up && cmakekde
cs KDE/kdebase && svn up && cmakekde
cs KDE/kdepimlibs && svn up && cmakekde
cs KDE/kdepim && svn up && cmakekde
cs KDE/kdegraphics && svn up && cmakekde
cs KDE/kdemultimedia && svn up && cmakekde
cs KDE/kdenetwork && svn up && cmakekde
cs KDE/kdeutils && svn up && cmakekde

# A function to easily change to the build directory.
# Usage: cb KDE/kdebase
# will change to $KDE_BUILD/KDE/kdebase
# Usage: cb
# will simply go to the build folder if you are currently in a src folder
# Example:
# $ pwd
# /home/user/src/KDE/kdebase
# $ cb && pwd
# /home/user/build/KDE/kdebase
function cb {
local dest

# Make sure build directory exists.
mkdir -p "$KDE_BUILD"

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

# Change to the source directory. Same as cb, except this
# switches to $KDE_SRC instead of $KDE_BUILD.
# Usage: cs KDE/kdebase
# will change to $KDE_SRC/KDE/kdebase
# Usage: cs
# will simply go to the source folder if you are currently in a build folder
# Example:
# $ pwd
# /home/user/build/KDE/kdebase
# $ cs && pwd
# /home/user/src/KDE/kdebase
function cs {
local dest current

# Make sure source directory exists.
mkdir -p "$KDE_SRC"

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

# Add autocompletion to cs function
function _cs_scandir
local base ext

if [ -d $base ]; then
for d in `ls $base`; do
if [ -d $base/$d ]; then
dirs="$dirs $ext$d/"

function _cs()
local cur dirs
_cs_scandir "$KDE_SRC"
_cs_scandir "$KDE_SRC/KDE" "KDE/"
COMPREPLY=( $(compgen -W "${dirs}" -- ${cur}) )

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

function start3app {
mkdir -p /tmp/$USER-kde
#export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/usr/bin/X11:/usr/games/opt/kde4/bin
export #PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/usr/bin/X11:
export KDETMP=/tmp/$USER-kde
export KDEVARTMP=/var/tmp/$USER-kde
export KDEHOME=$HOME/.kde
export KDEDIR=/usr
export DISPLAY=:0
eval "[email protected]"
source $HOME/.bashrc #Reset environment variables again


# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
# ... or force ignoredups and ignorespace
export HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m][email protected][33[00m]:[33[01;34m]w[33[00m]$ '
PS1='${debian_chroot:+($debian_chroot)}[email protected]:w$ '
unset color_prompt force_color_prompt

# If this is an xterm set the title to [email protected]:dir
case "$TERM" in
PS1="[e]0;${debian_chroot:+($debian_chroot)}[email protected]: wa]$PS1"

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

function path(){
printf "%sn" $PATH

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion


shopt -s histappend
PROMPT_COMMAND='history -a'
shopt -s cdspell
export HISTCONTROL="ignoredups"
export HISTIGNORE="&:ls:[bf]g:exit"
shopt -s cmdhist

export DEBEMAIL="[email protected]"

[code]# Sample configuration file for kdesvn-build.
# To use this sample configuration file, copy it to ~/.kdesvn-buildrc, and then
# edit it to suit your desires.

# Global settings go in this section. They apply to every module unless
# overridden later.

# This option controls whether KDE 3.5 or KDE 4.0 is compiled. If you set this
# option to true, kdesvn-build will automatically select the correct branch of
# a module needed to build KDE 3.5 in most cases. Most modules will come from
# the 3.5 branch, arts will come from 1.5, and qt-copy will come from 3.3.
# It is always possible to override the default by using the branch, tag, or
# override-url option yourself.
# If you set this option to false, or leave it unset, kdesvn-build will build
# /trunk, which corresponds right now with KDE 4.0. If you set this option to
# true, you should also comment out or remove the branch option which is set
# in the "module kdelibs" section below.
# use-stable-kde false

# binpath controls the value of the PATH environment variable during
# compilation. If you have unusual tools that need to be in the path to build
# KDE, add them here. KDE's and Qt's programs are automatically added.
# If you leave this option blank, it will default to the PATH that kdesvn-build had
# when it was started.
# binpath /bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
# binpath /usr/lib/ccache/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

# This is the directory that your KDE sources are downloaded to. This
# directory also holds the build and log directories by default.
source-dir ~/kdesvn

# This directory is where everything gets built before it is installed. By
# default it is relative to the value for source-dir. You can specify an
# absolute path if you'd like (begin the path with a slash).
build-dir build

# This is the directory that KDE will end up installed at. The default is
# appropriate for a single-user installation of KDE, which requires no root
# permissions. If you'd like, you can install and use the sudo program to
# install KDE anywhere on your system, in conjunction with the
# make-install-prefix option.
kdedir /opt/kde4
# You can overwrite the installation directory for a given module using
# the per-module "prefix" option. Note that when doing this you need to
# set KDEDIRS, PATH and LD_LIBRARY_PATH to point to both directories,
# and that you should use separate test users or KDEHOME values to separate
# the ksycoca databases. Only set prefix if you know what you're doing.

# If you would like install KDE to the system (DO NOT INSTALL *over* a prior
# installation!), then you'll probably need to use sudo to install everything.
# The -S parameter causes sudo to read from standard input (which is redirected
# by kdesvn-build). This means that if sudo has to ask for your password, it
# will fail, you need to configure sudo to be able to run "make install" and
# "unsermake install" without requesting a password.
# In addition, you can run kdesvn-build --no-install, and then
# sudo kdesvn-build --install if you are unable to configure sudo to allow
# make install with no password.
# make-install-prefix sudo -S

# This is the Qt installation to use to build KDE. The default is qt-copy
# from Subversion. The ${build-dir} option uses whatever you set for
# build-dir to automatically fill in the value.
# For qt-copy users, this is also the directory to install qt-copy to.
# KDE 4.0 may require qt-copy at times instead of a released Qt so it is
# better to use qt-copy for /trunk users.
qtdir ~/qt4 # Default to installing Qt (Qt 4).
# qtdir ${build-dir}/build/qt-copy # Use built Qt (Qt 3).

# You might want to use your system's built-in Qt already (4.4 or greater for
# KDE 4, 3.3.x for KDE 3.5.) If so, assign the qtdir option appropriately.
# qtdir /path/to/system/qt

# This is the Subversion server to download the KDE sources from. Developers:
# Don't forget to add your username to the URL if necessary!
# svn-server svn://

# This controls the configure flags passed to every module (except qt-copy) by
# default. If you have module-specific configure flags, they will be placed
# after these flags to allow the module setting to override the global setting.
# This setting only applies to KDE 3 modules.
configure-flags --enable-debug

# KDE 4 uses CMake. The equivalent to configure-flags is cmake-options. BUT
# the same options will not work, CMake expects them in a different format.
# You should probably not need to use cmake-options however. KDE4_BUILD_TESTS
# is provided as an example.
# NOTE: If you want the cxxflags option below to work (advanced users only)
# then make sure to set the "-DCMAKE_BUILD_TYPE=none" here, or in the specific
# module's cmake-options
# Also see
# cmake-options -DKDE4_BUILD_TESTS:BOOL=ON
cmake-options -DCMAKE_BUILD_TYPE=RelWithDebInfo

# These are the compilation flags to use by default when compiling KDE.
# gcc supports a -march option in order to generate specific code for pentium4, athlon-xp,
# etc. See the gcc man page for more information.
# NOTE: For KDE 4 these flags are only applied if you set the CMAKE_BUILD_TYPE setting
# to "none" (see the cmake-options setting)
# cxxflags -pipe -march=i686 # For standard 32-bit systems.

# KDE has one of the most extensive translation packages in the world. They
# are stored in the l10n module. kdesvn-build can automatically try to build
# and install languages for you, using this parameter. It should be a list
# of languages to build and install. This option requires the language code
# as present in l10n. You can look these codes up at
# kde-languages de # German
# kde-languages fr # French
# kde-languages en_GB cs # British English and Czech
kde-languages sv en_GB

# These are the default options passed to the make command. The default tries
# to build with 2 parallel compiles. If you are using distcc or have SMP, you
# should experiment with setting this value higher for best performance.
make-options -j3

# These are the default options passed to unsermake, which supports some
# options not present with make. The default tries to run 2 compile jobs
# in parallel. The -p option is used to display progress information.
# unsermake can only be used with KDE 3.
# unsermake-options --compile-jobs=2 -p

# unsermake is used by default for KDE 3 modules. However, you may get tired
# of kdesvn-build updating unsermake all the time. In that case, uncomment the
# following. NOTE: You are responsible for updating unsermake after that by
# going to its directory and running 'svn up' when needed. If you have not yet
# downloaded unsermake let kdesvn-build update it before uncommenting.
# use-unsermake self

# You can use the set-env option to add values to the build environment.
# set-env LDFLAGS -Wl,-O1 # Optimize the linker, takes longer.

# If you use software which requires pkg-config, and you need to add entries
# to your pkg-config path, you can also use set-env for that. Some broken
# systems require you to set this to find e.g. glib.
# set-env PKG_CONFIG_PATH /opt/gnome/lib/pkgconfig
end global

# qt-copy is a copy of Trolltech's Qt, optionally with some bugfixes and
# optimizations added. It is the easiest way to get Qt if you don't already
# have it (and you don't want to use your distro's tools to install it.)
module qt-copy
# Configure flags. If you use Qt 3, then uncomment the lines
# below the Qt 3 option line (by removing the # at the beginning) and
# comment the Qt 4 lines which follow.
configure-flags -qt-gif -no-exceptions -fast -qdbus
-nomake examples -nomake demos
-no-phonon # Phonon built separately

# configure-flags -system-zlib -qt-gif -system-libjpeg -system-libpng
# -no-exceptions -fast -thread -debug
# make-options -j2 sub-src sub-tools # Build faster, no examples built

apply-qt-patches true # Works with Qt 3 and 4, recommended as well.
# make-options -j2
end module

# arts is the KDE sound library. It is not expected to be used by the time
# KDE 4 is released.
#module arts
#end module

# kdesupport contains taglib and QCA, and the Strigi library required for
# kdelibs in KDE 4. taglib is required for JuK, amarok, and the meta info
# reader for music files in Konqueror.
# kdesupport is also the bearer of automoc and all that is good and right with
# CMake, install it before all KDE modules.
module kdesupport
end module

# Phonon is the multimedia interface for KDE 4. It is developed in kdesupport
# but a separate branch is available for stability. It may also be included
# with Qt. KDE trunk depends on phonon trunk, so disable it for now.
# You can do phonon trunk if you'd like but it's included in kdesupport trunk
# anyways.
module phonon
# branch 4.2
end module

# kdelibs are the base KDE libraries needed by all KDE applications.
module kdelibs
# KDE 3 syntax:
# configure-flags --enable-sendfile --enable-mitshm

# KDE 4 uses CMake, if you need to pass options to the cmake command, use this
# option:
# cmake-options -DKDE4_BUILD_TESTS:BOOL=ON

# If you're a programmer you may want to build the API docs. There is a
# separate script in kdesdk/scripts to do that for you however.
end module

# If you are not using KDE 4 then uncomment or remove this module. It is required
# before kdebase in KDE 4.
module kdepimlibs
end module

# kdebase contains useful general-purpose programs, normally people would
# expect a usable desktop to have these.
module kdebase
#configure-flags --with-pam --with-shadow
end module

# kdemultimedia contains JuK, noatun, Kaboodle, and other KDE multimedia
# applications. It does not include amarok, which is in extragear/multimedia
module kdemultimedia
end module

# ... Well, they're games. ;)
module kdegames
end module

## Note: The following modules may not have been ported to KDE 4 yet, and may
# have changed significantly from their KDE 3 counterparts as well. Because
# of this, they are commented out, uncomment it if you want to build it.

# kdesdk is a useful module for software developers. It is where kdesvn-build
# is developed.
#module kdesdk
#end module

# kdenetwork has Kopete and other useful applications for the Internet and
# other networks.
module kdenetwork
end module

# kdeadmin has system administration tools for your computer.
module kdeadmin
# KDE3 configure flags:
# configure-flags --with-shadow --with-pam=yes
#end module

# kdebindings is useful for software developers, and for those who wish to run
# some KDE programs that don't use C++. The python bindings are not included
# by default as they never build for me. If you'd like to build all the
# bindings, comment out the checkout-only option below.
# This module appears to be on its way to being ported to Qt 4, stay tuned.
module kdebindings
# checkout-only admin dcopc kalyptus smoke qtruby korundum kjsembed dcoppython

# kdebindings will probably need to use the following option to install successfully.
# You must configure the sudo program first to allow for passwordless operation.
make-install-prefix sudo
end module

# kdepim contains KMail, Kontact, KOrganizer, and other insanely useful
# programs that help you keep track of things.
module kdepim
# KDE3 configure flags:
# configure-flags --disable-exchange
end module

# kdeutils has miscellaneous programs which can be useful. You probably won't
# die if you remove this from the config file though.
module kdeutils
end module

# kdegraphics contains various programs useful for graphics editing. It
# doesn't include Krita, which is part of KOffice, but it is worth it just for
# KolourPaint and Gwenview.
module kdegraphics
end module

# Contains nifty diversions of time, which generally aren't games.
module kdetoys
end module

# Educational programs. Some are actually quite fun even if you're not trying
# to learn anything.
module kdeedu
end module

# Extra collection of useful plasma applets, runners, data engines, etc.
module kdeplasma-addons
end module

# The KDE Office Suite. Includes a pretty expansive collection of programs.
# It is rather large, so you can cut download and build times by removing it
# from this file.
#module koffice
# branch 1.6 # The last released version for KDE 3.
#end module

## A prerequisite for kdevelop other modules using the kdevelop platform, like
# kdewebdev
#module kdevplatform
#end module

## The KDevelop IDE, useful for developing all kinds of programs. If you don't
# plan on being a software developer you can save time by removing this from
# your configuration.
# Note: KDevelop appears to have a port started towards KDE 4. It may be
# usable by now.
#module kdevelop
# use-unsermake false
#end module

# Includes Quanta Plus and other web design tools.
#module kdewebdev
#end module

# Modules in extragear and playground can also be added.
# To see what you can find in the various modules, browse
# and

# Includes various libraries needed by other applications in extragear.
module extragear/libs

# If you don't like the default name that kdesvn-build gives modules on-disk,
# you can use dest-dir to change it.
# dest-dir extragear-libs
end module

# Includes the popular K3B and Amarok programs.
module extragear/multimedia
end module

# Includes various photo management applications.
module extragear/graphics
# checkout-only digikamimageplugins digikam gwenview kimdaba
end module

module extragear/network
# # Options like checkout-only should work as before.
# checkout-only konversation
end module

module playground/games
end module

# Add more modules as needed.

[code]$ uname -a
Linux Starvald-demelain 2.6.27-7-generic #1 SMP Fri Oct 17 22:24:30 UTC 2008 x86_64 GNU/Linux

[code] Ubuntu intrepid[/code]

running desktop env
[code]kde 3.5.10 from repo[/code]

other instaled desktop env.
[code]standarad gnome, hardy ppa kde4 in /usr/lib/kde4 , kdesvn-build kde4 in /opt/kde4 (mount binded full adress is /media/Lagring/OPT/kde4)[/code]

of_darkness, proud to be a member of KDE forums since 2008-Oct.
User avatar bcooksley

RE: correct setup check

Mon Dec 29, 2008 11:46 am
If you are still experiencing errors, could you please provide examples of these errors?

If you are no longer experiencing them, could you please add [SOLVED] to the beginning of the thread subject? Thanks in advance.

KDE Sysadmin

Reply to topic


Who is online

Registered users: Baidu [Spider], Bing [Bot], boudewijn, funix, Google [Bot], ipwizard, Majestic-12 [Bot], Mamarok, P3lor, Willov, Yahoo [Bot], zachalexy