1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 cairo,
7 meson,
8 ninja,
9 pkg-config,
10 gstreamer,
11 gst-plugins-base,
12 gst-plugins-bad,
13 gst-rtsp-server,
14 python3,
15 gobject-introspection,
16 rustPlatform,
17 rustc,
18 cargo,
19 json-glib,
20 # Checks meson.is_cross_build(), so even canExecute isn't enough.
21 enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
22 hotdoc,
23 directoryListingUpdater,
24 _experimental-update-script-combinators,
25 common-updater-scripts,
26 apple-sdk_gstreamer,
27}:
28
29stdenv.mkDerivation (finalAttrs: {
30 pname = "gst-devtools";
31 version = "1.26.5";
32
33 outputs = [
34 "out"
35 "dev"
36 ];
37
38 src = fetchurl {
39 url = "https://gstreamer.freedesktop.org/src/gst-devtools/gst-devtools-${finalAttrs.version}.tar.xz";
40 hash = "sha256-Y9Rqjv+ooiXiWkZLp1OKzoU/4NwecDZrJ8IIE15UAc4=";
41 };
42
43 cargoDeps = rustPlatform.fetchCargoVendor {
44 inherit (finalAttrs)
45 src
46 patches
47 cargoRoot
48 ;
49 name = "gst-devtools-${finalAttrs.version}";
50 hash = "sha256-gU+SBvxwmrGiyeKXF3SA2ohIHNTS4ZBC+elB0u1QKRE=";
51 };
52
53 patches = [
54 # dots-viewer: sort static files
55 # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9208
56 (fetchpatch {
57 url = "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/b3099f78775eab1ac19a9e163c0386e01e74b768.patch";
58 stripLen = 2;
59 hash = "sha256-QRHqbZ6slYcwGl+o9Oi4jV+ANMorCED4cQV5qDS74eg=";
60 })
61 ];
62
63 depsBuildBuild = [
64 pkg-config
65 ];
66
67 nativeBuildInputs = [
68 meson
69 ninja
70 pkg-config
71 gobject-introspection
72 rustPlatform.cargoSetupHook
73 rustc
74 cargo
75 ]
76 ++ lib.optionals enableDocumentation [
77 hotdoc
78 ];
79
80 buildInputs = [
81 cairo
82 python3
83 json-glib
84 ]
85 ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
86 apple-sdk_gstreamer
87 ];
88
89 propagatedBuildInputs = [
90 gstreamer
91 gst-plugins-base
92 gst-plugins-bad
93 gst-rtsp-server
94 ];
95
96 mesonFlags = [
97 (lib.mesonEnable "doc" enableDocumentation)
98 ];
99
100 cargoRoot = "dots-viewer";
101
102 passthru = {
103 updateScript =
104 let
105 updateSource = directoryListingUpdater { };
106
107 updateLockfile = {
108 command = [
109 "sh"
110 "-c"
111 ''
112 PATH=${
113 lib.makeBinPath [
114 common-updater-scripts
115 ]
116 }
117 update-source-version gst_all_1.gst-devtools --ignore-same-version --source-key=cargoDeps.vendorStaging > /dev/null
118 ''
119 ];
120 # Experimental feature: do not copy!
121 supportedFeatures = [ "silent" ];
122 };
123 in
124 _experimental-update-script-combinators.sequence [
125 updateSource
126 updateLockfile
127 ];
128 };
129
130 meta = with lib; {
131 description = "Integration testing infrastructure for the GStreamer framework";
132 homepage = "https://gstreamer.freedesktop.org";
133 license = licenses.lgpl2Plus;
134 platforms = platforms.unix;
135 maintainers = [ ];
136 };
137})