This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Compile Krita/trunk (Ubuntu / Debian /OpenSuse / ArchLinux)

Tags: None
(comma "," separated)
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
January 2011 - This how-to is depreciated with the moving to Calligra and Git of the developpement team and may not work. I let the text here if it helps someone.

New thread and building script is here : http://forum.kde.org/viewtopic.php?f=139&t=92880


Step by step tested and working on a Ubuntu system
This steps was written with the help of users in this thread.Many time I copy/pasted and quoted freely to their sentences ( a lot from the how-to of Enkithan ) Many thanks to them.
All the updated informations are in the first 2 posts ; this one and the next by Enkithan.

II. For Ubuntu Lucid, Linux Mint Isadora

1. Dependencies

Open a terminal :
Code: Select all
sudo apt-get install kdelibs5-dev

Open Synaptic(System / Administration / Synaptic package manager )
Go to the menu bar ->Settings->Repositories
click on the "Other software" label, then press Add button and paste those line ( do it twice )
Code: Select all
deb http://archive.ubuntu.com/ubuntu lucid-backports main universe multiverse restricted

Code: Select all
deb-src http://archive.ubuntu.com/ubuntu lucid-backports main universe multiverse restricted


note : to upgrade Qt
Code: Select all
deb http://ppa.launchpad.net/kubuntu-ppa/ppa/ubuntu lucid main

package : qt4-qmake.


Close it, press the reload button to refresh packages. Close Synaptic then in a terminal :
Code: Select all
sudo apt-get build-dep koffice

2. Grab sources and compile
In a terminal :
Code: Select all
cd ~/
mkdir koffice
cd koffice
gedit koinstall.sh

when the text editor start paste into the following code :
Code: Select all
#!/bin/sh
LANG=C
_svntrunk=svn://anonsvn.kde.org/home/kde/trunk/koffice
_svnmod=koffice

if [ -d $_svnmod-src/.svn ]; then
    (cd $_svnmod-src && svn up)
else
    svn co $_svntrunk --config-dir ./ $_svnmod-src
fi

echo "SVN checkout done or server timeout"
echo "Starting make..."

mkdir -p $_svnmod-build # create the build dir if it does not exist
cd $_svnmod-build

cmake ../$_svnmod-src -DBUILD_krita=on -DBUILD_karbon=on -DBUILD_kword=off -DBUILD_kpresenter=off -DBUILD_kspread=off -DBUILD_kchart=off -DBUILD_kexi=off -DBUILD_kplato=off -DBUILD_kivio=off -DBUILD_kformula=off -DBUILD_f-office=off -DCMAKE_INSTALL_PREFIX=../$_svnmod-inst -DCMAKE_BUILD_TYPE=RELWITHDEBINFO

make -j3  #make -j"number of core + 1"
make install

Save, and close the text editor.
In a terminal :
Code: Select all
sudo chmod +x koinstall.sh
sudo apt-get install subversion
./koinstall.sh

It will be long ( downloading the source + compile )
At the end of the installation, you will see a bunch of "-- Installing /blabla/bla...." lines. If not, the build failed, ask on this thread :-)
Then a terminal run this :
Code: Select all
gedit ~/.bashrc

when the text editor start paste into the following code :
Code: Select all
export KDEDIRS=$(kde4-config --prefix)
export KDEDIRS=$KDEDIRS:$HOME/koffice/koffice-inst
export KDEDIR=$KDEDIRS
export PATH=$PATH:$HOME/koffice/koffice-inst/bin
export XDG_DATA_DIRS=$XDG_DATA_DIRS:$HOME/koffice/koffice-inst/share

Now , reboot your computer
3. Run it
In a terminal run this :
Code: Select all
kbuildsycoca4

Code: Select all
krita

4. Updates
Each time you want to update your krita build, open a terminal in the koffice folder and run ./koinstall.sh






II. For Ubuntu Karmic, Linux Mint Helena

1. Dependencies
Open a terminal :
Code: Select all
sudo apt-get install kdelibs5-dev

Open Synaptic(System / Administration / Synaptic package manager )
Go to the menu bar ->Settings->Repositories and check "Source code" and "Backported packages ( backport)"
click on the "Other software" label, then press Add button and paste those line ( do it twice )
Code: Select all
deb http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu karmic main

Code: Select all
deb-src http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu karmic main

