Debian Codegraph @

meson.build

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 project(
2 'gst-thumbnailers',
3 'rust',
4 version: '1.1.0',
5 meson_version: '>=1.2',
6 )
7
8 dependency('gstreamer-1.0', version: '>=1.26.0')
9 dependency('glycin-2', version: '>=2.0.0')
10
11 if get_option('profile') == 'release'
12 rust_target = 'release'
13 cargo_profile = 'release'
14 else
15 rust_target = 'debug'
16 cargo_profile = 'dev'
17 endif
18
19 bindir = get_option('prefix') / get_option('bindir')
20 datadir = get_option('prefix') / get_option('datadir')
21
22 cargo_target_dir = meson.project_build_root() / 'cargo-target'
23 cargo_home = meson.project_build_root() / 'cargo-home'
24 cargo_manifest = meson.project_source_root() / 'Cargo.toml'
25
26 cargo_bin = find_program('cargo')
27
28 cargo_env = environment()
29 cargo_env.set('CARGO_HOME', cargo_home)
30
31 cargo_options = ['--manifest-path', cargo_manifest]
32 cargo_options += ['--target-dir', cargo_target_dir]
33 cargo_options += ['--profile', cargo_profile]
34
35 mime_types = {
36 'gst-video-thumbnailer': [
37 'application/mxf',
38 'image/vnd.rn-realpix',
39 'image/x-pict',
40 'video/3gp',
41 'video/3gpp',
42 'video/3gpp2',
43 'video/dv',
44 'video/divx',
45 'video/fli',
46 'video/flv',
47 'video/matroska',
48 'video/mp2t',
49 'video/mp4',
50 'video/mp4v-es',
51 'video/mpeg',
52 'video/mpeg-system',
53 'video/msvideo',
54 'video/ogg',
55 'video/quicktime',
56 'video/vivo',
57 'video/vnd.avi',
58 'video/vnd.divx',
59 'video/vnd.rn-realvideo',
60 'video/vnd.vivo',
61 'video/webm',
62 'video/x-anim',
63 'video/x-avi',
64 'video/x-flc',
65 'video/x-fli',
66 'video/x-flic',
67 'video/x-flv',
68 'video/x-m4v',
69 'video/x-matroska',
70 'video/x-mjpeg',
71 'video/x-mpeg',
72 'video/x-mpeg2',
73 'video/x-ms-asf',
74 'video/x-ms-asf-plugin',
75 'video/x-ms-asx',
76 'video/x-msvideo',
77 'video/x-ms-wm',
78 'video/x-ms-wmv',
79 'video/x-ms-wmx',
80 'video/x-ms-wvx',
81 'video/x-nsv',
82 'video/x-ogm+ogg',
83 'video/x-theora',
84 'video/x-theora+ogg',
85 'video/x-totem-stream',
86 ],
87 'gst-audio-thumbnailer': [
88 'application/x-shorten',
89 'audio/x-pn-realaudio',
90 'audio/3gpp',
91 'audio/3gpp2',
92 'audio/aac',
93 'audio/ac3',
94 'audio/AMR',
95 'audio/AMR-WB',
96 'audio/basic',
97 'audio/dv',
98 'audio/eac3',
99 'audio/flac',
100 'audio/m4a',
101 'audio/matroska',
102 'audio/midi',
103 'audio/mp1',
104 'audio/mp2',
105 'audio/mp3',
106 'audio/mp4',
107 'audio/mpeg',
108 'audio/mpg',
109 'audio/ogg',
110 'audio/opus',
111 'audio/prs.sid',
112 'audio/scpls',
113 'audio/vnd.rn-realaudio',
114 'audio/wav',
115 'audio/webm',
116 'audio/x-aac',
117 'audio/x-aiff',
118 'audio/x-ape',
119 'audio/x-flac',
120 'audio/x-gsm',
121 'audio/x-it',
122 'audio/x-m4a',
123 'audio/x-m4b',
124 'audio/x-matroska',
125 'audio/x-mod',
126 'audio/x-mp1',
127 'audio/x-mp2',
128 'audio/x-mp3',
129 'audio/x-mpg',
130 'audio/x-mpeg',
131 'audio/x-ms-asf',
132 'audio/x-ms-asx',
133 'audio/x-ms-wax',
134 'audio/x-ms-wma',
135 'audio/x-musepack',
136 'audio/x-opus+ogg',
137 'audio/x-pn-aiff',
138 'audio/x-pn-au',
139 'audio/x-pn-wav',
140 'audio/x-pn-windows-acm',
141 'audio/x-realaudio',
142 'audio/x-real-audio',
143 'audio/x-s3m',
144 'audio/x-sbc',
145 'audio/x-shorten',
146 'audio/x-speex',
147 'audio/x-stm',
148 'audio/x-tta',
149 'audio/x-wav',
150 'audio/x-wavpack',
151 'audio/x-vorbis',
152 'audio/x-vorbis+ogg',
153 'audio/x-xm',
154 ],
155 }
156
157 binaries = [
158 'gst-video-thumbnailer',
159 'gst-audio-thumbnailer',
160 ]
161
162 test(
163 'Cargo tests (main application)',
164 cargo_bin,
165 args: ['test', cargo_options],
166 timeout: 3600,
167 env: cargo_env,
168 )
169
170 gst_thumbnailers = custom_target(
171 'gst-thumbnailers',
172 build_by_default: true,
173 build_always_stale: true,
174 output: f'gst-thumbnailers',
175 console: true,
176 env: cargo_env,
177 command: [
178 cargo_bin,
179 'build',
180 cargo_options,
181 ],
182 )
183
184 foreach binary_name : binaries
185
186 custom_target(
187 f'@binary_name@-cp-binary',
188 depends: gst_thumbnailers,
189 build_by_default: true,
190 build_always_stale: true,
191 install: true,
192 install_dir: bindir,
193 output: binary_name,
194 command: [
195 'cp',
196 cargo_target_dir / rust_target / binary_name,
197 '@OUTPUT@',
198 ],
199 )
200
201 # Install .thumbnailer file
202 conf = configuration_data()
203 conf.set('BINDIR', bindir)
204 conf.set('MIME_TYPES', ';'.join(mime_types[binary_name]) + ';')
205
206 configure_file(
207 input: f'@[email protected]',
208 output: f'@[email protected]',
209 configuration: conf,
210 install: true,
211 install_dir: datadir / 'thumbnailers',
212 )
213
214 endforeach