--- /dev/null
+build/compile_commands.json
\ No newline at end of file
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)
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)
ffmpeg_options = {}
return (('ffmpeg-cdist', '5fce90f', ffmpeg_options),
- ('libdcp', '623e197'),
- ('libsub', 'debe9fb'),
+ ('libdcp', '1215fe2'),
+ ('libsub', '1899ddd'),
('rtaudio-cdist', '739969e'))
def configure_options(target):
"%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 = []
# 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
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
}
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
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
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
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
}
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"
}
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"
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"
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"
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"
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"
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();
}
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;
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
bool failed = false;
BOOST_FOREACH (dcp::VerificationNote i, _notes) {
- if (i.type() == dcp::VerificationNote::ERROR) {
+ if (i.type() == dcp::VerificationNote::VERIFY_ERROR) {
failed = true;
}
}
{
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;
}
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;
}
_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;
}
--- /dev/null
+#!/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)
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')
def configure(conf):
conf.load('compiler_cxx')
+ conf.load('clang_compilation_database', tooldir=['waf-tools'])
if conf.options.target_windows:
conf.load('winres')