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.0";
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-7/M9fcKSuwdKJ4jqiHtigzmP/e+vpJ+30I7+ZlimVkg=";
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-GLxevEwoTgS7kmDlul0AA2wIFRY7js8Ij4UIu1ZQf8I=";
51 };
52
53 patches = [
54 # Fix Requires in gstreamer-validate-1.0.pc
55 # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8661
56 (fetchpatch {
57 url = "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/13c0f44dd546cd058c39f32101a361b3a7746f73.patch";
58 stripLen = 2;
59 hash = "sha256-CpBFTmdn+VO6ZeNe6NZR6ELvakZqQdaF3o3G5TSDuUU=";
60 })
61 # dots-viewer: sort static files
62 # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9208
63 (fetchpatch {
64 url = "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/b3099f78775eab1ac19a9e163c0386e01e74b768.patch";
65 stripLen = 2;
66 hash = "sha256-QRHqbZ6slYcwGl+o9Oi4jV+ANMorCED4cQV5qDS74eg=";
67 })
68 ];
69
70 depsBuildBuild = [
71 pkg-config
72 ];
73
74 nativeBuildInputs = [
75 meson
76 ninja
77 pkg-config
78 gobject-introspection
79 rustPlatform.cargoSetupHook
80 rustc
81 cargo
82 ]
83 ++ lib.optionals enableDocumentation [
84 hotdoc
85 ];
86
87 buildInputs = [
88 cairo
89 python3
90 json-glib
91 ]
92 ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
93 apple-sdk_gstreamer
94 ];
95
96 propagatedBuildInputs = [
97 gstreamer
98 gst-plugins-base
99 gst-plugins-bad
100 gst-rtsp-server
101 ];
102
103 mesonFlags = [
104 (lib.mesonEnable "doc" enableDocumentation)
105 ];
106
107 cargoRoot = "dots-viewer";
108
109 passthru = {
110 updateScript =
111 let
112 updateSource = directoryListingUpdater { };
113
114 updateLockfile = {
115 command = [
116 "sh"
117 "-c"
118 ''
119 PATH=${
120 lib.makeBinPath [
121 common-updater-scripts
122 ]
123 }
124 update-source-version gst_all_1.gst-devtools --ignore-same-version --source-key=cargoDeps.vendorStaging > /dev/null
125 ''
126 ];
127 # Experimental feature: do not copy!
128 supportedFeatures = [ "silent" ];
129 };
130 in
131 _experimental-update-script-combinators.sequence [
132 updateSource
133 updateLockfile
134 ];
135 };
136
137 meta = with lib; {
138 description = "Integration testing infrastructure for the GStreamer framework";
139 homepage = "https://gstreamer.freedesktop.org";
140 license = licenses.lgpl2Plus;
141 platforms = platforms.unix;
142 maintainers = [ ];
143 };
144})