python312Packages.icontract: relax deps (#380554)
[NixPkgs.git] / pkgs / development / libraries / phonon / backends / gstreamer.nix
blob9b4579318d976af8d322a8b716ca13f04d719910
2   stdenv,
3   lib,
4   fetchurl,
5   fetchpatch,
6   cmake,
7   gst_all_1,
8   phonon,
9   pkg-config,
10   extra-cmake-modules,
11   qttools,
12   qtbase,
13   qtx11extras,
14   debug ? false,
17 stdenv.mkDerivation rec {
18   pname = "phonon-backend-gstreamer";
19   version = "4.10.0";
21   src = fetchurl {
22     url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
23     sha256 = "1wk1ip2w7fkh65zk6rilj314dna0hgsv2xhjmpr5w08xa8sii1y5";
24   };
26   patches = [
27     # Hardcode paths to useful plugins so the backend doesn't depend
28     # on system paths being set.
29     ./gst-plugin-paths.patch
31     # Work around https://bugs.kde.org/show_bug.cgi?id=445196 until a new release.
32     (fetchpatch {
33       url = "https://invent.kde.org/libraries/phonon-gstreamer/-/commit/bbbb160f30a394655cff9398d17961142388b0f2.patch";
34       sha256 = "sha256-tNBqVt67LNb9SQogS9ol8/xYIZvVSoVUgXQahMfkFh8=";
35     })
36   ];
38   dontWrapQtApps = true;
40   env.NIX_CFLAGS_COMPILE =
41     let
42       gstPluginPaths = lib.makeSearchPathOutput "lib" "/lib/gstreamer-1.0" (
43         with gst_all_1;
44         [
45           gstreamer
46           gst-plugins-base
47           gst-plugins-good
48           gst-plugins-ugly
49           gst-plugins-bad
50           gst-libav
51         ]
52       );
53     in
54     toString [
55       # This flag should be picked up through pkg-config, but it isn't.
56       "-I${gst_all_1.gstreamer.dev}/lib/gstreamer-1.0/include"
58       ''-DGST_PLUGIN_PATH_1_0="${gstPluginPaths}"''
59     ];
61   buildInputs = with gst_all_1; [
62     gstreamer
63     gst-plugins-base
64     phonon
65     qtbase
66     qtx11extras
67   ];
69   nativeBuildInputs = [
70     cmake
71     pkg-config
72     extra-cmake-modules
73     qttools
74   ];
76   cmakeBuildType = if debug then "Debug" else "Release";
78   meta = with lib; {
79     homepage = "https://phonon.kde.org/";
80     description = "GStreamer backend for Phonon";
81     platforms = platforms.linux;
82     maintainers = with maintainers; [ ttuegel ];
83     license = licenses.lgpl21;
84   };