elif target.distro == 'centos' or target.distro == 'fedora' or target.distro == 'mageia':
return package_rpm(target, cpu, version, options)
elif target.platform == 'osx' and target.bits is None:
- target.command('bash platform/osx/make_dmg.sh %s universal' % target.directory)
+ target.command('bash platform/osx/make_dmg.sh %s %s universal %s %s' % (target.environment_prefix, target.directory, target.apple_id, target.apple_password))
return [os.path.abspath(x) for x in glob.glob('build/platform/osx/DCP-o-matic*.dmg')]
elif target.platform == 'osx' and target.bits == 64:
- target.command('bash platform/osx/make_dmg.sh %s thin' % target.directory)
+ target.command('bash platform/osx/make_dmg.sh %s %s thin %s %s' % (target.environment_prefix, target.directory, target.apple_id, target.apple_password))
return [os.path.abspath(x) for x in glob.glob('build/platform/osx/DCP-o-matic*.dmg')]
elif target.platform == 'docker':
shutil.copyfile(target.deb, 'build/platform/docker')
#!/bin/bash
#
-# Syntax: make_dmg.sh <builddir> <type>
+# Syntax: make_dmg.sh <environment> <builddir> <type> <apple-id> <apple-password>
# where <type> is universal or thin
#
-# e.g. make_dmg.sh /Users/carl/cdist
+# e.g. make_dmg.sh /Users/carl/osx-environment /Users/carl/cdist universal foo@bar.net opensesame
# Don't set -e here as egrep (used a few times) returns 1 if no matches
# were found.
# DMG size in megabytes
DMG_SIZE=256
-ENV=/Users/carl/Environments/dcpomatic
-ROOT=$1
-TYPE=$2
+ENV=$1
+ROOT=$2
+TYPE=$3
+APPLE_ID=$4
+APPLE_PASSWORD=$5
if [ "$TYPE" != "universal" -a "$TYPE" != "thin" ]; then
echo "Syntax: $0 <builddir> <type>"
# @param #1 .app directory
# @param #2 full name e.g. DCP-o-matic Batch Converter
+# @param #3 bundle id e.g. com.dcpomatic.batch
function make_dmg {
local appdir="$1"
local full_name="$2"
+ local bundle_id="$3"
tmp_dmg=dcpomatic_tmp.dmg
dmg="$full_name $version.dmg"
vol_name=DCP-o-matic-$version
chmod -Rf go-w /Volumes/"$vol_name"/"$appdir"
sync
+ set -e
hdiutil eject $device
hdiutil convert -format UDZO $tmp_dmg -imagekey zlib-level=9 -o "$dmg"
sips -i "$appdir/Contents/Resources/dcpomatic2.icns"
SetFile -a C "$dmg"
xattr -c "$dmg"
codesign --verify --verbose --sign "Developer ID Application: Carl Hetherington (R82DXSR997)" "$dmg"
- if [ "$?" != "0" ]; then
- echo "Failed to sign .dmg"
- exit 1
- fi
+
+ id=$(xcrun altool --notarize-app -t osx -f "$dmg" --primary-bundle-id $bundle_id -u $APPLE_ID -p $APPLE_PASSWORD --output-format xml | grep -C1 RequestUUID | tail -n 1 | sed -e "s/<string>//g" | sed -e "s/<\/string>//g")
+ N=0
+ while [ 1 ]; do
+ echo "Checking up on $id"
+ status=$(xcrun altool --notarization-info $id -u $APPLE_ID -p $APPLE_PASSWORD --output-format xml | grep -C1 "<key>Status</key>" | tail -n 1 | sed -e "s/ .//g")
+ echo "Got $status"
+ if [ "$status" == "<string>success</string>" ]; then
+ break
+ fi
+ sleep 30
+ N=$((N+1))
+ if [ "$N" == "10" ]; then
+ echo "Timed out waiting for notarization"
+ exit 1
+ fi
+ done
+
+ xcrun stapler staple "$dmg"
+ set +e
+
rm $tmp_dmg
rm -rf $vol_name
}
cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2.Info.plist "$approot/Info.plist"
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"
+make_dmg "$appdir" "DCP-o-matic" com.dcpomatic
# DCP-o-matic KDM Creator
setup "DCP-o-matic 2 KDM Creator.app"
cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_kdm.Info.plist "$approot/Info.plist"
rl=("$approot/MacOS/dcpomatic2_kdm" "$approot/MacOS/dcpomatic2_kdm_cli" "$approot/Frameworks/"*.dylib)
relink "${rl[@]}"
-make_dmg "$appdir" "DCP-o-matic KDM Creator"
+make_dmg "$appdir" "DCP-o-matic KDM Creator" com.dcpomatic.kdm
# DCP-o-matic Encode Server
setup "DCP-o-matic 2 Encode Server.app"
cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_server.Info.plist "$approot/Info.plist"
rl=("$approot/MacOS/dcpomatic2_server" "$approot/MacOS/dcpomatic2_server_cli" "$approot/Frameworks/"*.dylib)
relink "${rl[@]}"
-make_dmg "$appdir" "DCP-o-matic Encode Server"
+make_dmg "$appdir" "DCP-o-matic Encode Server" com.dcpomatic.server
# DCP-o-matic Batch Converter
setup "DCP-o-matic 2 Batch converter.app"
cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_batch.Info.plist "$approot/Info.plist"
rl=("$approot/MacOS/dcpomatic2_batch" "$approot/Frameworks/"*.dylib)
relink "${rl[@]}"
-make_dmg "$appdir" "DCP-o-matic Batch Converter"
+make_dmg "$appdir" "DCP-o-matic Batch Converter" com.dcpomatic.batch
# DCP-o-matic Player
setup "DCP-o-matic 2 Player.app"
cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_player.Info.plist "$approot/Info.plist"
rl=("$approot/MacOS/dcpomatic2_player" "$approot/Frameworks/"*.dylib)
relink "${rl[@]}"
-make_dmg "$appdir" "DCP-o-matic Player"
+make_dmg "$appdir" "DCP-o-matic Player" com.dcpomatic.player
}
lm.unlock ();
- dcpomatic_sleep (_period);
+ dcpomatic_sleep_seconds (_period);
}
}
/** @param s Number of seconds to sleep for */
void
-dcpomatic_sleep (int s)
+dcpomatic_sleep_seconds (int s)
{
#ifdef DCPOMATIC_POSIX
sleep (s);
class Log;
struct AVIOContext;
-void dcpomatic_sleep (int);
+void dcpomatic_sleep_seconds (int);
extern std::string cpu_info ();
extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path);
extern std::list<std::pair<std::string, std::string> > mount_info ();
bool error = false;
while (true) {
- dcpomatic_sleep (5);
+ dcpomatic_sleep_seconds (5);
list<shared_ptr<Job> > jobs = JobManager::instance()->get();
start (wx_to_std (wxStandardPaths::Get().GetExecutablePath()));
}
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
}
return true;
}
}
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
for (int i = 0; i < N; ++i) {
cout << "\033[1A\033[2K";
if (keep_going) {
while (true) {
- dcpomatic_sleep (3600);
+ dcpomatic_sleep_seconds (3600);
}
}
}
while (jm->work_to_do ()) {
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
}
while (signal_manager->ui_idle() > 0) {}
JobManager* jm = JobManager::instance ();
while (jm->work_to_do ()) {
while (signal_manager->ui_idle ()) {}
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
}
DCPOMATIC_ASSERT (!jm->errors());
}
return;
}
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
}
/* Add content from successful jobs and report errors */
bool ok = true;
while (jm->work_to_do()) {
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
if (!progress.Pulse()) {
/* user pressed cancel */
BOOST_FOREACH (shared_ptr<Job> i, jm->get()) {
thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
/* Let the server get itself ready */
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
/* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
EncodeServerDescription description ("127.0.0.1", 1, SERVER_LINK_VERSION);
thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
/* Let the server get itself ready */
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
/* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
EncodeServerDescription description ("127.0.0.1", 2, SERVER_LINK_VERSION);
thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
/* Let the server get itself ready */
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
/* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
EncodeServerDescription description ("127.0.0.1", 2, SERVER_LINK_VERSION);
film->make_dcp ();
- dcpomatic_sleep (10);
+ dcpomatic_sleep_seconds (10);
JobManager::drop ();
}
shared_ptr<TestJob> a (new TestJob (film));
JobManager::instance()->add (a);
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
BOOST_CHECK_EQUAL (a->running (), true);
a->set_finished_ok ();
- dcpomatic_sleep (2);
+ dcpomatic_sleep_seconds (2);
BOOST_CHECK_EQUAL (a->finished_ok(), true);
}
shared_ptr<Butler> butler (new Butler(player, AudioMapping(), 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
/* Wait for the butler to fill */
- dcpomatic_sleep (5);
+ dcpomatic_sleep_seconds (5);
boon->set_trim_start (ContentTime::from_seconds(5));
butler->seek (DCPTime(), true);
/* Wait for the butler to refill */
- dcpomatic_sleep (5);
+ dcpomatic_sleep_seconds (5);
butler->rethrow ();
}
JobManager* jm = JobManager::instance ();
while (jm->work_to_do ()) {
while (signal_manager->ui_idle ()) {}
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
}
if (jm->errors ()) {
JobManager* jm = JobManager::instance ();
while (jm->work_to_do ()) {
while (signal_manager->ui_idle()) {}
- dcpomatic_sleep (1);
+ dcpomatic_sleep_seconds (1);
}
while (signal_manager->ui_idle ()) {}