(repositeries found on https://edge.launchpad.net/~kubuntu-ppa ... /backports)
Close it, press the reload button to refresh packages. Close Synaptic then in a terminal :
Code: Select all
sudo apt-get build-dep koffice-kde4

2. Grab sources and compile
In a terminal :
Code: Select all
cd ~/
mkdir koffice
cd koffice
gedit koinstall.sh

when the text editor start paste into the following code :
( edit : thanks to Enkithan for the update )

Code: Select all
#!/bin/sh
LANG=C
_svntrunk=svn://anonsvn.kde.org/home/kde/trunk/koffice
_svnmod=koffice

if [ -d $_svnmod-src/.svn ]; then
    (cd $_svnmod-src && svn up)
else
    svn co $_svntrunk --config-dir ./ $_svnmod-src
fi

echo "SVN checkout done or server timeout"
echo "Starting make..."

mkdir -p $_svnmod-build # create the build dir if it does not exist
cd $_svnmod-build

cmake ../$_svnmod-src -DBUILD_krita=on -DBUILD_karbon=on -DBUILD_kword=off -DBUILD_kpresenter=off -DBUILD_kspread=off -DBUILD_kchart=off -DBUILD_kexi=off -DBUILD_kplato=off -DBUILD_kivio=off -DBUILD_kformula=off -DBUILD_f-office=off -DCMAKE_INSTALL_PREFIX=../$_svnmod-inst -DCMAKE_BUILD_TYPE=RELWITHDEBINFO

make -j3  #make -j"number of core + 1"
make install

Save, and close the text editor.
In a terminal :
Code: Select all
sudo chmod +x koinstall.sh
sudo apt-get install subversion
./koinstall.sh

It will be long ( downloading the source + compile )
At the end of the installation, you will see a bunch of "-- Installing /blabla/bla...." lines. If not, the build failed, ask on this thread :-)
Then a terminal run this :
Code: Select all
gedit ~/.bashrc

when the text editor start paste into the following code :
Code: Select all
export KDEDIRS=$(kde4-config --prefix)
export KDEDIRS=$KDEDIRS:$HOME/koffice/koffice-inst
export KDEDIR=$KDEDIRS
export PATH=$PATH:$HOME/koffice/koffice-inst/bin
export XDG_DATA_DIRS=$XDG_DATA_DIRS:$HOME/koffice/koffice-inst/share

Now , reboot your computer
3. Run it
In a terminal run this :
Code: Select all
kbuildsycoca4

Code: Select all
krita

4. Updates
Each time you want to update your krita build, open a terminal in the koffice folder and run ./koinstall.sh

Last edited by Deevad on Sun Feb 20, 2011 4:35 am, edited 11 times in total.


enkithan
Registered Member
Posts
18
Karma
0
OS
Installing dependencies on other distribs

*Opensuse:
Code: Select all
zypper si -d koffice-devel

*Deb based distribs:
Code: Select all
sudo apt-get build-dep koffice-kde4


How-to make a Krita package for ArchLinux:

1. Save this script in a text file, and name it PKGBUILD.

Code: Select all
pkgname=koffice-svn
pkgver=1040207
pkgrel=1
pkgdesc="KOffice"
arch=('i686' 'x86_64')
url="http://www.koffice.org"
license=('GPL' 'LGPL')
depends=('kdebase-runtime' 'kdelibs' 'kdepimlibs' 'glew' 'exiv2>=0.18'
        'gsl' 'qca' 'poppler-qt' 'qimageblitz' 'lcms' 'xdg-utils'
        'libwpd' 'shared-mime-info' 'pstoedit' 'hicolor-icon-theme'
        'opengtl' 'openexr')
makedepends=('subversion' 'cmake' 'eigen' 'automoc4' 'boost' 'pkgconfig')
optdepends=('gmm++: various Krita filters')
provides=(koffice-krita koffice-karbon koffice)
conflicts=(koffice-krita koffice-karbon koffice)
options=(!strip docs)
_svntrunk=svn://anonsvn.kde.org/home/kde/trunk/koffice
_svnmod=koffice
LANG=C

build() {
    # start building
    cd $startdir/src

    if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up)
    else
    svn co $_svntrunk --config-dir ./ $_svnmod
    fi

    msg "SVN checkout done or server timeout"
    msg "Starting make..."

    mkdir -p $startdir/src/$_svnmod-build
    cd $_svnmod-build
   
    cmake $startdir/src/$_svnmod -DBUILD_krita=on -DBUILD_karbon=on -DBUILD_kword=off -DBUILD_kpresenter=off -DBUILD_kspread=off -DBUILD_kchart=off -DBUILD_kexi=off -DBUILD_kplato=off -DBUILD_kivio=off -DBUILD_kformula=off -DBUILD_f-office=off -DCMAKE_INSTALL_PREFIX='/usr' -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
    make || return 1
    make DESTDIR=$startdir/pkg install || return 1
}

This script will build only krita and karbon.
If you want to try other koffice apps, just replace "off" by "on" next to the app name, in the cmake line (e.g. "-DBUILD_kword=on" to build kword).

2.to build the package, type this command:
Code: Select all
$ makepkg -s

If everything goes well, a new package appeared in the folder, with a name like that : koffice-svn-"svn-revision"-"arch".pkg.tar.gz
"svn-revision" being a number, and "arch" being x86_64 or i686.

3.to install:
Code: Select all
# pacman -U "packagename"

4. When you want to update, repeat step 2. and 3.

that's all :)

Edit 2010/04/13
*removed the tutorial now that Deevad made a much better one.
*show complementary infos for other distribs.
*how-to make an Arch package.
Edit 2010/05/29
*added missing dependencies
*use makepkg -s instead of installing all dependencies manually (thanks Kubuntiac !).

