nixpkgs/pkgs/development/libraries/phonon/default.nix

91 lines
2.1 KiB
Nix
Raw Normal View History

2019-11-24 09:13:31 +00:00
{ stdenv
, lib
, fetchurl
, cmake
, libGLU
, libGL
, pkg-config
2019-11-24 09:13:31 +00:00
, libpulseaudio
, extra-cmake-modules
, qtbase
, qttools
, debug ? false
}:
2016-04-20 16:15:10 +01:00
with lib;
2016-04-20 16:15:10 +01:00
let
soname = "phonon4qt5";
buildsystemdir = "share/cmake/${soname}";
2016-04-20 16:15:10 +01:00
in
stdenv.mkDerivation rec {
pname = "phonon";
version = "4.11.1";
2016-04-20 16:15:10 +01:00
meta = {
2020-11-13 10:05:56 +00:00
homepage = "https://community.kde.org/Phonon";
2016-04-20 16:15:10 +01:00
description = "Multimedia API for Qt";
license = lib.licenses.lgpl2;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ ttuegel ];
2016-04-20 16:15:10 +01:00
};
src = fetchurl {
url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz";
sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl";
2016-04-20 16:15:10 +01:00
};
buildInputs = [
2019-11-24 09:13:31 +00:00
libGLU
libGL
libpulseaudio
qtbase
qttools
];
2016-04-20 16:15:10 +01:00
nativeBuildInputs = [
cmake
pkg-config
extra-cmake-modules
];
2016-04-20 16:15:10 +01:00
outputs = [ "out" "dev" ];
2016-04-20 16:15:10 +01:00
NIX_CFLAGS_COMPILE = "-fPIC";
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
];
2016-04-20 16:15:10 +01:00
dontWrapQtApps = true;
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 16:15:10 +01:00
postPatch = ''
sed -i PhononConfig.cmake.in \
-e "/get_filename_component(rootDir/ s/^.*$//" \
-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 16:15:10 +01:00
'';
}