#!/bin/bash
-if [ `uname -s` == "Darwin" ]; then
- # Some time ago we could start DCP-o-matic on OS X just by running the executable, in
- # the same way as Linux. This doesn't work any more.
-
- ENV=$HOME/Environments/osx/64/lib
- DEP=$HOME/cdist/64/lib
-
- app=build/platform/osx/DCP-o-matic.app
- macos=$app/Contents/MacOS
- lib=$app/Contents/lib
- resources=$app/Contents/Resources
- mkdir -p $macos $lib $resources
-
- cp build/src/tools/dcpomatic $macos
- cp build/src/lib/libdcpomatic.dylib $lib
- cp build/src/wx/libdcpomatic-wx.dylib $lib
- cp $DEP/libcxml.dylib $lib
- cp $DEP/libdcp.dylib $lib
- cp $DEP/libasdcp-libdcp.dylib $lib
- cp $DEP/libkumu-libdcp.dylib $lib
- cp $DEP/libopenjpeg*.dylib $lib
- cp $DEP/libavdevice*.dylib $lib
- cp $DEP/libavformat*.dylib $lib
- cp $DEP/libavfilter*.dylib $lib
- cp $DEP/libavutil*.dylib $lib
- cp $DEP/libavcodec*.dylib $lib
- cp $DEP/libswscale*.dylib $lib
- cp $DEP/libpostproc*.dylib $lib
- cp $DEP/libswresample*.dylib $lib
- cp $ENV/libboost_system.dylib $lib
- cp $ENV/libboost_filesystem.dylib $lib
- cp $ENV/libboost_thread.dylib $lib
- cp $ENV/libboost_date_time.dylib $lib
- cp $ENV/libxml++-2.6*.dylib $lib
- cp $ENV/libxml2*.dylib $lib
- cp $ENV/libglibmm-2.4*.dylib $lib
- cp $ENV/libgobject*.dylib $lib
- cp $ENV/libgthread*.dylib $lib
- cp $ENV/libgmodule*.dylib $lib
- cp $ENV/libsigc*.dylib $lib
- cp $ENV/libglib-2*.dylib $lib
- cp $ENV/libintl*.dylib $lib
- cp $ENV/libsndfile*.dylib $lib
- cp $ENV/libMagick++*.dylib $lib
- cp $ENV/libMagickCore*.dylib $lib
- cp $ENV/libMagickWand*.dylib $lib
- cp $ENV/libssh*.dylib $lib
- cp $ENV/libwx*.dylib $lib
- cp $ENV/libfontconfig*.dylib $lib
- cp $ENV/libfreetype*.dylib $lib
- cp $ENV/libexpat*.dylib $lib
- cp $ENV/libltdl*.dylib $lib
- cp $ENV/libxmlsec1*.dylib $lib
- cp $ENV/libzip*.dylib $lib
- cp $ENV/libquickmail*.dylib $lib
- cp $ENV/libcurl*.dylib $lib
- cp $ENV/libffi*.dylib $lib
- cp icons/defaults.png $resources
- cp icons/servers.png $resources
-
- sed -e "s/@VERSION@/test/g" platform/osx/Info.plist.in > $app/Contents/Info.plist
-
- for obj in $macos/dcpomatic $lib/*.dylib; do
- deps=`otool -L $obj | awk '{print $1}' | egrep "(/Users/carl|libboost|libssh|libltdl)"`
- changes=""
- for dep in $deps; do
- base=`basename $dep`
- changes="$changes -change $dep @executable_path/../lib/$base"
- done
- if test "x$changes" != "x"; then
- install_name_tool $changes $obj
- fi
- done
-
- open $app
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+source $DIR/environment
+binary=$build/src/tools/dcpomatic2
+if [ "$1" == "--debug" ]; then
+ shift
+ gdb --args $binary $*
+elif [ "$1" == "--valgrind" ]; then
+ shift
+ valgrind --tool="memcheck" --suppressions=suppressions --track-fds=yes --show-leak-kinds=all --leak-check=full $binary $*
+elif [ "$1" == "--callgrind" ]; then
+ shift
+ valgrind --tool="callgrind" $binary $*
+elif [ "$1" == "--massif" ]; then
+ shift
+ valgrind --tool="massif" $binary $*
+elif [ "$1" == "--i18n" ]; then
+ shift
+ LANGUAGE=de_DE.UTF8 LANG=de_DE.UTF8 LC_ALL=de_DE.UTF8 $binary "$*"
+elif [ "$1" == "--perf" ]; then
+ shift
+ perf record $binary $*
+elif [ "$1" == "--scaled" ]; then
+ shift
+ ~/src/run_scaled/run_scaled --sleep=5 --scale=0.5 $binary $*
+elif [ "$1" == "--screenshot" ]; then
+ shift
+ GTK_PATH=/usr/local/lib/gtk-3.0 GTK_MODULES=gtk-vector-screenshot $binary "$*"
else
- export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:$LD_LIBRARY_PATH
- if [ "$1" == "--debug" ]; then
- shift
- gdb --args build/src/tools/dcpomatic $*
- elif [ "$1" == "--valgrind" ]; then
- shift
- valgrind --tool="memcheck" build/src/tools/dcpomatic $*
- elif [ "$1" == "--callgrind" ]; then
- shift
- valgrind --tool="callgrind" build/src/tools/dcpomatic $*
- elif [ "$1" == "--massif" ]; then
- shift
- valgrind --tool="massif" build/src/tools/dcpomatic $*
- elif [ "$1" == "--i18n" ]; then
- shift
- LANGUAGE=de_DE.UTF8 LANG=de_DE.UTF8 LC_ALL=de_DE.UTF8 build/src/tools/dcpomatic "$*"
- elif [ "$1" == "--perf" ]; then
- shift
- perf record build/src/tools/dcpomatic $*
- else
- build/src/tools/dcpomatic $*
- fi
+ $binary $* 2> >(grep -v Gtk-CRITICAL | grep -v Gtk-WARNING)
fi
-