16 soname = "phonon4qt5";
17 buildsystemdir = "share/cmake/${soname}";
20 stdenv.mkDerivation rec {
25 homepage = "https://community.kde.org/Phonon";
26 description = "Multimedia API for Qt";
27 mainProgram = "phononsettings";
28 license = lib.licenses.lgpl2;
29 platforms = lib.platforms.unix;
30 maintainers = with lib.maintainers; [ ttuegel ];
34 url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz";
35 sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl";
52 outputs = [ "out" "dev" ];
54 env.NIX_CFLAGS_COMPILE = toString ([
56 ] ++ lib.optionals stdenv.cc.isClang [
57 "-Wno-error=enum-constexpr-conversion"
60 cmakeBuildType = if debug then "Debug" else "Release";
62 dontWrapQtApps = true;
65 cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs"
66 cmakeFlags+=" -DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix"
67 cmakeFlags+=" -DPHONON_QT_PLUGIN_INSTALL_DIR=''${!outputBin}/$qtPluginPrefix/designer"
71 sed -i PhononConfig.cmake.in \
72 -e "/get_filename_component(rootDir/ s/^.*$//" \
73 -e "/^set(PHONON_INCLUDE_DIR/ s|\''${rootDir}/||" \
74 -e "/^set(PHONON_LIBRARY_DIR/ s|\''${rootDir}/||" \
75 -e "/^set(PHONON_BUILDSYSTEM_DIR/ s|\''${rootDir}|''${!outputDev}|"
77 sed -i cmake/FindPhononInternal.cmake \
78 -e "/set(INCLUDE_INSTALL_DIR/ c set(INCLUDE_INSTALL_DIR \"''${!outputDev}/include\")"
80 sed -i cmake/FindPhononInternal.cmake \
81 -e "/set(PLUGIN_INSTALL_DIR/ c set(PLUGIN_INSTALL_DIR \"$qtPluginPrefix/..\")"
83 sed -i CMakeLists.txt \
84 -e "/set(BUILDSYSTEM_INSTALL_DIR/ c set(BUILDSYSTEM_INSTALL_DIR \"''${!outputDev}/${buildsystemdir}\")"
88 sed -i "''${!outputDev}/lib/pkgconfig/${soname}.pc" \
89 -e "/^exec_prefix=/ c exec_prefix=''${!outputBin}/bin"