diff options
author | Thomas Tuegel <ttuegel@mailbox.org> | 2017-10-11 18:28:07 -0500 |
---|---|---|
committer | Thomas Tuegel <ttuegel@mailbox.org> | 2017-10-11 18:28:07 -0500 |
commit | bf37ecac6aae2caa657ad8f8ded1935b7d2c160c (patch) | |
tree | 7fe27b1cf15d897d299aa8bd18c11bad2bec3f0e /pkgs/development/libraries | |
parent | 3fe7cddc304abb86e61a750a4f807270c7ca7825 (diff) |
phonon: set paths for multiple outputs
phonon was not set up for multiple outputs; in fact, some of the single-output paths were incorrect, such as the path to install Qt 5 plugins.
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r-- | pkgs/development/libraries/phonon/default.nix | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix index 171acea90b343..2cb2dde33f7e3 100644 --- a/pkgs/development/libraries/phonon/default.nix +++ b/pkgs/development/libraries/phonon/default.nix @@ -7,6 +7,9 @@ with lib; let v = "4.9.1"; + + soname = if withQt5 then "phonon4qt5" else "phonon"; + buildsystemdir = "share/cmake/${soname}"; in assert withQt5 -> qtbase != null; @@ -36,17 +39,41 @@ stdenv.mkDerivation rec { [ cmake pkgconfig ] ++ optional withQt5 extra-cmake-modules; + outputs = [ "out" "dev" ]; + NIX_CFLAGS_COMPILE = "-fPIC"; cmakeFlags = [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ] ++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON"; + 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" + ''; + postPatch = '' sed -i PhononConfig.cmake.in \ -e "/get_filename_component(rootDir/ s/^.*$//" \ - -e "/^set(PHONON_INCLUDE_DIR/ s,\''${rootDir},''${!outputDev}," \ - -e "/^set(PHONON_LIBRARY_DIR/ s,\''${rootDir}/,," \ - -e "/^set(PHONON_BUILDSYSTEM_DIR/ s,\''${rootDir},''${!outputDev}," + -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" ''; } |