Sunday, June 12, 2016

Building Krita 3.0 from sources on Linux Mint 18

This guide focuses on getting Krita build on a fresh Linux Mint 18 setup, is based on David Revoy's "Building Krita 3.0 on Linux for cats", which helped me a lot to do my first build.


Before you start, you need to install a few things if you have a "Fresh Mint" setup :3

NOTE: Make sure you enable source code repositories first before you start or you will run into errors:

Go to: Software Manager Edit->Software Sources->Official repositories->Source code->(Check)Enable source code repositories

1.1.General stuff

You can't start without git, g++ and cmake, also included ffmpeg because it will be needed to export video for animation.

Run this:
sudo apt-get update
sudo apt-get install git
sudo apt-get install g++

sudo apt-get install cmake
sudo apt-get install cmake-extras extra-cmake-modules

sudo apt-get install ffmpeg chromium-codecs-ffmpeg ffmpegthumbs libavresample-dev libpostproc-dev libxine2-ffmpeg libavutil-dev libswresample-dev

sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby

You need Qt to build Krita, if you download the installer, make sure you select everything for that version, the normal install is missing some modules that Krita needs. Get Qt here.

At the bottom I'm including a section to build Qt from sources (Section 5) if you are adventurous, I builded it from sources myself because I wanted the latest 5.6.1 version, and also because I'm a geek :)

1.3.Qt dependencies
If you decide to build Qt from sources you should install the following dependencies (it won't hurt if you install them anyway, didn't test if some of this is needed to build Krita also):

Run this:
sudo apt-get build-dep qt5-default

sudo apt install yaz-icu libghc-text-icu-prof libghc-text-icu-dev icu-devtools python-pyicu libxcb-xinerama0-dev

sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libcap-dev libxtst-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libxss-dev libegl1-mesa-dev

sudo apt-get install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

1.4.Krita dependencies
Run this:
sudo apt-get build-dep krita

sudo apt-get install libeigen3-dev libxi-dev phonon-backend-gstreamer kdelibs5-dev libboost-dev libboost-all-dev exiv2

sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libcurl4-nss-dev
sudo apt-get install libcurl4-gnutls-dev

sudo apt-get install libgrss0 libgrss-dev libpoppler-qt5-1 libpoppler-qt5-dev libraw-dev

sudo apt-get install kdelibs5-data kdelibs5-plugins
sudo apt-get install libkf5*-dev

2.Setup directories

I differ a little from David's guide because I'm building more stuff and its best to have all in one place.

2.1.The directory structure

The top directory of the setup will be "Mybuilds", this is where all the sources and builds will be.

Create all the directories:

