Support encoding of MPEG2 DCPs.
[dcpomatic.git] / src / lib / wscript
1 #
2 #    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
3 #
4 #    This file is part of DCP-o-matic.
5 #
6 #    DCP-o-matic is free software; you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation; either version 2 of the License, or
9 #    (at your option) any later version.
10 #
11 #    DCP-o-matic is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 import os
21 import i18n
22
23 sources = """
24           active_text.cc
25           analyse_audio_job.cc
26           analyse_subtitles_job.cc
27           analytics.cc
28           atmos_content.cc
29           atmos_mxf_content.cc
30           atmos_decoder.cc
31           atmos_metadata.cc
32           atmos_mxf_decoder.cc
33           audio_analyser.cc
34           audio_analysis.cc
35           audio_buffers.cc
36           audio_content.cc
37           audio_decoder.cc
38           audio_delay.cc
39           audio_filter.cc
40           audio_filter_graph.cc
41           audio_mapping.cc
42           audio_merger.cc
43           audio_point.cc
44           audio_processor.cc
45           audio_ring_buffers.cc
46           audio_stream.cc
47           butler.cc
48           text_content.cc
49           text_decoder.cc
50           case_insensitive_sorter.cc
51           check_content_job.cc
52           cinema.cc
53           cinema_sound_processor.cc
54           change_signaller.cc
55           collator.cc
56           colour_conversion.cc
57           config.cc
58           content.cc
59           content_factory.cc
60           combine_dcp_job.cc
61           copy_dcp_details_to_film.cc
62           cpu_j2k_encoder_thread.cc
63           create_cli.cc
64           crop.cc
65           cross_common.cc
66           curl_uploader.cc
67           datasat_ap2x.cc
68           dcp_content.cc
69           dcp_content_type.cc
70           dcp_decoder.cc
71           dcp_examiner.cc
72           dcp_digest_file.cc
73           dcp_film_encoder.cc
74           dcp_subtitle.cc
75           dcp_subtitle_content.cc
76           dcp_subtitle_decoder.cc
77           dcp_text_track.cc
78           dcp_transcode_job.cc
79           dcp_video.cc
80           dcpomatic_log.cc
81           dcpomatic_socket.cc
82           dcpomatic_time.cc
83           decoder.cc
84           decoder_factory.cc
85           decoder_part.cc
86           digester.cc
87           dkdm_recipient.cc
88           dkdm_wrapper.cc
89           dolby_cp750.cc
90           email.cc
91           empty.cc
92           encode_server.cc
93           encode_server_finder.cc
94           encoded_log_entry.cc
95           environment_info.cc
96           event_history.cc
97           examine_content_job.cc
98           examine_ffmpeg_subtitles_job.cc
99           exceptions.cc
100           export_config.cc
101           frame_info.cc
102           file_group.cc
103           file_log.cc
104           filter_graph.cc
105           find_missing.cc
106           ffmpeg.cc
107           ffmpeg_audio_stream.cc
108           ffmpeg_content.cc
109           ffmpeg_decoder.cc
110           ffmpeg_examiner.cc
111           ffmpeg_file_encoder.cc
112           ffmpeg_film_encoder.cc
113           ffmpeg_image_proxy.cc
114           ffmpeg_stream.cc
115           ffmpeg_subtitle_stream.cc
116           ffmpeg_wrapper.cc
117           film.cc
118           film_encoder.cc
119           film_util.cc
120           filter.cc
121           font.cc
122           font_config.cc
123           font_id_allocator.cc
124           font_id_map.cc
125           frame_interval_checker.cc
126           frame_rate_change.cc
127           guess_crop.cc
128           hints.cc
129           internet.cc
130           image.cc
131           image_content.cc
132           image_decoder.cc
133           image_examiner.cc
134           image_filename_sorter.cc
135           image_jpeg.cc
136           image_png.cc
137           image_proxy.cc
138           image_store.cc
139           j2k_image_proxy.cc
140           job.cc
141           job_manager.cc
142           j2k_encoder.cc
143           j2k_encoder_thread.cc
144           j2k_sync_encoder_thread.cc
145           json_server.cc
146           kdm_cli.cc
147           kdm_recipient.cc
148           kdm_with_metadata.cc
149           kdm_util.cc
150           log.cc
151           log_entry.cc
152           make_dcp.cc
153           map_cli.cc
154           maths_util.cc
155           memory_util.cc
156           mid_side_decoder.cc
157           mpeg2_encoder.cc
158           named_channel.cc
159           overlaps.cc
160           pixel_quanta.cc
161           player.cc
162           player_video.cc
163           playlist.cc
164           position_image.cc
165           ratio.cc
166           raw_image_proxy.cc
167           reel_writer.cc
168           referenced_reel_asset.cc
169           release_notes.cc
170           render_text.cc
171           remote_j2k_encoder_thread.cc
172           resampler.cc
173           resolution.cc
174           rgba.cc
175           rng.cc
176           scoped_temporary.cc
177           scp_uploader.cc
178           screen.cc
179           send_kdm_email_job.cc
180           send_notification_email_job.cc
181           send_problem_report_job.cc
182           server.cc
183           shuffler.cc
184           state.cc
185           spl.cc
186           spl_entry.cc
187           string_log_entry.cc
188           string_text_file.cc
189           string_text_file_content.cc
190           string_text_file_decoder.cc
191           subtitle_analysis.cc
192           subtitle_film_encoder.cc
193           territory_type.cc
194           text_ring_buffers.cc
195           text_type.cc
196           timer.cc
197           transcode_job.cc
198           trusted_device.cc
199           types.cc
200           rough_duration.cc
201           signal_manager.cc
202           stdout_log.cc
203           unzipper.cc
204           update_checker.cc
205           upload_job.cc
206           uploader.cc
207           upmixer_a.cc
208           upmixer_b.cc
209           usl.cc
210           util.cc
211           variant.cc
212           verify_dcp_job.cc
213           video_content.cc
214           video_decoder.cc
215           video_encoder.cc
216           video_encoding.cc
217           video_filter_graph.cc
218           video_filter_graph_set.cc
219           video_frame_type.cc
220           video_mxf_content.cc
221           video_mxf_decoder.cc
222           video_mxf_examiner.cc
223           video_range.cc
224           video_ring_buffers.cc
225           writer.cc
226           zipper.cc
227           """
228
229 def build(bld):
230     if bld.env.STATIC_DCPOMATIC:
231         obj = bld(features = 'cxx cxxstlib')
232     else:
233         obj = bld(features = 'cxx cxxshlib')
234
235     obj.name = 'libdcpomatic2'
236     obj.export_includes = ['..']
237     obj.uselib = """
238                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
239                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
240                  SAMPLERATE POSTPROC TIFF SSH DCP CXML GLIB XML++
241                  CURL ZIP BZ2 FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU NETTLE PNG JPEG LEQM_NRT
242                  LIBZ
243                  """
244
245     if bld.env.TARGET_OSX:
246         obj.framework = ['IOKit', 'Foundation', 'DiskArbitration', 'ApplicationServices']
247
248     obj.source = sources + ' version.cc'
249
250     if bld.env.ENABLE_DISK:
251         obj.source += ' copy_to_drive_job.cc disk_writer_messages.cc ext.cc nanomsg.cc'
252         obj.uselib += ' LWEXT4 NANOMSG'
253         if bld.env.TARGET_LINUX:
254             obj.uselib += ' POLKIT'
255
256     if bld.env.ENABLE_GROK:
257         obj.source += ' grok_j2k_encoder_thread.cc'
258
259     if bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32:
260         obj.uselib += ' WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE SETUPAPI OLE32 UUID'
261         obj.source += ' cross_windows.cc'
262     if bld.env.TARGET_OSX:
263         obj.source += ' cross_osx.cc cross_unix.cc'
264     if bld.env.TARGET_LINUX:
265         obj.source += ' cross_linux.cc cross_unix.cc'
266     if bld.env.STATIC_DCPOMATIC:
267         obj.uselib += ' XMLPP'
268
269     obj.target = 'dcpomatic2'
270
271     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
272
273 def pot(bld):
274     i18n.pot(os.path.join('src', 'lib'), sources + " util.h", 'libdcpomatic')
275
276 def pot_merge(bld):
277     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')