Last edited by enkithan on Sat May 29, 2010 10:39 am, edited 3 times in total.
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Many thanks Enkithan,
Your how-to is perfectly readable and well done.

Here I'm blocked with an error. Probably cause I don't use the same system as you ( Linux Mint Helena , Ubuntu karmic based ).

What I did for the moment :
    - I went to Synaptic, enable the back-port repositeries
    - After refreshing Synaptic, I installed the package Koffice-KDE4
    - I selected just after completion Koffice-KDE4 for a complete removal
    - After, I installed the package for Cmake and Subversion
    - I checked in my home dir if after Ctrl+H ( unhide files ) their is still a .Koffice. No, nothing
    - I created your script with Gedit, save it to the new folder as you explain, and right click on it, to give the file the permission to be executable.
    - I executed the script with a terminal (gnome menu / accessories )
    - I obtained this error :

Code: Select all
At revision 1110822.
SVN checkout done or server timeout
Starting make...
CMake Error at /usr/share/cmake-2.6/Modules/FindKDE4.cmake:84 (MESSAGE):
  ERROR: cmake/modules/FindKDE4Internal.cmake not found in
  /home/renderman/.kde/share/apps;/usr/share/kde4/apps
Call Stack (most recent call first):
  CMakeLists.txt:79 (find_package)


-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found.  Stop.


(note: my profile name is 'renderman'; I try to install it in my renderfarm ;D this machine is ok for all test, I often reinstall on it a new fresh system.)


User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You need to install the appropriate KDE Libs development packages ( kdelibs5-dev I think for Debian based distros )


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
enkithan
Registered Member
Posts
18
Karma
0
OS
hmm.. I had totally forgotten that many distrib split their packages in -lib and -dev... that makes my package list a bit useless :-/
So installing/uninstalling koffice would only install packages needed for running krita, and not the one needed for building it.

ok try this:
1-as bcookley said, install the -dev version of kdelibs.
2-run "sudo apt-get build-dep koffice-kde4", it will install the dependencies needed to build krita.

I just remembered this nice tutorial at http://wiki.koffice.org/index.php?title=Building/Building_KOffice, actually, it's probably even better than mine :p
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
( 4 hours later on trying various combinaison with Synaptic and the librairies, reinstalling Karmic 2 times cause the librairies always installed me many unwanted things ; I'm back with another new karmic system, ready to try the clean way.)

On a clean system :

What working for now :
Code: Select all
sudo apt-get install kdelibs5-dev


What doesnt work :
Code: Select all
user@user-desktop ~ $ sudo apt-get build-dep koffice-kde4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: You must put some 'source' URIs in your sources.list


So , I'm still at the step 1.1.
Thanks if you can help me. :)

Here is what I tryed this afternoon :
- Bypass this not working things and continue the process , a lot of missing dependencies return error with "cmake". I tryed to install dependencies one by one according to the error message using Synaptic, but it resulted in Synaptic install me koffice or koffice for KDE4 , and Krita , Karbon. I can't remove them after... or one by one. I want to have a clean way to do it.


Johannes
Registered Member
Posts
5
Karma
0
You get that error message because apparently, you haven't enabled the source package repository in Synaptic. To do so, go to Synaptic->Settings->Repositories and check "Source code".
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Thanks Josim,
I added the source repositories, now I have this when I enter the code line :

Code: Select all
user@user-desktop ~/Desktop $ sudo apt-get build-dep koffice-kde4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to find a source package for koffice2


User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
That might be because koffice2 is in a ppa -- try following the instructions at http://www.kubuntu.org/news/koffice-2-beta, then it should work.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
What I meant is, you need to have a repository that contains koffice2 for the "sudo apt-get build-dep koffice-kde4" command to work -- you don't need to install koffice2, of course.
User avatar
LukasT.dev
KDE Developer
Posts
209
Karma
1
OS
Other possibility is to install the packages manually.
Krita has these dependencies:
http://wiki.koffice.org/index.php?title ... dependency

You need to know the names of the packages in your distro and usually add -devel or -dev suffix so that development version is installed.


Daylight is coming...
Krita developer | http://lukast.mediablog.sk/log
Johannes
Registered Member
Posts
5
Karma
0
So to get the source-code packages, you would need to add both of these lines, not only the first:

Code: Select all
deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu intrepid main
deb-src http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu intrepid main


You can add these lines in Synaptic->Settings->Repositories->Other Software->"Add..."
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Hey many thanks all for help. I found a way to get all further step working. I edited my first post to write all the precise steps to do it on a karmic system. I hope it will help other peoples.
Now, I will play with and give feedback when I will be sure to understand the software.


Johannes
Registered Member
Posts
5
Karma
0
Ugh, at the end of step two, there's no need to restart your computer :-) A simple "source ~/.bashrc" will do. (It will execute .bashrc and set e.g. environment variables accordingly).

//EDIT
Also, in the last step, I would make clear that the two lines are two separate commands. Plus, with the environment variables set in your .bashrc, you don't need to enter the full path of the krita executable, entering "krita" is enough.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
Yay! Looking forward to your input!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]