For Krita:
/home/{your-user-name}/Mybuilds/krita/build   (It's where all the intermediate stuff will be when building)

/home/{your-user-name}/Mybuilds/krita/extras   (Place for additional modules that need to be build by source)

/home/{your-user-name}/Mybuilds/krita/inst   (It's where the Krita binaries will be placed)

/home/{your-user-name}/Mybuilds/krita/src   (All Krita source code will be here)

For Qt(only if you are building from sources):
/home/{your-user-name}/Mybuilds/qt5   (Where Qt base components will be)

/home/{your-user-name}/Mybuilds/qt-creator   (Where Qt Creator IDE will be installed)

/home/{your-user-name}/Mybuilds/qt-creator-build   (This is needed to properly build Qt Creator)

Note : understand as your user name on this documentation ( Ex :  /home/deevad/krita/src )

2.2.Create all the directories

For Krita:
mkdir -p  ~/Mybuilds/krita/build
mkdir -p  ~/Mybuilds/krita/extras
mkdir -p  ~/Mybuilds/krita/inst
mkdir -p  ~/Mybuilds/krita/src

For Qt(Only if you are building it from sources):
mkdir -p  ~/Mybuilds/qt5
mkdir -p  ~/Mybuilds/qt-creator
mkdir -p  ~/Mybuilds/qt-creator-build

3.Building Krita from sources

Linux Mint 18 comes with everything you need to build Krita without problem, all libraries are up to date, also using recent KDE 5, you just have to install it.

3.1.The directories

As I mentioned at the beginning, this are the directories we are going to create  for Krita if you haven't created them already:

Run this:
mkdir -p  ~/Mybuilds/krita/build   (It's where all the intermediate stuff will be when building)
mkdir -p  ~/Mybuilds/krita/extras   (Place for additional modules that need to be build by source)
mkdir -p  ~/Mybuilds/krita/inst   (It's where the Krita binaries will be placed)
mkdir -p  ~/Mybuilds/krita/src   (All Krita source code will be here)

3.2.Getting Krita sources

There are 4 places places were you can get the krita code: (for looking at code) ( mirror)
git:// (fesh)(The normal way of getting krita)
ssh:// (push)(If you are a developer you can upload your changes here)

Run this:
cd ~/Mybuilds/krita
git clone git:// src

After this all your source files will be downloaded to ~/Mybuilds/krita/src

3.3.Installing dependencies

Besides the dependecies listed at the top of this guide for Krita you will need to build Vc, since for some reason the pre build for Linux Mint was not being detected by cmake.

3.3.1.Building Vc from sources

This is needed for vectors or something.... the prebuild version doesn't contain the headers Krita needs so we need to build from sources. (Vc web

Make sure you remove the existing library (in case it's already installed) before you continue:

sudo apt-get remove vc-dev

Download, configure and build Vc:
Run this:
cd ~/Mybuilds/krita/extras
git clone
cd Vc ; mkdir build ; cd build

make -j4
sudo make install

This thing gets installed in /opt/Vc so you're good to go.

3.4.Configure sources

Run this:
cd ~/Mybuilds/krita/build

Sometimes you run into unexpected problems, and you need to debug but the problem "outscrolls" your terminal, so I'm logging the output to cmake_output.log if you need to debug an issue.

So after this, a bunch of files get created in ~/Mybuilds/krita/build and you are ready to start building Krita.

3.5.Building Krita

NOTE: Before we start, adding the "-jN" to make means that will use more than one core in your processor, I recommend this because it will take less time. If you don't know the number of cores in your machine, you can use the following command to get them:

cat /proc/cpuinfo | grep processor | wc -l

Mine is 4, so will use -j4:
make -j4

3.6.Installing Krita (At last)


make install -j4

This also takes a while but after it finishes all your binaries should be in  ~/Mybuilds/krita/inst, now the only thing left to do is to make Krita visible to the system.

Congratulations!, you have successfully build Krita from sources.

3.7.Making Krita visible to the system

Edit "~/.bashrc" again and add the following lines:

# For Krita setup

3.8.First run

Finally you can open a terminal and run krita.

$ krita

3.9.Doing cleanup (optional)

It's a good practice to do housekeeping and clear any leftover packages running this commands, it's not necessary but like to do it:

sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get purge

4.Updating your Krita to the latest version

You've heard of a new feature developed, or you read about an annoying bug fixed, and want to update ?

Fine, call git again. This time it will only append to your source folder the missing code lines. Not downloading the whole source pack.

4.1.Updating source repository

Run this:
cd ~/Mybuilds/krita/src/
git pull

4.2.Configure and building

Run this:
cd ~/Mybuilds/krita/build

make -j4
make install -j4


Recent development version might break, and sometime be unusable. Experimental changes are made daily.

It might affect your productivity if you don't know how to 'go back in time' ( ex: your favorite brush doesn't work anymore ).

But If you know how to do it, no issue can really affect you, because you know how to come back to a previous state.

5.1.Reverting to a working version

To travel the source in time we need to read the timeline history. The Terminal tool for it is git log

Run this:
cd ~/Mybuilds/krita/src/
git log

With git log , you can consult all the last changes to the code, named 'commit' . What interest us is the long identification number ( ex: cca5819b19e0da3434192c5b352285b987a48796 ). You can scroll git log , copy the ID number then quit ( letter Q on keyboard ). Then time-travel your source directory

Run this:
git checkout cca5819b19e0da3434192c5b352285b987a48796

Now, configure, compile, and you'll be again in a safe place. Note that I advice the packages gitg or gitk to have a graphic user interface to visualise git history. Also an online version exist here.

5.2.Configure and building

Run this:
cd ~/Mybuilds/krita/build

make -j4
make install -j4

5.3.Returning to master branch

To update again to the actual and fresh from a minute ago source-code named master , simply ask git to come back to it with git checkout  then  pull to update

Run this:
git checkout master
git pull

6.Building Qt from sources

To have a full Qt setup, you need to build 3 things, the Qt components, the IDE (Qt Creator), and the documentation.

For more information on Qt setup go to:
Qt base:
Qt Creator:
Qt Documentation:

6.1. Building Qt base components from sources

6.1.1.Download sources and prepare the repository

Run this:
cd ~/Mybuilds
git clone git://
cd qt5
git checkout 5.6.1

6.1.2.Configure and building

Run this:
./configure -developer-build -opensource -no-gtkstyle -confirm-license

make -j4

Go grab snack or a cup of coffee, because its going to take a while, and if everything goes well you will end up with all your binaries inside ~/Mybuilds/qt5/qtbase/bin

6.1.3.Making your Qt setup visible to the system

Now that we have our bins, we need to tell Mint where to find them, there are several ways to do this but I found this one the easiest:

Edit the hidden file in your home "~/.bashrc" and add this lines at the bottom:

# For Qt base

Now run this for it to pick up the changes:
source ~/.bashrc

You now have Qt base installed, now we need to install the IDE (Qt Creator)

6.2.Building Qt Creator from sources

You should have everything you need by now to build this.

6.2.1.Download Qt Creator sources

Run this:
cd ~/Mybuilds
git clone --recursive
mkdir -p qt-creator-build

6.2.2.Configuring and building

Run this:
cd ~/Mybuilds/qt-creator-build
qmake -r ../qt-creator/
make -j4

There shouldn't be a problem with this one, it's just takes time. After this the binaries for Qt Creator should be in ~/Mybuilds/qt-creator-build/bin

6.2.3.Making Qt Creator visible to the system

Like Qt base, we edit "~/.bashrc" file and add at the bottom the following lines:

# For Qt Creator

And run the following to apply changes:
source ~/.bashrc

Congratulations, now you have the full Qt install.

20160614 - Did some cleanup and added documentation build for Qt
20160615 - Made some content rearrangements/corrections and added Krita code sources

Monday, June 23, 2008

Caramelldansen History (Complete)

This is a complement of my article posted on wikipedia. Most of this information was first posted there, but it was original research and do to the encyclopedic nature of wikipedia, it needed citation, so was removed by other editors. So I decided to put the deleted content in this blog, wich is the result of months of research.

The Song
Supergott Album, released November 2001
Caramelldansen (Swedish for Caramel Dance) is the first track of the album Supergott released in November 2001 by the Swedish music group Caramell.

The Internet Meme
Animation loop from visual novel Popotan, now know as "Caramelldansen"
Caramelldansen is also a popular Internet meme that started on the second half of 2006.

It was first a small fifteen frame Flash animation loop showing Mai and Mii, characters of the Japanese visual novel Popotan (doing a hip swing dance with their hands over their heads imitating rabbit ears), and the chorus of the sped up version of the song "Caramelldansen" sung by Malin and Katia from Swedish music group Caramell. A sped up version of this song was released in early 2006 by DJ Speedycake and was called
"Caramelldansen Speedycake Remix" which started to distribute on the internet almost in parallel with the flash loop. The original Swedish lyrics of the song can found here, and english lyrics here


Before Caramelldansen
Popotan first appeared as a Japanese PC game in December 12, 2002. After the anime was aired from July 17, 2003 to October 2, 2003, small animated GIF clips where captured from the opening of the anime and distributed over the internet.

Some of those clips where modified and turned into small flash loops with sound.
The oldest and most noticeable of those clips is one where Mii is doing a solo dance. This later on became a loop with sound called miidance.swf.

"Mii Dance", first animated flash with sound from Popotan anime
The oldest reference in English found on the internet referring to Popotan game intro was found on animesuki forum in the thread called “Most kawaii intro” created on Nov 14 2003. The discussion started with Popotan anime, others where mentioned too but was till user Anlushac11 said “About the only thing more Kawaii than Popotans intro is Popotan the Game's intro” that this became the first time the game intro was mentioned to be significant.

It was not long before parts from the opening of the PC game were captured and posted on the internet as small GIF animations for people to use. The oldest post found on the Internet so far showing Popotan dance in .gif format was in forum. The thread was called “Anime Animated Gifs [NOT 56K Friendly]”. User “TheMadCountess” made a small post on July 10 2004 with 6 links to different animated gif shorts, and 3 of them where from Popotan:
07-10-2004, 04:57 PM

Popotan dance party!
Mou dame po po po!
Mou dame po po po!

07-10-2004, 10:46 PM
Countess - ^^^ Those are so cute! What are they from?

07-10-2004, 11:13 PM
The first one is from Azumanga Daioh. The first dvd or two of that is out, as well as all 4 books of the manga. The next two are from Nurse Witch Komugi-chan Magikarte!, which is licensed but I don't know the release date. The last three are from Popotan, which is also licensed but I don't know the release date either.

The site and the original files are no longer available at the time I did a revision of this article, but the user who posted it is still around here

January 2 2005
Later on the .gif animation was added music and changed to flash format. The oldest known reference so far is from forum. The thread was called “punks onnozele flash thread” created on January 2 2005, from user “punkfreak” posting his flash collection. The first known animated flash loop with sound from Popotan PC intro was called “Walk this Way”, file named walkway.swf was 1.3Mb, which included the song “Walk this way” by Aerosmith and Run DMC.

November 2 2005
In November 2 2005, user Andeh posted another flash version of the Popotan animation, this one including song Wakalaka, making it the second most oldest known version of the Popotan animation with sound. This flash was called "Popotan dance 2".

"Sexy Bunny Dance", first custom Popotan Flash
Around November 2005 and May 2006 user Funzo released his own version of the Popotan flash, this one originally named “Sexy Bunny Dance” was the first known custom made flash animation with sound derived from the Popotan animation loop. This version shows ID3 and IDK, demon characters that belong to an artist called Dokuro, and the song "Dare" by the virtual band Gorillaz. This flash was originally posted on sheezyart, but was later removed by its own author do to personal reasons. The flash can still be found in some flash archives and on youtube by the name of "Lizard Girl Dance"

In April 16 2006, user animegirl000 posted a custom made gif animation without sound called "Axel and Roxas dance"

After Caramelldansen

The original Carameldansen flash loop was composed by Sven from Sweden at the first half on 2006 and originally posted on his personal website, but later reposted on internet community 4chan, which was here where its popularity started.

As I contacted him by mail he told me how it all started:

Can you tell me how this idea was put together and where did you post it first?
"The gif-animation was, if I remember correctly, taken from /gif/ at 4chan. I tried some different tracks, found the song that I thought was appropriate, fiddled a bit in Audacity and added it to my page along with all the other loops. And as I wrote on Wikipedia, I didn't know the loop had started such a meme until just a couple of months ago, which took me totally by surprise. As I added the loop to /f/ on 4chan at the same time I added it to my page, there is a big chance that the majority of views and spread is thanks to 4chan."
Did you use the sped up version of the Caramell song made by Speedycake or it’s just coincidence it came out almost at the same time?
"About the song, I had the full album of Caramell in my music collection (where I got it from the beginning I don't really remember, but a qualified guess would be that I got it from a friend through a LAN/filesharing-gathering). I had never heard of the Speedycake-remix until I read the Wikipedia entry."
"Well the loop turned out a little over the top, very "cute" and very "japanish", which made it look like something that actually could have originated from Japan (in my own opinion anyway). I then added "ANIME LOL!" (actually reads "ANIME LOL KAWAII ^_^" now, since I had to rewrite the whole site thanks to a server crash a while back) as the title of the page, to give it even more "over the top" feeling. That the loop became popular, especially in Japan, I find quite ironic. :)"
Have you had any interviews asking about this?
"Regarding media interviews, I don't really think there is much more to the "story", but of course if there is any interest I'm willing to answer their questions. But for now I don't think the media care too much for the original story. :p"
Caramelldansen Speedycake Remix
By this time, DJ Speedycake was releasing the sped up version of the "Caramelldansen" song, quite a coincidence that it came out almost at the same time as Sven's flash loop. This is the story of the mix told by Speedycake himself:

Where does your name come from?
"The name comes from my normal internet alias and then tacking on speedy in front of it after a few live mix sessions that mostly were in the 150+ BPM range. I thought it was suitable at the time. The place where I started my net broadcasts was the first incarnation of #/b/radio located at the Rizon IRC network"
When did you released the sped up song and where did you post it first?
"The song was created on an accidental mixing mistake where I was transitioning the song, completely neglecting to check the BPM difference and turning on the key pitch lock. So when it came for me to start the track, well it was squeaky and high pitched. After the broadcast I had several requests for the song, however the song didn't really exist in the form that I mixed it in so I released it under the same sped up conditions and posted it on the /b/radio BBS (4chan). From there the song spread onto 4chan's /flash/ board from which it was almost a daily thing for people to request what song it was and a link to download it which I supplied"

"Caramelldansen Speedycake Remix" was released in early 2006 and posted originally on 4chan too.
Thats where it started to distribute on the internet. Most of the followup versions of the flash meme used this song to make their versions.

So, after the second half of 2006, Caramelldansen spread on the Internet in Flash archives and popular communities such as Hongfire and 4chan. Caramelldansen was also referred first as the "Popotan Dance" or "Popotan Dansen". After 2008 is more known by its popularity in Japan as "Uma uma dance".

August 8 2006
One of the oldest post of the Caramelldansen flash found was in the popular anime community Post date was August 8 2006 by user npdcb. After contacting him, told me that he didn’t remember exactly where he got the flash from, but was probably in 4chan or animesuki.

"Cyborg CaramellDansen" (March 23 2007)
Later in March 23 2007, another custom made caramell flash appeared. Created by Veertje and originally posted in, this flash was called "Cyborg CaramellDansen" and included characters from 60’s anime Cyborg 009. She saw the original flash on and decided to make her own version. That webpage no longer exists but I manage to get a cached version from google.

"Midnatt Boxer Rave Dansen" (April 11th 2007)
In April 11th 2007, another customade flash animation based on the original Caramelldansen was released, called by it's author Devvo the "Midnatt Boxer Rave Dansen" (more know this days as "Dota furry dance", "Dota dance" or just Dota) was released first on Not sure if this version could be considered part of the Caramelldansen family of flashes, because it uses a different song, a speedup version of the Swedish song called "Vi sitter i Ventrilo och spelar dota" by Basshunter. The reason I mention it is because of the popularity it had on the internet. The characters on this flash are Ritts the raccoon and Devvo the cat.

"Caramell Chu" (June 24 2007)
On June 24 2007, was released my version of this meme and posted it originally on, called it "Caramel Chu", was inspired first on the Dota flash and later on the original Caramelldansen flash. Had a decent amouth of views and was the start of many followups flases on the deviantart community before they where all removed(included mine) because of copyright issues. The flash was reposted on March 07 2008 with a different song so it won't get removed again. Posted this also on youtube and newgrounds.

Many more versions of the flash came out after, but it wasn’t till early 2008 that was noticed an increasing amount of versions on youtube[1][2]. The links on some of the videos took me to Japanese video sharing site Nico Nico Douga. Was here where the real boom of this meme started.

Video Documental about Caramelldansen in Japan ("Uma uma Boom")

External Links - The official page for umauma single and album
Myspace - The Unofficial Caramell page
Myspace - DJ's Vasco & Millboy Page
Myspace - DJ Speedycake page - About Caramell discography - Caramell Dansen Video Collection Site
Animesuki Forums - Collection of Caramelldansen versions

Thursday, June 5, 2008

Installing and configuring OpenSim on Fedora (from sources)

This installation was made on a Fedora Core 5 Linux (Updated 08/28/2009).

- Make installed
- gcc compiler installed
- libgdiplus installed
- svn(Subversion) installed

Make sure you have make and gcc compiler installed in your system, you will need that for building mono from sources. My installation path for mono and nant will be /opt. For the Fedora I tried installing and using the mono version from the normal yum repository but that version of mono and nant just didn't work, so we will have do download latest stable sources and build them.

Sources from:

1. Download mono sources and build - Get the latest mono source (as writing this its 1.9.1):
# cd /opt
# wget
# bunzip2 mono-1.9.1.tar.bz2 ; tar -xvf mono-1.9.1.tar

# cd mono-1.9.1
# ./configure --prefix=/opt/mono
# make ; make install

# vi /etc/profile

Add the folling lines:

# For mono install path
export PATH=/opt/mono/bin:$PATH
export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH
export MANPATH=/opt/mono/share/man:$MANPATH
export LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH

If you run into problems for
libgdiplus and you already have it installed, its best to uninstall and download the latest version and build it yourself. Follow same steps as compiling mono.

Close and reopen your terminal for the changes to take effect.

2. Download Nant sources and Build Nant:
# cd /opt
# wget
# gunzip nant-0.86-beta1-src.tar.gz ; tar -xvf nant-0.86-beta1-src.tar

# make install prefix=/opt/nant

Edit "/etc/profile":
# vi /etc/profile

Add the folling lines:
# For Nant install path
export PATH=/opt/nant/bin:$PATH

Close and reopen your terminar for the changes to take effect

3. Download OpenSim sources and Build - I tried using the prebuild version of OpenSim for Linux, but was just to buggy, a lot of things didn't work, that why we are
#svn co opensim

#cd opensim

4. Configuration and Run
Your configuration depends on what you want, I personally choose to use MySQL database instead of default mssql, but I will explain that later.

If you are impatient aand want to use the defaults, you can just make a copy of OpenSim.ini.example to OpenSim.ini and you are al set to run.

The binaries of your build should be in opensim/bin:

#cd /opt/opensim/bin
#cp OpenSim.ini.example OpenSim.ini

#mono OpenSim.exe

If everything goes ok the terminal should throw a lot of colored text till it gets to the server prompt and will ask you a few things the first time. I assume this is a run on standalone mode, for further configuration options for grid mode refer to the OpenSim page.

The first set of prompts that start with "NETWORK SERVERS INFO", you can just hit return to accept the defaults if you will be running in standalone mode. The prompts that start with "DEFAULT REGION CONFIG" are where you need to start paying attention. Some are self-explanatory. Here are explanations for the others:
  • Grid Location - OpenSim regions can be placed anywhere on a 65536 by 65536 grid. In standalone mode, it is safe to leave these X and Y locations at their defaults.
  • Filename for local storage - Safe to leave at default.
  • Internal IP address - This should always be
  • Internal IP port for incoming UDP client connection - You can make this any port you want, but it is safe to leave at the default 9000.
  • External host name - If you have the server and the client on the same box, use default if you are running the server and the client on the same box, but if the server is in a remote box you should put the IP or hostname of the remote box. I prefer IP.
After that you will get a Region #: prompt, that means that you're done. Now the only thing left is to configure your secondlife client so it can connect to your server. Just make a copy of your access icon and go to properties and add this to the command line switches:

-loginuri -loginpage

Then start your Secondlife client as you normally do. If everything goes ok you should log whit the defaul female av on a circle island.

Ok, now you have played with your server and all, but now you want others to be able to log in with you and join.

There are some things you need to do. First make sure you have ports tcp/udp 9000 open in your ruoter and firewall.

If your Secondlife server is running on a remote box, this is how to open ports (Fedora):
Configuring firewall:
Edit /etc/sysconfig/iptables

Example(this opens port 9000):
# For OpenSim
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 9000 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9000 -j ACCEPT

To restart firewall:
# service iptables restart

Then you need to get your IP and put it in your region configuration. To make it easier I just deleted opensim/Region/default.xml and when you start your server it should ask again all the info for the region but warning, what I did was delete the region file, and I don't know if content you already made goes with it too so, its better to edit that file by hand and replace with your IP.

Next you need to create additional accounts for your friends, at the server prompt type:
create user

It should ask you the info for the new account