2019-11-24 12:13:31 +03:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, pkgconfig
|
|
|
|
, libpulseaudio
|
|
|
|
, extra-cmake-modules
|
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, debug ? false
|
|
|
|
}:
|
2016-04-20 18:15:10 +03:00
|
|
|
|
2016-04-21 22:33:04 +03:00
|
|
|
with lib;
|
2016-04-20 18:15:10 +03:00
|
|
|
|
|
|
|
let
|
2019-11-21 23:26:38 +03:00
|
|
|
soname = "phonon4qt5";
|
2017-10-12 02:28:07 +03:00
|
|
|
buildsystemdir = "share/cmake/${soname}";
|
2016-04-20 18:15:10 +03:00
|
|
|
in
|
|
|
|
|
2019-11-21 23:26:38 +03:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "phonon";
|
|
|
|
version = "4.11.1";
|
2016-04-20 18:15:10 +03:00
|
|
|
|
|
|
|
meta = {
|
2017-08-22 21:50:04 +03:00
|
|
|
homepage = https://phonon.kde.org/;
|
2016-04-20 18:15:10 +03:00
|
|
|
description = "Multimedia API for Qt";
|
|
|
|
license = stdenv.lib.licenses.lgpl2;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ ttuegel ];
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-11-21 23:26:38 +03:00
|
|
|
url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz";
|
2019-10-23 06:04:04 +03:00
|
|
|
sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl";
|
2016-04-20 18:15:10 +03:00
|
|
|
};
|
|
|
|
|
2019-11-21 23:26:38 +03:00
|
|
|
buildInputs = [
|
2019-11-24 12:13:31 +03:00
|
|
|
libGLU
|
|
|
|
libGL
|
2019-11-21 23:26:38 +03:00
|
|
|
libpulseaudio
|
|
|
|
qtbase
|
|
|
|
qttools
|
|
|
|
];
|
2016-04-20 18:15:10 +03:00
|
|
|
|
2019-11-21 23:26:38 +03:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkgconfig
|
|
|
|
extra-cmake-modules
|
|
|
|
];
|
2016-04-20 18:15:10 +03:00
|
|
|
|
2017-10-12 02:28:07 +03:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2016-04-20 18:15:10 +03:00
|
|
|
NIX_CFLAGS_COMPILE = "-fPIC";
|
|
|
|
|
2019-11-21 23:26:38 +03:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
|
|
|
|
];
|
2016-04-20 18:15:10 +03:00
|
|
|
|
2017-10-12 02:28:07 +03: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 18:15:10 +03:00
|
|
|
postPatch = ''
|
|
|
|
sed -i PhononConfig.cmake.in \
|
|
|
|
-e "/get_filename_component(rootDir/ s/^.*$//" \
|
2017-10-12 02:28:07 +03: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\")"
|
|
|
|
|
|
|
|
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 18:15:10 +03:00
|
|
|
'';
|
|
|
|
}
|