2018-02-24 13:12:44 +00:00
|
|
|
{ stdenv, lib, fetchurl, cmake, libGLU_combined, pkgconfig, libpulseaudio
|
2017-02-26 12:49:15 +00:00
|
|
|
, qt4 ? null, extra-cmake-modules ? null, qtbase ? null, qttools ? null
|
2016-07-29 15:29:41 +00:00
|
|
|
, withQt5 ? false
|
2016-04-20 15:15:10 +00:00
|
|
|
, debug ? false }:
|
|
|
|
|
2016-04-21 19:33:04 +00:00
|
|
|
with lib;
|
2016-04-20 15:15:10 +00:00
|
|
|
|
|
|
|
let
|
2017-02-28 16:11:01 +00:00
|
|
|
v = "4.9.1";
|
2017-10-11 23:28:07 +00:00
|
|
|
|
|
|
|
soname = if withQt5 then "phonon4qt5" else "phonon";
|
|
|
|
buildsystemdir = "share/cmake/${soname}";
|
2016-04-20 15:15:10 +00:00
|
|
|
in
|
|
|
|
|
2016-04-21 19:33:04 +00:00
|
|
|
assert withQt5 -> qtbase != null;
|
2016-04-20 15:15:10 +00:00
|
|
|
assert withQt5 -> qttools != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-04-21 19:33:04 +00:00
|
|
|
name = "phonon-${if withQt5 then "qt5" else "qt4"}-${v}";
|
2016-04-20 15:15:10 +00:00
|
|
|
|
|
|
|
meta = {
|
2017-08-22 18:50:04 +00:00
|
|
|
homepage = https://phonon.kde.org/;
|
2016-04-20 15:15:10 +00:00
|
|
|
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 14:54:51 +00:00
|
|
|
url = "mirror://kde/stable/phonon/${v}/phonon-${v}.tar.xz";
|
2017-02-28 16:11:01 +00:00
|
|
|
sha256 = "177647r2jqfm32hqcz2nqfqv6v48hn5ab2vc31svba2wz23fkgk7";
|
2016-04-20 15:15:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
2018-02-24 13:12:44 +00:00
|
|
|
[ libGLU_combined libpulseaudio ]
|
2016-05-11 01:09:15 +00:00
|
|
|
++ (if withQt5 then [ qtbase qttools ] else [ qt4 ]);
|
2016-04-20 15:15:10 +00:00
|
|
|
|
2017-02-26 12:49:15 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
[ cmake pkgconfig ]
|
|
|
|
++ optional withQt5 extra-cmake-modules;
|
2016-04-20 15:15:10 +00:00
|
|
|
|
2017-10-11 23:28:07 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2016-04-20 15:15:10 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-fPIC";
|
|
|
|
|
|
|
|
cmakeFlags =
|
|
|
|
[ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
|
|
|
|
++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON";
|
|
|
|
|
2017-10-11 23:28:07 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs"
|
|
|
|
cmakeFlags+=" -DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix"
|
|
|
|
cmakeFlags+=" -DPHONON_QT_PLUGIN_INSTALL_DIR=''${!outputBin}/$qtPluginPrefix/designer"
|
|
|
|
'';
|
|
|
|
|
2016-04-20 15:15:10 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i PhononConfig.cmake.in \
|
|
|
|
-e "/get_filename_component(rootDir/ s/^.*$//" \
|
2017-10-11 23:28:07 +00:00
|
|
|
-e "/^set(PHONON_INCLUDE_DIR/ s|\''${rootDir}/||" \
|
|
|
|
-e "/^set(PHONON_LIBRARY_DIR/ s|\''${rootDir}/||" \
|
|
|
|
-e "/^set(PHONON_BUILDSYSTEM_DIR/ s|\''${rootDir}|''${!outputDev}|"
|
|
|
|
|
|
|
|
sed -i cmake/FindPhononInternal.cmake \
|
|
|
|
-e "/set(INCLUDE_INSTALL_DIR/ c set(INCLUDE_INSTALL_DIR \"''${!outputDev}/include\")"
|
|
|
|
|
|
|
|
${optionalString withQt5 ''
|
|
|
|
sed -i cmake/FindPhononInternal.cmake \
|
|
|
|
-e "/set(PLUGIN_INSTALL_DIR/ c set(PLUGIN_INSTALL_DIR \"$qtPluginPrefix/..\")"
|
|
|
|
''}
|
|
|
|
|
|
|
|
sed -i CMakeLists.txt \
|
|
|
|
-e "/set(BUILDSYSTEM_INSTALL_DIR/ c set(BUILDSYSTEM_INSTALL_DIR \"''${!outputDev}/${buildsystemdir}\")"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
sed -i "''${!outputDev}/lib/pkgconfig/${soname}.pc" \
|
|
|
|
-e "/^exec_prefix=/ c exec_prefix=''${!outputBin}/bin"
|
2016-04-20 15:15:10 +00:00
|
|
|
'';
|
|
|
|
}
|