nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
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,
15}:
16
17stdenv.mkDerivation rec {
18 pname = "phonon-backend-gstreamer";
19 version = "4.10.0";
20
21 src = fetchurl {
22 url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
23 sha256 = "1wk1ip2w7fkh65zk6rilj314dna0hgsv2xhjmpr5w08xa8sii1y5";
24 };
25
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
30
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 ];
37
38 dontWrapQtApps = true;
39
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"
57
58 ''-DGST_PLUGIN_PATH_1_0="${gstPluginPaths}"''
59 ];
60
61 buildInputs = with gst_all_1; [
62 gstreamer
63 gst-plugins-base
64 phonon
65 qtbase
66 qtx11extras
67 ];
68
69 nativeBuildInputs = [
70 cmake
71 pkg-config
72 extra-cmake-modules
73 qttools
74 ];
75
76 cmakeBuildType = if debug then "Debug" else "Release";
77
78 meta = {
79 homepage = "https://phonon.kde.org/";
80 description = "GStreamer backend for Phonon";
81 platforms = lib.platforms.linux;
82 maintainers = with lib.maintainers; [ ttuegel ];
83 license = lib.licenses.lgpl21;
84 };
85}