X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=run%2Fdcpomatic;h=6de2989ae35a05ed10bf60b6099078d04db10d1a;hp=f7af918144af0bdfc0ea3e9eb435cb1d9954254e;hb=HEAD;hpb=f1d30fb114b3b2c6ccd8fdf5823e7cd6b26c1eef diff --git a/run/dcpomatic b/run/dcpomatic index f7af91814..45f857ae2 100755 --- a/run/dcpomatic +++ b/run/dcpomatic @@ -1,106 +1,47 @@ #!/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 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source $DIR/environment +binary=$build/src/tools/dcpomatic2 - 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/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 - cp icons/tms.png $resources - cp icons/colour_conversions.png $resources - cp icons/kdm_email.png $resources - - sed -e "s/@VERSION@/test/g" platform/osx/Info.plist.in > $app/Contents/Info.plist +if [[ "$(uname -m)" == arm64 ]]; then + env=arm64/11.0 +else + env=x86_64/10.10 +fi - 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 - - cd build/platform/osx/DCP-o-matic.app/Contents/MacOS - ./dcpomatic $* +export DYLD_LIBRARY_PATH=/Users/cah/osx-environment/$env/lib:/usr/local/lib +# export ASAN_OPTIONS=verbosity=1:malloc_context_size=20:detect_leaks=1 + +if [ "$1" == "--debug" ]; then + shift + if [[ "$(uname)" == Darwin ]]; then + /Applications/Xcode.app/Contents/Developer/usr/bin/lldb $binary $* + else + gdb --args $binary $* + fi +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=fr_FR.UTF8 LANG=fr_FR.UTF8 LC_ALL=fr_FR.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 -