From 1801c33ee4ac27b2ecef7c572dbc88078b758b25 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 2 Jul 2019 17:33:56 +0200 Subject: [PATCH] Consolidate headless startup scripts and make hardev work again This fixes an issue with inconsistent startup scripts. LD_LIBRARY_PATH was incomplete since at least 5.0 (5.12 is broken, too) likewise ctrl surface path were outdated, etc. Prefer to use `gtk2_ardour/ardev_common.sh.in` as the central point to define environment variables for running Ardour from the source-tree. Other start scripts e.g. `vst/ardevst` already did this. --- headless/hardbg | 11 ++++++++-- headless/hardev | 5 +++-- headless/hardev_common.sh.in | 39 ------------------------------------ headless/harval | 10 ++++++--- headless/wscript | 23 --------------------- 5 files changed, 19 insertions(+), 69 deletions(-) delete mode 100644 headless/hardev_common.sh.in diff --git a/headless/hardbg b/headless/hardbg index ffab6221b0..816c8be185 100755 --- a/headless/hardbg +++ b/headless/hardbg @@ -1,5 +1,12 @@ #!/bin/sh -. `dirname "$0"`/../build/headless/hardev_common_waf.sh +TOP=`dirname "$0"`/.. +. $TOP/build/gtk2_ardour/ardev_common_waf.sh LD_LIBRARY_PATH=$LD_LIBRARY_PATH export ARDOUR_INSIDE_GDB=1 -exec gdb --args $TOP/$EXECUTABLE $@ +if test -n "`which gdb`"; then + exec gdb --args $TOP/build/headless/hardour-$ARDOURVERSION "$@" +fi +if test -n "`which lldb`"; then + exec lldb -- $TOP/build/headless/hardour-$ARDOURVERSION "$@" +fi +echo "neither gdb nor lldb was found." diff --git a/headless/hardev b/headless/hardev index 75c29e54de..b22f9c2552 100755 --- a/headless/hardev +++ b/headless/hardev @@ -1,4 +1,5 @@ #!/bin/sh -. `dirname "$0"`/../build/headless/hardev_common_waf.sh +TOP=`dirname "$0"`/.. +. $TOP/build/gtk2_ardour/ardev_common_waf.sh export UBUNTU_MENUPROXY="" -exec $TOP/$EXECUTABLE "$@" +exec $TOP/build/headless/hardour-$ARDOURVERSION "$@" diff --git a/headless/hardev_common.sh.in b/headless/hardev_common.sh.in deleted file mode 100644 index 3af6c76efe..0000000000 --- a/headless/hardev_common.sh.in +++ /dev/null @@ -1,39 +0,0 @@ -TOP=`dirname "$0"`/.. - -#export G_DEBUG=fatal_criticals - -libs=$TOP/@LIBS@ - -# -# when running ardev, the various parts of Ardour have not been consolidated into the locations that they -# would normally end up after an install. We therefore need to set up environment variables so that we -# can find all the components. -# - -export ARDOUR_PATH=$TOP/gtk2_ardour/icons:$TOP/gtk2_ardour/pixmaps:$TOP/build/gtk2_ardour:$TOP/gtk2_ardour:. -export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie:$libs/surfaces/wiimote -export ARDOUR_PANNER_PATH=$libs/panners -export ARDOUR_DATA_PATH=$TOP:$TOP/build:$TOP/gtk2_ardour:$TOP/build/gtk2_ardour:. -export ARDOUR_MIDIMAPS_PATH=$TOP/midi_maps:. -export ARDOUR_MCP_PATH=$TOP/mcp:. -export ARDOUR_EXPORT_FORMATS_PATH=$TOP/export:. -export ARDOUR_BACKEND_PATH=$libs/backends/jack - -# -# even though we set the above variables, ardour requires that these -# two also be set. the above settings will override them. -# - -export ARDOUR_CONFIG_PATH=$TOP:$TOP/gtk2_ardour:$TOP/build:$TOP/build/gtk2_ardour -export ARDOUR_DLL_PATH=$libs - -export GTK_PATH=~/.ardour3:$libs/clearlooks-newer -export VAMP_PATH=$libs/vamp-plugins${VAMP_PATH:+:$VAMP_PATH} - -export LD_LIBRARY_PATH=$libs/qm-dsp:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/gnomecanvas:$libs/libsndfile:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/audiographer:$libs/temporal:$libs/libltc:$libs/canvas:$libs/ardouralsautil${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} - -# DYLD_LIBRARY_PATH is for darwin. -export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH - -ARDOURVERSION=@VERSION@ -EXECUTABLE=@EXECUTABLE@ diff --git a/headless/harval b/headless/harval index fa3430e684..14331e88eb 100755 --- a/headless/harval +++ b/headless/harval @@ -1,8 +1,12 @@ #!/bin/sh -. `dirname "$0"`/../build/headless/hardev_common_waf.sh -LD_LIBRARY_PATH=$LD_LIBRARY_PATH +VALGRIND_OPTIONS="$VALGRIND_OPTIONS --num-callers=50" +VALGRIND_OPTIONS="$VALGRIND_OPTIONS --error-limit=no" +#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --leak-check=full --leak-resolution=high" +#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --show-leak-kinds=all -v" +#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --log-file=/tmp/hardour-%p.log" TOP=`dirname "$0"`/.. +. $TOP/build/gtk2_ardour/ardev_common_waf.sh if uname | grep -q arwin; then OBJSUPP="--suppressions=${TOP}/tools/objc.supp" fi @@ -12,4 +16,4 @@ exec valgrind --tool=memcheck \ --track-origins=yes \ --suppressions=${TOP}/tools/valgrind.supp \ $OBJSUPP \ - $TOP/$EXECUTABLE --novst "$@" + $TOP/build/headless/hardour-$ARDOURVERSION --novst "$@" diff --git a/headless/wscript b/headless/wscript index 80296a10de..0aea4751c2 100644 --- a/headless/wscript +++ b/headless/wscript @@ -74,26 +74,3 @@ def build(bld): if bld.is_defined('NEED_INTL'): obj.linkflags = ' -lintl' - - # Wrappers - - wrapper_subst_dict = { - 'INSTALL_PREFIX' : bld.env['PREFIX'], - 'LIBDIR' : os.path.normpath(bld.env['LIBDIR']), - 'DATADIR' : os.path.normpath(bld.env['DATADIR']), - 'CONFDIR' : os.path.normpath(bld.env['CONFDIR']), - 'LIBS' : 'build/libs', - 'VERSION' : bld.env['VERSION'], - 'EXECUTABLE' : 'build/headless/hardour-' + str(bld.env['VERSION']) - } - - def set_subst_dict(obj, dict): - for i in dict: - setattr(obj, i, dict[i]) - - obj = bld(features = 'subst') - obj.source = 'hardev_common.sh.in' - obj.target = 'hardev_common_waf.sh' - obj.chmod = Utils.O755 - obj.dict = wrapper_subst_dict - set_subst_dict(obj, wrapper_subst_dict)