2015-03-15 13:55:32 +00:00
|
|
|
{ stdenv, fetchurl, automoc4, boost, shared_desktop_ontologies, cmake
|
|
|
|
, eigen, lcms, gettext, jasper, kdelibs, kdepimlibs, lensfun
|
|
|
|
, libgphoto2, libjpeg, libkdcraw, libkexiv2, libkipi, libpgf, libtiff
|
2015-09-27 16:11:01 +01:00
|
|
|
, libusb1, liblqr1, marble, mysql, opencv, perl, phonon, pkgconfig
|
|
|
|
, qca2, qimageblitz, qjson, qt4, soprano
|
2015-10-04 01:07:00 +01:00
|
|
|
|
|
|
|
# Optional build time dependencies
|
|
|
|
, baloo, doxygen, kfilemetadata
|
|
|
|
, lcms2
|
|
|
|
, kfaceSupport ? true, libkface ? null
|
|
|
|
, kgeomapSupport ? true, libkgeomap ? null
|
|
|
|
, libxslt
|
|
|
|
|
|
|
|
# Plugins optional build time dependencies
|
|
|
|
, gdk_pixbuf, imagemagick
|
|
|
|
, libgpod, libksane, libkvkontakte
|
|
|
|
, qt_gstreamer1 /*qt_soap, <https://github.com/commontk/QtSOAP> herqq <http://www.herqq.org> -> is missing its av part.*/
|
|
|
|
/*qt_koauth <http://gitorious.org/kqoauth>*/
|
|
|
|
|
|
|
|
# Supplementary packages required only by the wrapper.
|
|
|
|
, bash, kde_runtime, kde_baseapps, makeWrapper, oxygen_icons
|
|
|
|
, phonon_backend_vlc /*phonon_backend_gstreamer,*/
|
|
|
|
, ffmpegthumbs /*mplayerthumbs*/
|
|
|
|
, runCommand, shared_mime_info, writeScriptBin
|
2015-03-15 13:55:32 +00:00
|
|
|
}:
|
2010-02-10 15:06:50 +00:00
|
|
|
|
2015-10-04 01:07:00 +01:00
|
|
|
let
|
|
|
|
version = "4.12.0";
|
|
|
|
pName = "digikam-${version}";
|
|
|
|
|
|
|
|
build = stdenv.mkDerivation rec {
|
|
|
|
name = "digikam-build-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://download.kde.org/stable/digikam/${pName}.tar.bz2";
|
|
|
|
sha256 = "081ldsaf3frf5khznjd3sxkjmi4dyp6w6nqnc2a0agkk0kxkl10m";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
automoc4 cmake gettext perl pkgconfig
|
|
|
|
] ++ [
|
|
|
|
# Optional
|
|
|
|
doxygen
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost eigen jasper kdelibs kdepimlibs lcms lensfun
|
|
|
|
libgphoto2 libjpeg libkdcraw libkexiv2 libkipi liblqr1 libpgf
|
|
|
|
libtiff marble mysql.lib opencv phonon qca2 qimageblitz qjson qt4
|
|
|
|
shared_desktop_ontologies soprano ]
|
|
|
|
# Optional build time dependencies
|
|
|
|
++ [
|
|
|
|
baloo
|
|
|
|
kfilemetadata
|
|
|
|
lcms2 ]
|
|
|
|
++ stdenv.lib.optional (kfaceSupport && null != libkface) [ libkface ]
|
|
|
|
++ stdenv.lib.optional (kgeomapSupport && null != libkgeomap) [ libkgeomap ] ++
|
|
|
|
[ libxslt ]
|
|
|
|
# Plugins optional build time dependencies
|
|
|
|
++ [
|
|
|
|
gdk_pixbuf imagemagick libgpod libksane
|
|
|
|
libkvkontakte
|
|
|
|
qt_gstreamer1 ];
|
|
|
|
|
|
|
|
# Make digikam find some FindXXXX.cmake
|
|
|
|
KDEDIRS="${marble}:${qjson}";
|
|
|
|
|
|
|
|
# Find kdepimlibs's upper case headers under `include/KDE`.
|
|
|
|
NIX_CFLAGS_COMPILE = "-I${kdepimlibs}/include/KDE";
|
|
|
|
|
|
|
|
# Help digiKam find libusb, otherwise gphoto2 support is disabled
|
|
|
|
cmakeFlags = [
|
2016-04-01 09:06:01 +01:00
|
|
|
"-DLIBUSB_LIBRARIES=${libusb1.out}/lib"
|
2015-10-04 01:07:00 +01:00
|
|
|
"-DLIBUSB_INCLUDE_DIR=${libusb1}/include/libusb-1.0"
|
|
|
|
"-DENABLE_BALOOSUPPORT=ON"
|
|
|
|
"-DENABLE_KDEPIMLIBSSUPPORT=ON"
|
|
|
|
"-DENABLE_LCMS2=ON" ]
|
|
|
|
++ stdenv.lib.optional (kfaceSupport && null == libkface) [ "-DDIGIKAMSC_COMPILE_LIBKFACE=ON" ]
|
|
|
|
++ stdenv.lib.optional (kgeomapSupport && null == libkgeomap) [ "-DDIGIKAMSC_COMPILE_LIBKGEOMAP=ON" ];
|
2010-02-10 15:06:50 +00:00
|
|
|
|
2015-10-04 01:07:00 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Photo Management Program";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
homepage = http://www.digikam.org;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ goibhniu viric urkud ];
|
|
|
|
inherit (kdelibs.meta) platforms;
|
|
|
|
};
|
2010-02-10 15:06:50 +00:00
|
|
|
};
|
|
|
|
|
2010-10-05 18:44:05 +01:00
|
|
|
|
2015-10-04 01:07:00 +01:00
|
|
|
kdePkgs = [
|
|
|
|
build # digikam's own build
|
|
|
|
kdelibs kdepimlibs kde_runtime kde_baseapps libkdcraw oxygen_icons
|
|
|
|
/*phonon_backend_gstreamer*/ phonon_backend_vlc
|
|
|
|
ffmpegthumbs /*mplayerthumbs*/ shared_mime_info ]
|
|
|
|
# Optional build time dependencies
|
|
|
|
++ [
|
|
|
|
|
|
|
|
baloo kfilemetadata ]
|
|
|
|
++ stdenv.lib.optional (kfaceSupport && null != libkface) [ libkface ]
|
|
|
|
++ stdenv.lib.optional (kgeomapSupport && null != libkgeomap) [ libkgeomap ]
|
|
|
|
++ [
|
|
|
|
libkipi ]
|
|
|
|
# Plugins optional build time dependencies
|
|
|
|
++ [
|
|
|
|
libksane libkvkontakte
|
2015-03-15 13:55:32 +00:00
|
|
|
];
|
2010-10-12 08:49:24 +01:00
|
|
|
|
2012-01-19 20:28:13 +00:00
|
|
|
|
2015-10-04 01:07:00 +01:00
|
|
|
# TODO: It should be the responsability of these packages to add themselves to `KDEDIRS`. See
|
|
|
|
# <https://github.com/ttuegel/nixpkgs/commit/a0efeacc0ef2cf63bbb768bfb172a483307d080b> for
|
|
|
|
# a practical example.
|
|
|
|
# IMPORTANT: Note that using `XDG_DATA_DIRS` here instead of `KDEDIRS` won't work properly.
|
|
|
|
KDEDIRS = with stdenv.lib; concatStrings (intersperse ":" (map (x: "${x}") kdePkgs));
|
|
|
|
|
|
|
|
sycocaDirRelPath = "var/lib/kdesycoca";
|
|
|
|
sycocaFileRelPath = "${sycocaDirRelPath}/${pName}.sycoca";
|
|
|
|
|
|
|
|
sycoca = runCommand "${pName}" {
|
|
|
|
|
|
|
|
name = "digikam-sycoca-${version}";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ kdelibs ];
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
} ''
|
|
|
|
# Make sure kbuildsycoca4 does not attempt to write to user home directory.
|
|
|
|
export HOME=$PWD
|
2015-03-15 13:42:22 +00:00
|
|
|
|
2015-10-04 01:07:00 +01:00
|
|
|
export KDESYCOCA="$out/${sycocaFileRelPath}"
|
|
|
|
|
|
|
|
mkdir -p $out/${sycocaDirRelPath}
|
|
|
|
export XDG_DATA_DIRS=""
|
|
|
|
export KDEDIRS="${KDEDIRS}"
|
|
|
|
kbuildsycoca4 --noincremental --nosignal
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
replaceExeListWithWrapped =
|
|
|
|
let f = exeName: ''
|
|
|
|
rm -f "$out/bin/${exeName}"
|
|
|
|
makeWrapper "${build}/bin/${exeName}" "$out/bin/${exeName}" \
|
|
|
|
--set XDG_DATA_DIRS "" \
|
|
|
|
--set KDEDIRS "${KDEDIRS}" \
|
|
|
|
--set KDESYCOCA "${sycoca}/${sycocaFileRelPath}"
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
with stdenv.lib; exeNameList: concatStrings (intersperse "\n" (map f exeNameList));
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Final derivation
|
|
|
|
----------------
|
|
|
|
|
|
|
|
- Create symlinks to our original build derivation items.
|
|
|
|
- Wrap specific executables so that they know of the appropriate
|
|
|
|
sycoca database, `KDEDIRS` to use and block any interference
|
|
|
|
from `XDG_DATA_DIRS` (only `dnginfo` is not wrapped).
|
|
|
|
*/
|
|
|
|
runCommand "${pName}" {
|
|
|
|
inherit build;
|
|
|
|
inherit sycoca;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = kdePkgs;
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
2013-05-29 18:29:11 +01:00
|
|
|
|
2010-02-10 15:06:50 +00:00
|
|
|
meta = {
|
|
|
|
description = "Photo Management Program";
|
2015-03-15 13:55:32 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2010-02-10 23:38:02 +00:00
|
|
|
homepage = http://www.digikam.org;
|
2015-10-04 01:07:00 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ /*jraygauthier*/ ];
|
2010-10-05 18:44:05 +01:00
|
|
|
inherit (kdelibs.meta) platforms;
|
2010-02-10 15:06:50 +00:00
|
|
|
};
|
2015-10-04 01:07:00 +01:00
|
|
|
|
|
|
|
} ''
|
|
|
|
pushd $build > /dev/null
|
|
|
|
for d in `find . -maxdepth 1 -name "*" -printf "%f\n" | tail -n+2`; do
|
|
|
|
mkdir -p $out/$d
|
|
|
|
for f in `find $d -maxdepth 1 -name "*" -printf "%f\n" | tail -n+2`; do
|
|
|
|
ln -s "$build/$d/$f" "$out/$d/$f"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
popd > /dev/null
|
|
|
|
|
|
|
|
${replaceExeListWithWrapped [ "cleanup_digikamdb" "digitaglinktree" "digikam" "dngconverter"
|
|
|
|
"expoblending" "photolayoutseditor" "scangui" "showfoto" ]}
|
|
|
|
''
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
TODO
|
|
|
|
----
|
|
|
|
|
|
|
|
### Useful ###
|
|
|
|
|
|
|
|
- Per lib `KDELIBS` environment variable export. See above in-code TODO comment.
|
|
|
|
- Missing optional `qt_soap` or `herqq` (av + normal package) dependencies. Those are not
|
|
|
|
yet (or not fully) packaged in nix. Mainly required for upnp export.
|
|
|
|
- Possibility to use the `phonon_backend_gstreamer` with its own user specified set of backend.
|
|
|
|
- Allow user to disable optional features or dependencies reacting properly.
|
|
|
|
- Compile `kipiplugins` as a separate package (so that it can be used by other kde packages
|
|
|
|
and so that this package's build time is reduced).
|
|
|
|
|
|
|
|
### Not so useful ###
|
|
|
|
|
|
|
|
- Missing optional `qt_koauth` (not packaged in nix).
|
|
|
|
- Missing optional `libmediawiki` (not packaged in nix)..
|
|
|
|
- For some reason the cmake build does not detect `libkvkontakte`. Fix this.
|
|
|
|
- Possibility to use `mplayerthumbs` thumbnail creator backend. In digikam dev docs,
|
|
|
|
it is however suggested to use `ffmpegthumbs`. Maybe we should stick to it.
|
|
|
|
|
|
|
|
*/
|