aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/phonon
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2016-04-20 10:15:10 -0500
committerThomas Tuegel <ttuegel@gmail.com>2016-04-20 10:15:10 -0500
commit3ecbb214b6c0f0571c5742357f80e2d11c2c5935 (patch)
tree12c4a0aef158f05128187679e6d9afe3c14b8f7a /pkgs/development/libraries/phonon
parent76d2a1cbb6d6fe23ec0a27880d987cf08d07a109 (diff)
phonon: fix evaluation error
Diffstat (limited to 'pkgs/development/libraries/phonon')
-rw-r--r--pkgs/development/libraries/phonon/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix
new file mode 100644
index 000000000000..3c731ca19e32
--- /dev/null
+++ b/pkgs/development/libraries/phonon/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, cmake, mesa, pkgconfig, libpulseaudio
+, qt4 ? null, automoc4 ? null
+, qtbase ? null, qtquick1 ? null, qttools ? null
+, debug ? false }:
+
+with stdenv.lib;
+
+let
+ v = "4.8.3";
+ withQt5 = qtbase != null;
+in
+
+assert withQt5 -> qtquick1 != null;
+assert withQt5 -> qttools != null;
+assert !withQt5 -> automoc4 != null;
+
+stdenv.mkDerivation rec {
+ name = "phonon-${v}";
+
+ meta = {
+ homepage = http://phonon.kde.org/;
+ description = "Multimedia API for Qt";
+ license = stdenv.lib.licenses.lgpl2;
+ platforms = stdenv.lib.platforms.linux;
+ maintainers = with stdenv.lib.maintainers; [ ttuegel ];
+ };
+
+ src = fetchurl {
+ url = "mirror://kde/stable/phonon/${v}/src/phonon-${v}.tar.xz";
+ sha256 = "05nshngk03ln90vsjz44dx8al576f4vd5fvhs1l0jmx13jb9q551";
+ };
+
+ buildInputs =
+ [ mesa libpulseaudio ]
+ ++ (if withQt5 then [ qtbase qtquick1 qttools ] else [ qt4 ]);
+
+ nativeBuildInputs =
+ [ cmake pkgconfig ]
+ ++ optional (!withQt5) automoc4;
+
+ NIX_CFLAGS_COMPILE = "-fPIC";
+
+ cmakeFlags =
+ [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
+ ++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON";
+
+ postPatch = ''
+ sed -i PhononConfig.cmake.in \
+ -e "/get_filename_component(rootDir/ s/^.*$//" \
+ -e "s,\\(set(PHONON_INCLUDE_DIR\\).*$,\\1 \"''${!outputDev}/include\")," \
+ -e "s,\\(set(PHONON_LIBRARY_DIR\\).*$,\\1 \"''${!outputLib}/lib\")," \
+ -e "s,\\(set(PHONON_BUILDSYSTEM_DIR\\).*$,\\1 \"''${!outputDev}/share/phonon${if withQt5 then "4qt5" else ""}/buildsystem\"),"
+ '';
+}