Building KPhotoAlbum: Difference between revisions

From KDE Wiki Sandbox
(update bin path in "summary")
(Review information)
Line 35: Line 35:




==Build==
==Full instructions==
===Build dependencies===
===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've had KPhotoAlbum installed earlier from repositories, the Git KPhotoAlbum will use the same setting files as the earlier version.
Line 56: Line 56:
Clone the Git repository:
Clone the Git repository:
{{Input|1=<nowiki>git clone git://anongit.kde.org/kphotoalbum.git</nowiki>}}
{{Input|1=<nowiki>git clone git://anongit.kde.org/kphotoalbum.git</nowiki>}}
===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):
{{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 ~/.local/share/kphotoalbum/kphotoalbumui.rc kpa-backup/
cp -a ~/.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===
Line 92: Line 67:
{{Input|1=<nowiki>cmake .. </nowiki>}}[to install to the default directory]
{{Input|1=<nowiki>cmake .. </nowiki>}}[to install to the default directory]
OR
OR
{{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=/YOUR_INSTALL_PREFIX .. </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=/YOUR_INSTALL_PREFIX -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:
{{Input|1=<nowiki>make</nowiki>}}
OR
on a reasonably modern system, parallel builds can speed up compilation quite a lot. E.g. to build using 4 processors, you can write:
{{Input|1=<nowiki>make -j=4</nowiki>}}
{{Input|1=<nowiki>make -j=4</nowiki>}}
This uses up to 4 processes to build kphotoalbum. On a modern system you may want to increase the number. If you want  to use a single process only, simply omit the "-j=4" entirely.


===Installing===
===Installing===
Line 111: Line 84:
or if the installation path is not writable by your user:
or if the installation path is not writable by your user:
{{Input|1=<nowiki>sudo make install</nowiki>}}
{{Input|1=<nowiki>sudo make install</nowiki>}}
If the install directory that you chose is not in your search path, your system won't find kphotoalbum on its own, or it may find a packaged version of kphotoalbum instead. To verify your installation, run:
{{Input|1=<nowiki>which kphotoalbum</nowiki>}}
The output should start with the install prefix that you chose earlier.
If it does not match, you have to add the installation directory (/YOUR_INSTALL_PREFIX/bin) to your search path, or type the full path of the executable file.
Under most shells, you can add a directory to your search path using this command:
{{Input|1=<nowiki>export PATH="/YOUR_INSTALL_PREFIX/bin:$PATH"</nowiki>}}
===Back up your files===
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...?
To backup your database and configuration files, run:
{{Input|1=<nowiki>kpa-backup --backup</nowiki>}}
Complete backup instructions can be found under [[#Backup]]


===Running===
===Running===
Line 131: Line 120:
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:
{{Input|1=<nowiki>kphotoalbum --demo</nowiki>}}
{{Input|1=<nowiki>kphotoalbum --demo</nowiki>}}
===Rebuild / Update===
In the kphotoalbum git directory, execute:
{{Input|1=<nowiki>git pull
cd build
make -j4
make install
</nowiki>}}
If you want to see what has changed  try git log or qgit for graphical user interface.
If you upgraded your system and the build fails afterwards, it can often help to delete the build directory (no need to delete the source directory) and run the instructions under [[#Building]] again.


===Hints & Tips===
===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.
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.


==Backup==
This text assumes that you already back up your image files (disk failures happen).
When playing with an experimental version of kphotoalbum, you may also want to backup your image database and other files that are needed by kphotoalbum.
===Backup script===
KPhotoalbum source code has a backup script included.
{{Input|1=<nowiki>kpa-backup.sh --backup
kpa-backup.sh --restore</nowiki>}}


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


If you want to see what has changed  try git log or qgit for graphical user interface
If the backup script is not included in an old installation of kphotoalbum, you can run the backup script directly from the source directory:
{{Input|1=<nowiki>script/kpa-backup.sh --backup
script/kpa-backup.sh --restore</nowiki>}}


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


===Reinstalling===
===Manual backup===
Follow the instructions at [[#Installing]]
Create backup directory
{{Input|1=<nowiki>mkdir kpa-backup</nowiki>}}


===RUNNING===
Backup your settings:
Follow instruction at [[#Running]]
{{Input|1=<nowiki>cp -a ~/.local/share/kphotoalbum/kphotoalbumui.rc kpa-backup/
cp -a ~/.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>}}

Revision as of 18:23, 11 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 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

Updating

cd ~/kphotoalbum
git pull
make install

Running

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




Full instructions

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 cmake extra-cmake-modules kio-dev pkg-config pkg-kde-tools

Install required packages to build:

sudo apt-get install libexiv2-dev libjpeg-dev libkf5archive-dev libkf5config-dev libkf5coreaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5jobwidgets-dev libkf5kdcraw-dev libkf5kgeomap-dev libkf5kipi-dev libkf5parts-dev libkf5widgetsaddons-dev libmarble-dev libphonon4qt5-dev libphonon4qt5experimental-dev libqt5webkit5-dev qtbase5-dev x11proto-core-dev

OPTIONAL BUT RECOMMENDED: Install other dependencies:

sudo apt-get install kipi-plugins ffmpeg

OPTIONAL and for curious minds: dependencies for experimental features:

sudo apt-get install libkf5kface-dev

You only need this if you want to compile with "ENABLE_PLAYGROUND".

Download the source code

Clone the Git repository:

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

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=/YOUR_INSTALL_PREFIX .. 

[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=/YOUR_INSTALL_PREFIX -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 -j=4

This uses up to 4 processes to build kphotoalbum. On a modern system you may want to increase the number. If you want to use a single process only, simply omit the "-j=4" entirely.

Installing

Run installation(optional):

make install

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

sudo make install

If the install directory that you chose is not in your search path, your system won't find kphotoalbum on its own, or it may find a packaged version of kphotoalbum instead. To verify your installation, run:

which kphotoalbum

The output should start with the install prefix that you chose earlier. If it does not match, you have to add the installation directory (/YOUR_INSTALL_PREFIX/bin) to your search path, or type the full path of the executable file.

Under most shells, you can add a directory to your search path using this command:

export PATH="/YOUR_INSTALL_PREFIX/bin:$PATH"

Back up your files

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...?

To backup your database and configuration files, run:

kpa-backup --backup

Complete backup instructions can be found under #Backup

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 / Update

In the kphotoalbum git directory, execute:

git pull
cd build
make -j4
make install

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

If you upgraded your system and the build fails afterwards, it can often help to delete the build directory (no need to delete the source directory) and run the instructions under #Building again.

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.

Backup

This text assumes that you already back up your image files (disk failures happen). When playing with an experimental version of kphotoalbum, you may also want to backup your image database and other files that are needed by kphotoalbum.

Backup script

KPhotoalbum source code has a backup script included.

kpa-backup.sh --backup
kpa-backup.sh --restore


If the backup script is not included in an old installation of kphotoalbum, you can run the backup script directly from the source directory:

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/