Skip to content

Commit

Permalink
add launch helper for keyboard tool
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@4647 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 31, 2013
1 parent 537250f commit a05c74c
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 2 deletions.
78 changes: 78 additions & 0 deletions osx/Keyboard_Tool
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/sh

exe_name=$(basename $0)
full_path=$(cd "$(dirname "$0")"; pwd)

tmp=`dirname "$full_path"`
bundle=`dirname "$tmp"`
bundle_contents="$bundle"/Contents
bundle_res="$bundle_contents"/Resources
bundle_lib="$bundle_res"/lib
bundle_bin="$bundle_res"/bin
bundle_data="$bundle_res"/share
bundle_etc="$bundle_res"/etc

export DYLD_LIBRARY_PATH="$bundle_lib"
export XDG_CONFIG_DIRS="$bundle_etc"/xdg
export XDG_DATA_DIRS="$bundle_data"
export GTK_DATA_PREFIX="$bundle_res"
export GTK_EXE_PREFIX="$bundle_res"
export GTK_PATH="$bundle_res"

export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
export PANGO_LIBDIR="$bundle_lib"
export PANGO_SYSCONFDIR="$bundle_etc"

export GST_PLUGIN_PATH="$bundle_lib/gstreamer-0.10"
export GST_PLUGIN_SCANNER="$bundle_contents/Helpers/gst-plugin-scanner"

#Set $PYTHON to point inside the bundle
#This is not the real "python" but a copy of it named "xpra"
#This is hacked together in make-app.sh
export PYTHON="$bundle_bin/Xpra"
export PYTHONHOME="$bundle_res"
#Add the bundle's python modules
PYTHONPATH="$bundle_lib:$PYTHONPATH"
PYTHONPATH="$bundle_lib/python/lib-dynload/:$PYTHONPATH"
PYTHONPATH="$bundle_lib/python/:$PYTHONPATH"
PYTHONPATH="$bundle_lib/pygtk/2.0:$PYTHONPATH"
export PYTHONPATH

# We need a UTF-8 locale.
lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null`
if test "$?" != "0"; then
lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'`
fi
LANG=""
if test "$lang" != ""; then
LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \
tail -n1 | sed 's/\./ /' | awk '{print $2}'`"
fi
if test "$LANG" == ""; then
export LANG="C"
else
export LANG="$LANG.utf8"
fi

if test -f "$bundle_lib/charset.alias"; then
export CHARSETALIASDIR="$bundle_lib"
fi

# Extra arguments can be added in environment.sh.
EXTRA_ARGS=
if test -f "$bundle_res/environment.sh"; then
source "$bundle_res/environment.sh"
fi


args="[\"xpra\""
while (($#)); do
args="$args,\"$1\""
shift
done
args="$args]"

exec "$PYTHON" -c "import sys;sys.argv[0]=\"$full_path/$exe_name\";from xpra.gtk_common.gtk_view_keyboard import main;main()"
7 changes: 5 additions & 2 deletions osx/make-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ echo
echo "*******************************************************************************"
echo "Add xpra/server/python scripts"
cp ./Python "${HELPERS_DIR}/"
cp ./xpra "${HELPERS_DIR}/"
cp ./Xpra "${HELPERS_DIR}/"
cp ./Keyboard_Tool "${HELPERS_DIR}/"
cp ./SSH_ASKPASS "${HELPERS_DIR}/"
# copy "python" as "xpra" and "Xpra_Launcher" so we can have a process that is not called "python"...
# copy "python" binary as another name so we can have a process that is not called "python"
# for each one of the tools we provide a script for:
cp "${RSCDIR}/bin/python" "${RSCDIR}/bin/Xpra"
cp "${RSCDIR}/bin/python" "${RSCDIR}/bin/Xpra_Launcher"
cp "${RSCDIR}/bin/python" "${RSCDIR}/bin/Keyboard_Tool"
#we dont need the wrapper installed by distutils:
rm "${MACOS_DIR}/Xpra_Launcher-bin"

Expand Down

0 comments on commit a05c74c

Please sign in to comment.