1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 05:00:16 +00:00

Adding a KDE wrapper, to easily have KDE programs in nix-env.

Specially for those not running KDE.
This commit is contained in:
Lluís Batlle i Rossell 2013-05-09 18:40:29 +00:00
parent e083d32d22
commit 4e7208fe2e
2 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,40 @@
{ stdenv, kde4, shared_mime_info, extraLibs ? [] }:
/* Supply a KDE program, and it will have the necessary KDE vars to
get icons, mime types, etc. working.
For example:
packageOverrides = pkgs : {
kdenliveWrapped = kde4.wrapper kde4.kdenlive;
};
*/
program:
let
libs = with kde4; [ kdelibs kde_runtime oxygen_icons shared_mime_info ] + extra;
in
stdenv.mkDerivation {
name = program.name + "-wrapped";
inherit libs;
buildCommand = ''
ensureDir $out/bin
KDEDIRS=
QT_PLUGIN_PATH=
for a in $libs; do
KDEDIRS=$a''${KDEDIRS:+:}$KDEDIRS
QT_PLUGIN_PATH=$a''${KDEDIRS:+:}$KDEDIRS
done
for a in ${program}/bin/*; do
PROG=$out/bin/`basename $a`
cat > $PROG << END
export KDEDIRS=$KDEDIRS
export QT_PLUGIN_PATH=$KDEDIRS
exec $a "\$@"
END
chmod +x $PROG
done
'';
}

View file

@ -8609,6 +8609,8 @@ let
in kde4 // {
inherit kde4;
wrapper = callPackage ../build-support/kdewrapper {};
recurseForRelease = true;
akunambol = callPackage ../applications/networking/sync/akunambol { };