diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-03-21 09:12:55 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-03-21 09:12:55 +0000 |
| commit | 2bf2c409730da51e4dde58e3d0918319715db7d7 (patch) | |
| tree | e3515e082601a8b2cb7afcf62be45beda34c6288 | |
| parent | 6bd774341aadd4ffbe508d6512d2a2d250909a0a (diff) | |
| parent | 6dc5384632515dbbb6d2426b63eb00b342522dd9 (diff) | |
Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
| l--------- | compile_commands.json | 1 | ||||
| -rw-r--r-- | cscript | 14 | ||||
| -rw-r--r-- | platform/osx/make_dmg.sh | 41 | ||||
| -rw-r--r-- | src/lib/cinema_kdms.cc | 13 | ||||
| -rw-r--r-- | src/lib/util.cc | 4 | ||||
| -rw-r--r-- | src/lib/verify_dcp_job.cc | 2 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 2 | ||||
| -rw-r--r-- | src/wx/verify_dcp_dialog.cc | 12 | ||||
| -rw-r--r-- | waf-tools/clang_compilation_database.py | 85 | ||||
| -rw-r--r-- | wscript | 3 |
10 files changed, 138 insertions, 39 deletions
diff --git a/compile_commands.json b/compile_commands.json new file mode 120000 index 000000000..25eb4b2b4 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1 @@ +build/compile_commands.json
\ No newline at end of file @@ -220,7 +220,7 @@ def make_control(debian_version, bits, filename, debug): print(' This package contains the debugging symbols for dcpomatic.', file=f) print('', file=f) -def make_spec(filename, version, target): +def make_spec(filename, version, target, requires=None): """Make a .spec file for a RPM build""" f = open(filename, 'w') print('Summary:A program that generates Digital Cinema Packages (DCPs) from video and audio files', file=f) @@ -230,6 +230,8 @@ def make_spec(filename, version, target): print('License:GPL', file=f) print('Group:Applications/Multimedia', file=f) print('URL:http://dcpomatic.com/', file=f) + if requires is not None: + print('Requires:%s' % requires, file=f) print('', file=f) print('%description', file=f) print('DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio ', file=f) @@ -300,8 +302,8 @@ def dependencies(target): ffmpeg_options = {} return (('ffmpeg-cdist', '5fce90f', ffmpeg_options), - ('libdcp', '623e197'), - ('libsub', 'debe9fb'), + ('libdcp', '1215fe2'), + ('libsub', '1899ddd'), ('rtaudio-cdist', '739969e')) def configure_options(target): @@ -401,7 +403,11 @@ def package_rpm(target, cpu, version): "%s/SOURCES/dcpomatic-%s.tar.bz2" % (topdir, version) ) - make_spec('build/platform/linux/dcpomatic2.spec', version, target) + requires = None + if target.distro == 'mageia': + requires = "lib64xmlsec1-devel" + + make_spec('build/platform/linux/dcpomatic2.spec', version, target, requires) cmd = 'rpmbuild --define "_topdir %s" -bb build/platform/linux/dcpomatic2.spec' % topdir target.command(cmd) rpms = [] diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index 43d0a472a..82237f988 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -11,7 +11,7 @@ version=`cat wscript | egrep ^VERSION | awk '{print $3}' | sed -e "s/'//g"` # DMG size in megabytes DMG_SIZE=256 -ENV=/Users/carl/Environments/osx/10.6 +ENV=/Users/carl/Environments/dcpomatic ROOT=$1 # This is our work area for making up the .dmgs @@ -157,10 +157,10 @@ function relink { base=`basename $dep` # $dep will be a path within 64/; make a 32/ path too dep32=`echo $dep | sed -e "s/\/64\//\/32\//g"` - changes="$changes -change $dep @executable_path/../lib/$base -change $dep32 @executable_path/../lib/$base" + changes="$changes -change $dep @executable_path/../Frameworks/$base -change $dep32 @executable_path/../Frameworks/$base" done if test "x$changes" != "x"; then - install_name_tool $changes "$obj" + install_name_tool $changes -id `basename "$obj"` "$obj" fi done } @@ -174,7 +174,7 @@ function make_dmg { dmg="$full_name $version.dmg" vol_name=DCP-o-matic-$version - codesign --deep --force --verify --verbose --sign "3rd Party Mac Developer Application: Carl Hetherington (R82DXSR997)" "$appdir" + codesign --deep --force --verify --verbose --sign "Developer ID Application: Carl Hetherington (R82DXSR997)" "$appdir" if [ "$?" != "0" ]; then echo "Failed to sign .app" exit 1 @@ -183,6 +183,11 @@ function make_dmg { mkdir -p $vol_name cp -a "$appdir" $vol_name ln -s /Applications "$vol_name/Applications" + cat<<EOF > "$vol_name/READ ME.txt" +Welcome to DCP-o-matic! The first time you run the program there may be +a long (several-minute) delay while OS X checks the code for viruses and +other malware. Please be patient! +EOF rm -f $tmp_dmg "$dmg" hdiutil create -srcfolder $vol_name -volname $vol_name -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size $DMG_SIZE $tmp_dmg @@ -192,17 +197,18 @@ function make_dmg { echo ' tell application "Finder" - tell disk "'$vol_name'" + tell disk "$vol_name" open set current view of container window to icon view set toolbar visible of container window to false set statusbar visible of container window to false - set the bounds of container window to {400, 200, 650, 370} + set the bounds of container window to {400, 200, 940, 300} set theViewOptions to the icon view options of container window set arrangement of theViewOptions to not arranged set icon size of theViewOptions to 64 - set position of item "'$appdir'" of container window to {90, 80} - set position of item "Applications" of container window to {220, 80} + set position of item "$appdir" of container window to {90, 80} + set position of item "Applications" of container window to {265, 80} + set position of item "READ ME.txt" of container window to {430, 80} close open update without registering applications @@ -220,6 +226,11 @@ function make_dmg { DeRez -only icns "$appdir/Contents/Resources/dcpomatic2.icns" > "$appdir/Contents/Resources/DCP-o-matic.rsrc" Rez -append "$appdir/Contents/Resources/DCP-o-matic.rsrc" -o "$dmg" SetFile -a C "$dmg" + codesign --verify --verbose --sign "Developer ID Application: Carl Hetherington (R82DXSR997)" "$dmg" + if [ "$?" != "0" ]; then + echo "Failed to sign .dmg" + exit 1 + fi rm $tmp_dmg rm -rf $vol_name } @@ -230,11 +241,11 @@ function setup { approot="$appdir/Contents" rm -rf "$appdir" mkdir -p "$approot/MacOS" - mkdir -p "$approot/lib" + mkdir -p "$approot/Frameworks" mkdir -p "$approot/Resources" to_relink="dcpomatic" - copy_libs "$approot/lib" + copy_libs "$approot/Frameworks" copy_resources "$approot/Resources" } @@ -245,7 +256,7 @@ universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_cli "$approot/MacO universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_create "$approot/MacOS" universal_copy $ROOT bin/ffprobe "$approot/MacOS" cp $ROOT/32/src/dcpomatic/build/platform/osx/dcpomatic2.Info.plist "$approot/Info.plist" -rl=("$approot/MacOS/dcpomatic2" "$approot/MacOS/dcpomatic2_cli" "$approot/MacOS/ffprobe" "$approot/lib/"*.dylib) +rl=("$approot/MacOS/dcpomatic2" "$approot/MacOS/dcpomatic2_cli" "$approot/MacOS/dcpomatic2_create" "$approot/MacOS/ffprobe" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" make_dmg "$appdir" "DCP-o-matic" @@ -254,7 +265,7 @@ setup "DCP-o-matic 2 KDM Creator.app" universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_kdm "$approot/MacOS" universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_kdm_cli "$approot/MacOS" cp $ROOT/32/src/dcpomatic/build/platform/osx/dcpomatic2_kdm.Info.plist "$approot/Info.plist" -rl=("$approot/MacOS/dcpomatic2_kdm" "$approot/MacOS/dcpomatic2_kdm_cli" "$approot/lib/"*.dylib) +rl=("$approot/MacOS/dcpomatic2_kdm" "$approot/MacOS/dcpomatic2_kdm_cli" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" make_dmg "$appdir" "DCP-o-matic KDM Creator" @@ -263,7 +274,7 @@ setup "DCP-o-matic 2 Encode Server.app" universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_server "$approot/MacOS" universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_server_cli "$approot/MacOS" cp $ROOT/32/src/dcpomatic/build/platform/osx/dcpomatic2_server.Info.plist "$approot/Info.plist" -rl=("$approot/MacOS/dcpomatic2_server" "$approot/MacOS/dcpomatic2_server_cli" "$approot/lib/"*.dylib) +rl=("$approot/MacOS/dcpomatic2_server" "$approot/MacOS/dcpomatic2_server_cli" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" make_dmg "$appdir" "DCP-o-matic Encode Server" @@ -271,7 +282,7 @@ make_dmg "$appdir" "DCP-o-matic Encode Server" setup "DCP-o-matic 2 Batch converter.app" universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_batch "$approot/MacOS" cp $ROOT/32/src/dcpomatic/build/platform/osx/dcpomatic2_batch.Info.plist "$approot/Info.plist" -rl=("$approot/MacOS/dcpomatic2_batch" "$approot/lib/"*.dylib) +rl=("$approot/MacOS/dcpomatic2_batch" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" make_dmg "$appdir" "DCP-o-matic Batch Converter" @@ -279,6 +290,6 @@ make_dmg "$appdir" "DCP-o-matic Batch Converter" setup "DCP-o-matic 2 Player.app" universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_player "$approot/MacOS" cp $ROOT/32/src/dcpomatic/build/platform/osx/dcpomatic2_player.Info.plist "$approot/Info.plist" -rl=("$approot/MacOS/dcpomatic2_player" "$approot/lib/"*.dylib) +rl=("$approot/MacOS/dcpomatic2_player" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" make_dmg "$appdir" "DCP-o-matic Player" diff --git a/src/lib/cinema_kdms.cc b/src/lib/cinema_kdms.cc index d4c1017bb..aaeb0d905 100644 --- a/src/lib/cinema_kdms.cc +++ b/src/lib/cinema_kdms.cc @@ -131,15 +131,14 @@ CinemaKDMs::write_directories ( int written = 0; - if (!boost::filesystem::exists (directory)) { - boost::filesystem::create_directories (directory); - } - BOOST_FOREACH (CinemaKDMs const & i, cinema_kdms) { boost::filesystem::path path = directory; name_values['c'] = i.cinema->name; path /= container_name_format.get(name_values, ""); - ScreenKDM::write_files (i.screen_kdms, path, filename_format, name_values, confirm_overwrite); + if (!boost::filesystem::exists (path) || confirm_overwrite (path)) { + boost::filesystem::create_directories (path); + ScreenKDM::write_files (i.screen_kdms, path, filename_format, name_values, confirm_overwrite); + } written += i.screen_kdms.size(); } @@ -162,10 +161,6 @@ CinemaKDMs::write_zip_files ( int written = 0; - if (!boost::filesystem::exists (directory)) { - boost::filesystem::create_directories (directory); - } - BOOST_FOREACH (CinemaKDMs const & i, cinema_kdms) { boost::filesystem::path path = directory; name_values['c'] = i.cinema->name; diff --git a/src/lib/util.cc b/src/lib/util.cc index 68cded2a3..abfdd2767 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -346,11 +346,11 @@ dcpomatic_setup () avfilter_register_all (); #ifdef DCPOMATIC_OSX - /* Add our lib directory to the libltdl search path so that + /* Add our library directory to the libltdl search path so that xmlsec can find xmlsec1-openssl. */ boost::filesystem::path lib = app_contents (); - lib /= "lib"; + lib /= "Frameworks"; setenv ("LTDL_LIBRARY_PATH", lib.c_str (), 1); #endif diff --git a/src/lib/verify_dcp_job.cc b/src/lib/verify_dcp_job.cc index 0a54cabd0..8ac41d2a4 100644 --- a/src/lib/verify_dcp_job.cc +++ b/src/lib/verify_dcp_job.cc @@ -53,7 +53,7 @@ VerifyDCPJob::run () bool failed = false; BOOST_FOREACH (dcp::VerificationNote i, _notes) { - if (i.type() == dcp::VerificationNote::ERROR) { + if (i.type() == dcp::VerificationNote::VERIFY_ERROR) { failed = true; } } diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index ade45d766..1103db159 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -373,7 +373,7 @@ FilmViewer::paint_panel () { wxPaintDC dc (_panel); - if (!_frame || !_film || !_out_size.width || !_out_size.height) { + if (!_frame || !_film || !_out_size.width || !_out_size.height || _out_size != _frame->size()) { dc.Clear (); return; } diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc index b1eea0fd2..aff4a92f0 100644 --- a/src/wx/verify_dcp_dialog.cc +++ b/src/wx/verify_dcp_dialog.cc @@ -53,13 +53,13 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, list<dcp::VerificationNote> BOOST_FOREACH (dcp::VerificationNote i, notes) { switch (i.type()) { - case dcp::VerificationNote::NOTE: + case dcp::VerificationNote::VERIFY_NOTE: _text->BeginStandardBullet (N_("standard/circle"), 1, 50); break; - case dcp::VerificationNote::WARNING: + case dcp::VerificationNote::VERIFY_WARNING: _text->BeginStandardBullet (N_("standard/diamond"), 1, 50); break; - case dcp::VerificationNote::ERROR: + case dcp::VerificationNote::VERIFY_ERROR: _text->BeginSymbolBullet (N_("!"), 1, 50); break; } @@ -68,11 +68,11 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, list<dcp::VerificationNote> _text->Newline (); switch (i.type()) { - case dcp::VerificationNote::NOTE: - case dcp::VerificationNote::WARNING: + case dcp::VerificationNote::VERIFY_NOTE: + case dcp::VerificationNote::VERIFY_WARNING: _text->EndStandardBullet (); break; - case dcp::VerificationNote::ERROR: + case dcp::VerificationNote::VERIFY_ERROR: _text->EndSymbolBullet (); break; } diff --git a/waf-tools/clang_compilation_database.py b/waf-tools/clang_compilation_database.py new file mode 100644 index 000000000..4d9b5e275 --- /dev/null +++ b/waf-tools/clang_compilation_database.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# encoding: utf-8 +# Christoph Koke, 2013 + +""" +Writes the c and cpp compile commands into build/compile_commands.json +see http://clang.llvm.org/docs/JSONCompilationDatabase.html + +Usage: + + def configure(conf): + conf.load('compiler_cxx') + ... + conf.load('clang_compilation_database') +""" + +import sys, os, json, shlex, pipes +from waflib import Logs, TaskGen, Task + +Task.Task.keep_last_cmd = True + +@TaskGen.feature('c', 'cxx') +@TaskGen.after_method('process_use') +def collect_compilation_db_tasks(self): + "Add a compilation database entry for compiled tasks" + try: + clang_db = self.bld.clang_compilation_database_tasks + except AttributeError: + clang_db = self.bld.clang_compilation_database_tasks = [] + self.bld.add_post_fun(write_compilation_database) + + tup = tuple(y for y in [Task.classes.get(x) for x in ('c', 'cxx')] if y) + for task in getattr(self, 'compiled_tasks', []): + if isinstance(task, tup): + clang_db.append(task) + +def write_compilation_database(ctx): + "Write the clang compilation database as JSON" + database_file = ctx.bldnode.make_node('compile_commands.json') + Logs.info('Build commands will be stored in %s', database_file.path_from(ctx.path)) + try: + root = json.load(database_file) + except IOError: + root = [] + clang_db = dict((x['file'], x) for x in root) + for task in getattr(ctx, 'clang_compilation_database_tasks', []): + try: + cmd = task.last_cmd + except AttributeError: + continue + directory = getattr(task, 'cwd', ctx.variant_dir) + f_node = task.inputs[0] + filename = os.path.relpath(f_node.abspath(), directory) + entry = { + "directory": directory, + "arguments": cmd, + "file": filename, + } + clang_db[filename] = entry + root = list(clang_db.values()) + database_file.write(json.dumps(root, indent=2)) + +# Override the runnable_status function to do a dummy/dry run when the file doesn't need to be compiled. +# This will make sure compile_commands.json is always fully up to date. +# Previously you could end up with a partial compile_commands.json if the build failed. +for x in ('c', 'cxx'): + if x not in Task.classes: + continue + + t = Task.classes[x] + + def runnable_status(self): + def exec_command(cmd, **kw): + pass + + run_status = self.old_runnable_status() + if run_status == Task.SKIP_ME: + setattr(self, 'old_exec_command', getattr(self, 'exec_command', None)) + setattr(self, 'exec_command', exec_command) + self.run() + setattr(self, 'exec_command', getattr(self, 'old_exec_command', None)) + return run_status + + setattr(t, 'old_runnable_status', getattr(t, 'runnable_status', None)) + setattr(t, 'runnable_status', runnable_status) @@ -41,7 +41,7 @@ print('Version: %s' % VERSION) def options(opt): opt.load('compiler_cxx') opt.load('winres') - + opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation') opt.add_option('--disable-gui', action='store_true', default=False, help='disable building of GUI tools') opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests') @@ -63,6 +63,7 @@ def options(opt): def configure(conf): conf.load('compiler_cxx') + conf.load('clang_compilation_database', tooldir=['waf-tools']) if conf.options.target_windows: conf.load('winres') |
