2016-04-21 21:33:04 +02:00
|
|
|
{ stdenv, lib, fetchurl, cmake, mesa, pkgconfig, libpulseaudio
|
2017-02-26 13:49:15 +01:00
|
|
|
, qt4 ? null, extra-cmake-modules ? null, qtbase ? null, qttools ? null
|
2016-07-29 17:29:41 +02:00
|
|
|
, withQt5 ? false
|
2016-04-20 17:15:10 +02:00
|
|
|
, debug ? false }:
|
|
|
|
|
2016-04-21 21:33:04 +02:00
|
|
|
with lib;
|
2016-04-20 17:15:10 +02:00
|
|
|
|
|
|
|
let
|
2016-04-21 21:33:04 +02:00
|
|
|
v = "4.9.0";
|
2016-04-20 17:15:10 +02:00
|
|
|
in
|
|
|
|
|
2016-04-21 21:33:04 +02:00
|
|
|
assert withQt5 -> qtbase != null;
|
2016-04-20 17:15:10 +02:00
|
|
|
assert withQt5 -> qttools != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-04-21 21:33:04 +02:00
|
|
|
name = "phonon-${if withQt5 then "qt5" else "qt4"}-${v}";
|
2016-04-20 17:15:10 +02:00
|
|
|
|
|
|
|
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 {
|
2016-04-23 16:54:51 +02:00
|
|
|
url = "mirror://kde/stable/phonon/${v}/phonon-${v}.tar.xz";
|
2016-04-21 21:33:04 +02:00
|
|
|
sha256 = "1q5hvsk4sfcb91625wcmldy7kgjmfpmpmkgzi6mxkqdd307v8x5v";
|
2016-04-20 17:15:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ mesa libpulseaudio ]
|
2016-05-11 03:09:15 +02:00
|
|
|
++ (if withQt5 then [ qtbase qttools ] else [ qt4 ]);
|
2016-04-20 17:15:10 +02:00
|
|
|
|
2017-02-26 13:49:15 +01:00
|
|
|
nativeBuildInputs =
|
|
|
|
[ cmake pkgconfig ]
|
|
|
|
++ optional withQt5 extra-cmake-modules;
|
2016-04-20 17:15:10 +02:00
|
|
|
|
|
|
|
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/^.*$//" \
|
2016-04-21 21:33:04 +02:00
|
|
|
-e "/^set(PHONON_INCLUDE_DIR/ s,\''${rootDir},''${!outputDev}," \
|
|
|
|
-e "/^set(PHONON_LIBRARY_DIR/ s,\''${rootDir}/,," \
|
|
|
|
-e "/^set(PHONON_BUILDSYSTEM_DIR/ s,\''${rootDir},''${!outputDev},"
|
2016-04-20 17:15:10 +02:00
|
|
|
'';
|
|
|
|
}
|