Building KPhotoAlbum: Difference between revisions

From KDE UserBase Wiki
(add disclaimer regarding kf5)
(Update forKPhotoAlbum 5.x)
Line 1: Line 1:
'''This howto was not yet updated for KDE Frameworks.'''
This howto will tell you the steps required to pull, build and install the GIT version of [[KPhotoAlbum]] in Ubuntu/Debian.
This howto will tell you the steps required to pull, build 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.
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. Alternatively, you may want to check out the nightly built [https://neon.kde.org Neon] packages for kphotoalbum.


==Summary==
==Summary==
Line 11: Line 9:
{{Input|1=<nowiki>
{{Input|1=<nowiki>
sudo apt-get install build-essential git
sudo apt-get install build-essential git
sudo apt-get build-dep kphotoalbum
sudo apt-get install cmake extra-cmake-modules kio-dev pkg-config pkg-kde-tools
sudo apt-get install kipi-plugins libjpeg8-dev khelpcenter4 mplayer2 libqt4-sql-sqlite
sudo apt-get install libexiv2-dev libjpeg-dev libkf5archive-dev libkf5config-dev libkf5coreaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5jobwidgets-dev libkf5kdcraw-dev libkf5kface-dev libkf5kgeomap-dev libkf5kipi-dev libkf5parts-dev libkf5widgetsaddons-dev libmarble-dev libphonon4qt5-dev libphonon4qt5experimental-dev libqt5webkit5-dev qtbase5-dev x11proto-core-dev
sudo apt-get install kipi-plugins ffmpeg


git clone git://anongit.kde.org/kphotoalbum
git clone git://anongit.kde.org/kphotoalbum
cd kphotoalbum
cd kphotoalbum
mkdir build ; cd build
mkdir build ; cd build
cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=Release ..
cmake -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make
make
make install #use sudo in front if needed </nowiki>}}
make install #use sudo in front if needed </nowiki>}}
Line 48: Line 47:


OPTIONAL BUT RECOMMENDED: Install other dependencies:
OPTIONAL BUT RECOMMENDED: Install other dependencies:
{{Input|1=<nowiki>sudo apt-get install kipi-plugins libjpeg8-dev khelpcenter4 mplayer2 libqt4-sql-sqlite</nowiki>}}
{{Input|1=<nowiki>sudo apt-get install kipi-plugins ffmpeg khelpcenter</nowiki>}}
(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===
Line 56: Line 54:


===Backup===
===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...?
By using the latest 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====
====Backup script====
Line 68: Line 66:


Backup your settings:
Backup your settings:
{{Input|1=<nowiki>cp -a ~/.kde/share/apps/kphotoalbum/kphotoalbumui.rc kpa-backup/
{{Input|1=<nowiki>cp -a ~/.local/share/kphotoalbum/kphotoalbumui.rc kpa-backup/
cp -a ~/.kde/share/config/kphotoalbumrc kpa-backup/</nowiki>}}
cp -a ~/.config/kphotoalbumrc kpa-backup/</nowiki>}}


And if you want to try KPhotoalbum with your real database (not the demo):
And if you want to try KPhotoalbum with your real database (not the demo):
Line 92: Line 90:
{{Input|1=<nowiki>cmake -DCMAKE_INSTALL_PREFIX=/path/for/my/kphotoalbum/installation .. </nowiki>}}[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
{{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]
{{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:
{{Input|1=<nowiki>cmake -DCMAKE_INSTALL_PREFIX=~/kphotoalbum -DCMAKE_BUILD_TYPE=RelWithDebInfo ..</nowiki>}}
{{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.
If the cmake fails e.g. in recent Ubuntu, try something like:
{{input|1=<nowiki>cmake -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4 -DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix) .. </nowiki>}}


Run make:
Run make:
Line 133: Line 128:
See http://kphotoalbum.org/index.php?page=compile for some more info on KIPI plugins, EXIF and video thumbnail support as well as Dutch/French handbook issues and KHelpCenter tips.
See http://kphotoalbum.org/index.php?page=compile for some more info on KIPI plugins, EXIF and video thumbnail support as well as Dutch/French handbook issues and KHelpCenter tips.


The head has been successfully compiled 04/2014 with Kubuntu 12.04.4.
Wip/android branch seems to require newer gcc and compiles OK on Kubuntu 14.04 (gcc-4.8.2). Upgrading gcc on Kubuntu 12.04.4 to 4.8.1 didn't help solving this, so when writing this, wip/android can't be compiled on Kubuntu 12.04.4


==Rebuild==
==Rebuild==
===Refetching sources===
===Updating the source===
In the kphotoalbum Git folder, pull the changes:
In the kphotoalbum Git folder, pull the changes:
{{Input|1=<nowiki>git pull</nowiki>}}
{{Input|1=<nowiki>git pull</nowiki>}}

Revision as of 20:25, 9 December 2016

This howto will tell you the steps required to pull, build 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. Alternatively, you may want to check out the nightly built Neon packages for kphotoalbum.

Summary

First build

Do first backup all your precious files!!

sudo apt-get install build-essential git
sudo apt-get install cmake extra-cmake-modules kio-dev pkg-config pkg-kde-tools
sudo apt-get install libexiv2-dev libjpeg-dev libkf5archive-dev libkf5config-dev libkf5coreaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5jobwidgets-dev libkf5kdcraw-dev libkf5kface-dev libkf5kgeomap-dev libkf5kipi-dev libkf5parts-dev libkf5widgetsaddons-dev libmarble-dev libphonon4qt5-dev libphonon4qt5experimental-dev libqt5webkit5-dev qtbase5-dev x11proto-core-dev
sudo apt-get install kipi-plugins ffmpeg

git clone git://anongit.kde.org/kphotoalbum
cd kphotoalbum
mkdir build ; cd build
cmake -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
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 ffmpeg khelpcenter

Fetching source code

Clone the Git repository:

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

Backup

By using the latest 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 ~/.local/share/kphotoalbum/kphotoalbumui.rc kpa-backup/
cp -a ~/.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

Hints & Tips

See http://kphotoalbum.org/index.php?page=compile for some more info on KIPI plugins, EXIF and video thumbnail support as well as Dutch/French handbook issues and KHelpCenter tips.


Rebuild

Updating the source

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