Difference between revisions of "Getting Started/Build/Recipes"

Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 22: Line 22:
 
  git clone kde:<project>.git
 
  git clone kde:<project>.git
 
  cd <project>
 
  cd <project>
  cmakekde
+
  kdebuild
  
 
==== Git Unstable Branch ====
 
==== Git Unstable Branch ====
Line 31: Line 31:
 
  git branch --track <branch> origin/<branch>
 
  git branch --track <branch> origin/<branch>
 
  git checkout <branch>
 
  git checkout <branch>
  cmakekde
+
  kdebuild
  
 
==== Git Stable Branch ====
 
==== Git Stable Branch ====
  
This recipe creates a new clone of the Project and sets it to use a stable branch.  This may be wasteful of disk space if you already have an Unstable clone, but it does allow you to work on Unstable and Stable at the same time without excessive management or rebuilding.  It also closely mirrors how Subversion works.
+
This recipe uses [[/Development/Git/Configuration#Multiple_Work_Branches|git-new-workdir script]] to set up a separate work directory for working on the stable branch.  This will save excessive rebuilding when switching between stable and unstable and uses less space than a separate clone.
  
 
The stable branch name will be of the form 'KDE/4.6' or '4.6' depending on the Project.  Use 'git branch -r' to find out the available release branches.
 
The stable branch name will be of the form 'KDE/4.6' or '4.6' depending on the Project.  Use 'git branch -r' to find out the available release branches.
  
  cd $KDE_SRC/<stable-branch>/<module>
+
  cd $KDE_SRC/master/<module>
  git clone kde:<project>.git
+
  git-new-workdir <project> $KDE_SRC/<stable-branch>/<module>/<project> <stable-branch>
cd <project>
+
  cd $KDE_SRC/<stable-branch>/<module>/<project>
git branch --track <stable-branch> origin/<stable-branch>
+
  kdebuild
  git checkout <stable-branch>
+
 
  cmakekde
+
An example git-new-workdir command for KDE SC 4.6 would be:
 +
 
 +
git-new-workdir ~/kde/src/master/kdelibs ~/kde/src/4.6/kdelibs KDE/4.6
  
 
==== Subversion Unstable ====
 
==== Subversion Unstable ====
Line 51: Line 53:
 
  svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/<module>
 
  svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/<module>
 
  cd <module>
 
  cd <module>
  cmakekde
+
  kdebuild
  
 
If you have a developer account the Subversion command will be:
 
If you have a developer account the Subversion command will be:
Line 61: Line 63:
 
  svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/<branch>/<module>
 
  svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/<branch>/<module>
 
  cd <module>
 
  cd <module>
  cmakekde
+
  kdebuild
  
 
If you have a developer account the Subversion command will be:
 
If you have a developer account the Subversion command will be:
Line 68: Line 70:
 
=== Full Recipe ===
 
=== Full Recipe ===
  
==== Unstable Git ====
+
==== Git Unstable Master ====
  
 
This will be the most commonly used version of the Full Recipe.
 
This will be the most commonly used version of the Full Recipe.
Line 101: Line 103:
 
==== Git Stable Branch ====
 
==== Git Stable Branch ====
  
This recipe creates a new clone of the Project and sets it to use a stable branch.  This may be wasteful of disk space if you already have an Unstable clone, but it does allow you to work on Unstable and Stable at the same time without excessive management or rebuilding.  It also closely mirrors how Subversion works.
+
This recipe uses [[/Development/Git/Configuration#Multiple_Work_Branches|git-new-workdir script]] to set up a separate work directory for working on the stable branch.  This will save excessive rebuilding when switching between stable and unstable and uses less space than a separate clone.
  
 
The stable branch name will be of the form 'KDE/4.6' or '4.6' depending on the Project.  Use 'git branch -r' to find out the available release branches.
 
The stable branch name will be of the form 'KDE/4.6' or '4.6' depending on the Project.  Use 'git branch -r' to find out the available release branches.
  
  cd <your source branch directory>
+
  cd $KDE_SRC/master/<module>
git clone git://anongit.kde.org/<module>.git
+
  git-new-workdir <project> $KDE_SRC/<stable-branch>/<module>/<project> <stable-branch>
cd <project>
+
  git branch --track <stable-branch> origin/<stable-branch>
+
git checkout <stable-branch>
+
 
  cd <your build branch directory, or the module source dir>
 
  cd <your build branch directory, or the module source dir>
 
  mkdir <your module build dir>
 
  mkdir <your module build dir>
Line 119: Line 118:
 
  nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
 
  nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
 
  make install
 
  make install
 +
 +
An example git-new-workdir command for KDE SC 4.6 would be:
 +
 +
git-new-workdir ~/kde/src/master/kdelibs ~/kde/src/4.6/kdelibs KDE/4.6
  
 
==== Subversion Unstable ====
 
==== Subversion Unstable ====
Line 159: Line 162:
 
If you have a developer account the Subversion command will be:
 
If you have a developer account the Subversion command will be:
 
  svn checkout svn+ssh://<username>@svn.kde.org/home/kde/branches/KDE/<branch>/<module>
 
  svn checkout svn+ssh://<username>@svn.kde.org/home/kde/branches/KDE/<branch>/<module>
 +
 +
=== Useful Tips ===
 +
 +
==== make /fast ====
 +
 +
If you want to recompile part of a module without rebuilding any other parts of a module that it uses then you can pass make the /fast option.
 +
 +
For example if you just want to rebuild the contentes of kdelibs/kdeui without rebuilding the contents of kdelibs/kdecore that it uses, then simply do:
 +
  make kdeui/fast
 +
  make install/fast

Latest revision as of 18:13, 25 May 2011

Contents

[edit] Build Recipes

The recipes provided here should be used when following the Build pages for KDE Software. These recipes will not be repeated in the Build pages, only variations from the standard recipe will be documented, usually just the git or svn repository address, but sometimes also additional configuration options.

The Easy Recipe relies on you setting up your environment according to the KDE recommendations. This will give you many shortcuts to save on typing. See the Build Environment section on how to do this.

The Full Recipe is provided for those who wish to control their own build or want to see the full steps required, and don't mind lots of typing.

In Git many KDE Modules have been split up into separate Projects for each Application or Library. Putting all the Git Projects into the same source directory would get very messy. To help keep everything easy to update the recipe recommends you organize the Projects into separate sub-directories for each Module.

For Subversion the repository address changes if you have a developers account or if you want a stable release.

For Git the repository address does not change if you have a developers account or if you want a stable release, you always clone the project from anongit. However a stable build requires some extra steps.

[edit] Easy Recipe

[edit] Git Unstable Master

This will be the most commonly used version of the Easy Recipe.

cd $KDE_SRC/master/<module>
git clone kde:<project>.git
cd <project>
kdebuild

[edit] Git Unstable Branch

This recipe uses the same Git clone as your main Unstable Master build but allows you to build a specific development branch you may be interested in. It assumes you have already cloned the project repository. Use 'git branch -r' to find out the available development branches.

cd $KDE_SRC/master/<module>/<project>
git branch --track <branch> origin/<branch>
git checkout <branch>
kdebuild

[edit] Git Stable Branch

This recipe uses git-new-workdir script to set up a separate work directory for working on the stable branch. This will save excessive rebuilding when switching between stable and unstable and uses less space than a separate clone.

The stable branch name will be of the form 'KDE/4.6' or '4.6' depending on the Project. Use 'git branch -r' to find out the available release branches.

cd $KDE_SRC/master/<module>
git-new-workdir <project> $KDE_SRC/<stable-branch>/<module>/<project> <stable-branch>
cd $KDE_SRC/<stable-branch>/<module>/<project>
kdebuild

An example git-new-workdir command for KDE SC 4.6 would be:

git-new-workdir ~/kde/src/master/kdelibs ~/kde/src/4.6/kdelibs KDE/4.6

[edit] Subversion Unstable

cd $KDE_SRC/master
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/<module>
cd <module>
kdebuild

If you have a developer account the Subversion command will be:

svn checkout svn+ssh://<username>@svn.kde.org/home/kde/trunk/KDE/<module>

[edit] Subversion Stable

cd $KDE_SRC/<stable-branch>
svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/<branch>/<module>
cd <module>
kdebuild

If you have a developer account the Subversion command will be:

svn checkout svn+ssh://<username>@svn.kde.org/home/kde/branches/KDE/<branch>/<module>

[edit] Full Recipe

[edit] Git Unstable Master

This will be the most commonly used version of the Full Recipe.

cd <your source root directory>
git clone git://anongit.kde.org/<module>.git
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

[edit] Git Unstable Branch

This recipe uses the same Git clone as your main Unstable Master build but allows you to build a specific development branch you may be interested in. It assumes you have already cloned the project repository. Use 'git branch -r' to find out the available development branches.

cd <your project source directory>
git branch --track <branch> origin/<branch>
git checkout <branch>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

[edit] Git Stable Branch

This recipe uses git-new-workdir script to set up a separate work directory for working on the stable branch. This will save excessive rebuilding when switching between stable and unstable and uses less space than a separate clone.

The stable branch name will be of the form 'KDE/4.6' or '4.6' depending on the Project. Use 'git branch -r' to find out the available release branches.

cd $KDE_SRC/master/<module>
git-new-workdir <project> $KDE_SRC/<stable-branch>/<module>/<project> <stable-branch>
cd <your build branch directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

An example git-new-workdir command for KDE SC 4.6 would be:

git-new-workdir ~/kde/src/master/kdelibs ~/kde/src/4.6/kdelibs KDE/4.6

[edit] Subversion Unstable

cd <your source root directory>
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/<module>
cd <project>
git branch --track <stable-branch> origin/<stable-branch>
git checkout <stable-branch>
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

If you have a developer account the Subversion command will be:

svn checkout svn+ssh://<username>@svn.kde.org/home/kde/trunk/KDE/<module>

[edit] Subversion Stable

cd <your source branch directory>
svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/<branch>/<module>
cd <project>
git branch --track <stable-branch> origin/<stable-branch>
git checkout <stable-branch>
cd <your build branch directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

If you have a developer account the Subversion command will be:

svn checkout svn+ssh://<username>@svn.kde.org/home/kde/branches/KDE/<branch>/<module>

[edit] Useful Tips

[edit] make /fast

If you want to recompile part of a module without rebuilding any other parts of a module that it uses then you can pass make the /fast option.

For example if you just want to rebuild the contentes of kdelibs/kdeui without rebuilding the contents of kdelibs/kdecore that it uses, then simply do:

 make kdeui/fast
 make install/fast

This page was last modified on 25 May 2011, at 18:13. This page has been accessed 7,903 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal