Slackware Current Update Breaks digikam

More than a week ago or so, there is a huge update on Slackware current which was mostly due to the KDE 4.8.2 release and its friends likde QT. After a successful upgrade, I noticed a thread regarding digikam being broken due to this update. Haven’t used digikam but when I tried to, I’m greeted with an error on the console (of course to see the error, run digikam on the console) that says that libkipi is not found or something.

Backtracking

So now, my most important tool for importing photos from my camera is not working. I search back on the updates from the ChangeLog.txt and found out that there are updates on libkipi library. This makes me think that I need to re-compile digikam’s dependency kipi-plugins. However, I have no luck and search around the forum instead.

Going digikam 2.6.0 beta instead

My current digikam version is still at good old 1.9.0. I have read a good post regarding the latest digikam 2.6.0 beta is working Slackware current with few tweaks. Actually, you can find it on the comments. So I tried downloading it and tried to compile using SlackBuild script he provided.

Dependencies, dependencies

To recap, what we are trying to install is the new digikam 2.6.0 beta. You may download the digikam beta on sourceforge. But wait, there is a new dependency for the new digikam.

The following are the dependencies for the digikam.

As you’ve noticed, kipi-plugins is now included in the source for 2.6.0 beta. However, a new dependency qjson is now added, therefore we need to install it first. I use sbopkg to install it and it installs seamlessly.

As to my surprise, digikam 2.6.0 doesn’t compile. It complains about opencv which is not currently installed in my machine. When I tried to install opencv, it again complains about ffmpeg. Such a dependency hell. My ffmpeg is currently at version 0.8.7 and I have to upgrade it to the latest 0.10.2. You can use the current ffmpeg SlackBuild script but use the new source code for ffmpeg 0.10.2.

To recap again, we do the following.

  • Install qjson
  • Upgrade ffmpeg to 0.10.2 – currently the latest
  • Install opencv 2.3.1a

OpenCV by the way is an optional dependency for ffmpeg. And ffmpeg is a runtine dependency for OpenCV. Therefore, install ffmpeg without OpenCV before installing OpenCV. Then later if you really wanted to, install ffmpeg with OpenCV support (I didn’t do that by the way). And oh, ffmpeg complains about the missing file TODO. What I did was extract the bz2 tarball, add an empty TODO file to the location the error specified, then compressed it again into a tag.bz2 archive replacing the original source. I don’t know why it happens though.

Compiling finally

Now that all the dependencies are in place, we are now ready to compile digikam 2.6.0 beta (currently beta 3). First, we need to have the digikam 2.6.0 beta source code, grab it at SourceForge. Next, we need a SlackBuild script. I found the SlackBuild script here at willysr’s blog.

Here is the script, the one I used and I’m not sure if this is the one willysr has modified or if this is the original script.

#!/bin/sh

# Slackware build script for digiKam

# Copyright 2007-2011  Frank Caraballo <fecaraballo{at}gmail{dot}com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=digikam
VERSION=${VERSION:-2.6.0-beta3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac                                                                                                                                                        
fi                                                                                                                                                            
                                                                                                                                                              
CWD=$(pwd)                                                                                                                                                    
TMP=${TMP:-/tmp/SBo}                                                                                                                                          
PKG=$TMP/package-$PRGNAM                                                                                                                                      
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
else
  SLKCFLAGS="-O2"
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

mkdir -p build
cd build
  cmake \
    -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
    -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIB_SUFFIX=$(kde4-config --libsuffix) \
    -DMAN_INSTALL_DIR=/usr/man \
    -DSYSCONF_INSTALL_DIR=/etc/kde \
    -DCMAKE_BUILD_TYPE=Release ..
  make
  make install DESTDIR=$PKG
cd ..

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  NEWS README \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

We compile it like this.

./digikam.SlackBuild

Then upgrade using the compiled package usually lands in /tmp directory.

Now that’s it. When digikam hits stable, I only have to upgrade to it.

[UPDATE]: I have noticed that in digikam 2.6.0 beta3, when I tried to import photos from my camera by selecting few photos, using the usual “Download” button in the import window now downloads every photos in the camera. I have to use the context menu instead to download only specific set of photos. Bad.

Enjoy.

This entry was posted in Linux, Slackware and tagged , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>