Compile KPhotoAlbum: Difference between revisions

From KDE UserBase Wiki
(First draft of howto compile kphotoalbum from source codes)
 
(Headers)
Line 1: Line 1:
Compiling latest Git version of KPhotoAlbum on Ubuntu / Debian
This howto will tell you the steps required to pull, compile and install the GIT version of [[KPhotoAlbum]] in Ubuntu/Debian.
 
This will allow you to test all the latest features that have not been published in the official releases or have not reached your distribution yet.
 
==Summary==
===First build===
{{Input|1=<nowiki>
#First backup all your precious files!!
sudo apt-get install build-essential git
sudo apt-get build-dep kphotoalbum
sudo apt-get install kipi-plugins mplayerthumbs libjpeg8-dev khelpcenter4
git clone git://anongit.kde.org/kphotoalbum
cd kphotoalbum
mkdir build ; cd build
cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=Release ..
make
make install #use sudo in front if needed </nowiki>}}
 
===Updating===
{{Input|1=<nowiki>cd ~/kphotoalbum
git pull
make install #use sudo in front if needed</nowiki>}}
 
===Running===
{{Input|1=<nowiki>~/kphotoalbum/script/kpa-backup.sh --backup
~/kphotoalbum/bin/kphotoalbum</nowiki>}}


==Backup==
BY USING GIT VERSION YOU RISK LOOSING YOUR DATA.
IT SHOULDN'T HAPPEN BUT YOU NEVER KNOW. SO DO BACKUP YOUR FILES (come on, at least the index.xml) FIRST!
YOU'VE BEEN WARNED!


Create backup directory
mkdir kpa-backup


Backup your settings:
cp -a ~/.kde/share/apps/kphotoalbum/kphotoalbumui.rc kpa-backup/
cp -a ~/.kde/share/config/kphotoalbumrc kpa-backup/


And if you want to try KPhotoalbum with your real database (not the demo):
Backup your database:
cp -a /path/to/your/image/folder/index.html kpa-backup/
cp -a /path/to/your/image/folder/exif-info.db kpa-backup/


Backup the layout of your Annotation dialog:
cp -a /path/to/your/image/folder/layout.dat kpa-backup/


Note: there is also a backup script provided in KPhotoAlbum sources. You can just simply run it after the sources have been fetched (source/script/kpa-backup.sh):
kpa-backup.sh --backup
kpa-backup.sh --restore


==Build==
==Build==
Line 31: Line 38:


Install required build tools:
Install required build tools:
sudo apt-get install git build-essential
{{Input|1=<nowiki>sudo apt-get install git build-essential</nowiki>}}


Install required packages to build:
Install required packages to build:
sudo apt-get build-dep kphotoalbum
{{Input|1=<nowiki>sudo apt-get build-dep kphotoalbum</nowiki>}}


OPTIONAL BUT RECOMMENDED: Install other dependencies:
OPTIONAL BUT RECOMMENDED: Install other dependencies:
sudo apt-get install kipi-plugins mplayerthumbs libjpeg8-dev khelpcenter4  
{{Input|1=<nowiki>sudo apt-get install kipi-plugins mplayerthumbs libjpeg8-dev khelpcenter4</nowiki>}}
(I'm not sure if libjpeg is needed, its in the build dependencies, see http://ftp.de.debian.org/debian/pool/main/k/kphotoalbum/kphotoalbum_4.1.1-4.debian.tar.gz)
(not sure if libjpeg is needed, its in the build dependencies, see http://ftp.de.debian.org/debian/pool/main/k/kphotoalbum/kphotoalbum_4.1.1-4.debian.tar.gz)


===Fetching source code===
===Fetching source code===
Clone the Git repository:
Clone the Git repository:
git clone git://anongit.kde.org/kphotoalbum.git
{{Input|1=<nowiki>git clone git://anongit.kde.org/kphotoalbum.git</nowiki>}}
 
===Backup===
By using the laster GIT versions of KPhotoAlbum you risk losing your precious files. It shouldn't happen but you never know. This would now be an excellent time to run the backups - you've just downloaded a script to backup the KPhotoAlbum config files for you so keep reading! Your photos you already have backed up, right...?
 
====Backup script====
KPhotoalbum source code has a backup script included. You can just simply run it after the sources have been fetched (script/kpa-backup.sh):
{{Input|1=<nowiki>(script/kpa-backup.sh --backup
script/kpa-backup.sh --restore</nowiki>}}
 
====Manual backup====
Create backup directory
{{Input|1=<nowiki>mkdir kpa-backup</nowiki>}}
 
Backup your settings:
{{Input|1=<nowiki>cp -a ~/.kde/share/apps/kphotoalbum/kphotoalbumui.rc kpa-backup/
cp -a ~/.kde/share/config/kphotoalbumrc kpa-backup/</nowiki>}}
 
And if you want to try KPhotoalbum with your real database (not the demo):
Backup your database:
{{Input|1=<nowiki>cp -a /path/to/your/image/folder/index.html kpa-backup/
cp -a /path/to/your/image/folder/exif-info.db kpa-backup/</nowiki>}}
 
Backup the layout of your Annotation dialog:
{{Input|1=<nowiki>cp -a /path/to/your/image/folder/layout.dat kpa-backup/</nowiki>}}
 


===Building===
===Building===
Move to the created directory
Move to the created directory
cd kphotoalbum
{{Input|1=<nowiki>cd kphotoalbum</nowiki>}}


Create a build-directory (so you don't mess up you source directory)
Create a build-directory (so you don't mess up you source directory)
mkdir build ; cd build
{{Input|1=<nowiki>mkdir build ; cd build</nowiki>}}


Run cmake  to configure the build system
Run cmake  to configure the build system
cmake .. [to install to the default directory]
{{Input|1=<nowiki>cmake .. </nowiki>}}[to install to the default directory]
OR
OR
cmake -DCMAKE_INSTALL_PREFIX=/path/for/my/kphotoalbum/installation .. [to install to a custom directory]
{{Input|1=<nowiki>cmake -DCMAKE_INSTALL_PREFIX=/path/for/my/kphotoalbum/installation .. </nowiki>}}[to install to a custom directory]
OR
OR
cmake -DCMAKE_BUILD_TYPE=relwithdebuginfo .. [to make the debug build that will output plenty of debug messages to help track crashes etc]
{{Input|1=<nowiki>cmake -DCMAKE_BUILD_TYPE=relwithdebuginfo .. </nowiki>}}[to make the debug build that will output plenty of debug messages to help track crashes etc]
OR combine the options:
OR combine the options:
cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
{{Input|1=<nowiki>cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=RelWithDebInfo ..</nowiki>}}


See the messages. In this stage you'll be told if you have missing dependencies. Do fix them (try to find the missing packages from the package repositories) before continuing.
See the messages. In this stage you'll be told if you have missing dependencies. Do fix them (try to find the missing packages from the package repositories) before continuing.


Run make:
Run make:
make
{{Input|1=<nowiki>make</nowiki>}}


===Installing===
===Installing===
Run installation(optional):
Run installation(optional):
make install
{{Input|1=<nowiki>make install</nowiki>}}
or if the installation path is not writable by your user:
or if the installation path is not writable by your user:
sudo make install
{{Input|1=<nowiki>sudo make install</nowiki>}}


===Running===
===Running===
Line 79: Line 111:
If you installed to a non-standard directory, you have two options:
If you installed to a non-standard directory, you have two options:
1a) Start KPhotoAlbum from the directory where it was installed:
1a) Start KPhotoAlbum from the directory where it was installed:
/path/for/my/kphotoalbum/installation/kphotoalbum
{{Input|1=<nowiki>/path/for/my/kphotoalbum/installation/kphotoalbum</nowiki>}}
OR
OR
1b) add the following line to /home/username/.bashrc so you can start KPhotoAlbum from anywhere:
1b) add the following line to /home/username/.bashrc so you can start KPhotoAlbum from anywhere:
export KDEDIRS=/path/for/my/kphotoalbum/installation
{{Input|1=<nowiki>export KDEDIRS=/path/for/my/kphotoalbum/installation</nowiki>}}
Restart your terminal (so that .bashrc gets executed)
Restart your terminal (so that .bashrc gets executed)


2)Start KPhotoAlbum:
2)Start KPhotoAlbum:
kphotoalbum
{{Input|1=<nowiki>kphotoalbum</nowiki>}}


It's always a good idea to first try out things with the demo-database. Just add "--demo" when starting KPhotoalbum:
It's always a good idea to first try out things with the demo-database. Just add "--demo" when starting KPhotoalbum:
kphotoalbum --demo
{{Input|1=<nowiki>kphotoalbum --demo</nowiki>}}




Line 95: Line 127:
===Refetching sources===
===Refetching sources===
In the kphotoalbum Git folder, pull the changes:
In the kphotoalbum Git folder, pull the changes:
git pull
{{Input|1=<nowiki>git pull</nowiki>}}


If you want to see what has changed  try git log or qgit for graphical user interface
If you want to see what has changed  try git log or qgit for graphical user interface


===Rebuilding===
===Rebuilding===
You normally don't have to run cmake again -- it will be invoked by the makefiles, if neccessary. Otherwise follow BUILDING.
You normally don't have to run cmake again -- it will be invoked by the makefiles, if neccessary. Otherwise follow [[#Building]]


===Reinstalling===
===Reinstalling===
Follow instruction at [[#installing]]
Follow the instructions at [[#Installing]]


===RUNNING===
===RUNNING===
Follow instruction at [[#Running]]
Follow instruction at [[#Running]]
==Summary==
===First build===
sudo apt-get build-essential build-dep kphotoalbum
sudo apt-get install git libjpeg8-dev
sudo apt-get install kipi-plugins mplayerthumbs libjpeg8-dev khelpcenter4
git clone git://anongit.kde.org/kphotoalbum
cd kphotoalbum
mkdir build ; cd build
cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=Release ..
make install
===Updating===
cd ~/kphotoalbum
git pull
make install
===Running===
~/kphotoalbum/script/kpa-backup.sh --backup
~/kphotoalbum/bin/kphotoalbum

Revision as of 19:23, 26 April 2014

This howto will tell you the steps required to pull, compile and install the GIT version of KPhotoAlbum in Ubuntu/Debian.

This will allow you to test all the latest features that have not been published in the official releases or have not reached your distribution yet.

Summary

First build

#First backup all your precious files!!
sudo apt-get install build-essential git
sudo apt-get build-dep kphotoalbum
sudo apt-get install kipi-plugins mplayerthumbs libjpeg8-dev khelpcenter4 
git clone git://anongit.kde.org/kphotoalbum
cd kphotoalbum
mkdir build ; cd build
cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=Release ..
make
make install #use sudo in front if needed 

Updating

cd ~/kphotoalbum
git pull
make install #use sudo in front if needed

Running

~/kphotoalbum/script/kpa-backup.sh --backup
~/kphotoalbum/bin/kphotoalbum




Build

Build dependencies

If you've had KPhotoAlbum installed earlier from repositories, the Git KPhotoAlbum will use the same setting files as the earlier version. If you want to be able to use the previous version after installing this, please do install to custom directory, not the default one.

Install required build tools:

sudo apt-get install git build-essential

Install required packages to build:

sudo apt-get build-dep kphotoalbum

OPTIONAL BUT RECOMMENDED: Install other dependencies:

sudo apt-get install kipi-plugins mplayerthumbs libjpeg8-dev khelpcenter4

(not sure if libjpeg is needed, its in the build dependencies, see http://ftp.de.debian.org/debian/pool/main/k/kphotoalbum/kphotoalbum_4.1.1-4.debian.tar.gz)

Fetching source code

Clone the Git repository:

git clone git://anongit.kde.org/kphotoalbum.git

Backup

By using the laster GIT versions of KPhotoAlbum you risk losing your precious files. It shouldn't happen but you never know. This would now be an excellent time to run the backups - you've just downloaded a script to backup the KPhotoAlbum config files for you so keep reading! Your photos you already have backed up, right...?

Backup script

KPhotoalbum source code has a backup script included. You can just simply run it after the sources have been fetched (script/kpa-backup.sh):

(script/kpa-backup.sh --backup
script/kpa-backup.sh --restore

Manual backup

Create backup directory

mkdir kpa-backup

Backup your settings:

cp -a ~/.kde/share/apps/kphotoalbum/kphotoalbumui.rc kpa-backup/
cp -a ~/.kde/share/config/kphotoalbumrc kpa-backup/

And if you want to try KPhotoalbum with your real database (not the demo): Backup your database:

cp -a /path/to/your/image/folder/index.html kpa-backup/
cp -a /path/to/your/image/folder/exif-info.db kpa-backup/

Backup the layout of your Annotation dialog:

cp -a /path/to/your/image/folder/layout.dat kpa-backup/


Building

Move to the created directory

cd kphotoalbum

Create a build-directory (so you don't mess up you source directory)

mkdir build ; cd build

Run cmake to configure the build system

cmake .. 

[to install to the default directory]

OR

cmake -DCMAKE_INSTALL_PREFIX=/path/for/my/kphotoalbum/installation .. 

[to install to a custom directory]

OR

cmake -DCMAKE_BUILD_TYPE=relwithdebuginfo .. 

[to make the debug build that will output plenty of debug messages to help track crashes etc]

OR combine the options:

cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=RelWithDebInfo ..

See the messages. In this stage you'll be told if you have missing dependencies. Do fix them (try to find the missing packages from the package repositories) before continuing.

Run make:

make

Installing

Run installation(optional):

make install

or if the installation path is not writable by your user:

sudo make install

Running

A handy feature of the cmake build-system is that it builds binaries in such a way that you can start them from within the build system. This certainly handy for quickly testing a new version of KPhotoalbum without touching anything else on your system. However, be aware that some features depend on hard-coded paths (e.g. menu-entries, Handbook, HTML Exports, Demo) and may not work as expected. These features will still use the files installed by the distributions version of KPhotoAlbum. You can just try out KPhotoalbum without installation first, and install later on (see 2.4), if you decide so.

If you installed to a non-standard directory, you have two options: 1a) Start KPhotoAlbum from the directory where it was installed:

/path/for/my/kphotoalbum/installation/kphotoalbum

OR 1b) add the following line to /home/username/.bashrc so you can start KPhotoAlbum from anywhere:

export KDEDIRS=/path/for/my/kphotoalbum/installation

Restart your terminal (so that .bashrc gets executed)

2)Start KPhotoAlbum:

kphotoalbum

It's always a good idea to first try out things with the demo-database. Just add "--demo" when starting KPhotoalbum:

kphotoalbum --demo


Rebuild

Refetching sources

In the kphotoalbum Git folder, pull the changes:

git pull

If you want to see what has changed try git log or qgit for graphical user interface

Rebuilding

You normally don't have to run cmake again -- it will be invoked by the makefiles, if neccessary. Otherwise follow #Building

Reinstalling

Follow the instructions at #Installing

RUNNING

Follow instruction at #Running