Skip to content

Commit fccc2fd

Browse files
committed
#4794 go back to shell scripts, easier
1 parent 1929430 commit fccc2fd

File tree

5 files changed

+14
-106
lines changed

5 files changed

+14
-106
lines changed

packaging/MacOS/Helpers/Python

Lines changed: 0 additions & 8 deletions
This file was deleted.

packaging/MacOS/Helpers/PythonExecWrapper

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
# which is used on OSX as the default application name
88
# as shown in the global menu.
99

10-
APPNAME=$(echo "$1" | sed 's+_+ +g')
10+
BINNAME="$1"
11+
APPNAME=$(echo "${BINNAME}" | sed 's+_+ +g')
1112
if [ -z "$APPNAME" ]; then
1213
echo "usage $0 APPNAME [args ..]"
1314
exit 1
1415
fi
1516
shift
17+
MODULE="$1"
18+
shift
1619

1720

1821
full_path=$(cd "$(dirname "$0")"; pwd)
@@ -108,4 +111,5 @@ if test "$LANG" == "C"; then
108111
fi
109112
fi
110113

111-
exec "$PYTHON" "${APPNAME}" "$@"
114+
115+
exec "$PYTHON" "-c" "import sys;sys.argv[0]='${full_path}/${BINNAME}';from ${MODULE} import main;sys.exit(main(sys.argv))" "$@"

packaging/MacOS/launcher.c

Lines changed: 0 additions & 84 deletions
This file was deleted.

packaging/MacOS/make-app.sh

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ git checkout "./Info.plist" "./Xpra_NoDock.app/Contents/Info.plist" >& /dev/null
126126
echo "*******************************************************************************"
127127
PYVERSIONSTR="${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION}"
128128
echo "Building Xpra for Python ${PYVERSIONSTR} using $NPROC logical CPUs"
129-
echo "- building C launcher shim"
130-
rm -f "${MACOS_SCRIPT_DIR}/launcher"
131-
gcc -o "${MACOS_SCRIPT_DIR}/launcher" "${MACOS_SCRIPT_DIR}/launcher.c" -I"${JHBUILD_PREFIX}/include/python${PYVERSIONSTR}" -L"${JHBUILD_PREFIX}/lib" "-lpython${PYVERSIONSTR}" -Wl,-rpath,"@executable_path/.."
132-
133129
cd "${XPRA_SRC_DIR}" || exit 1
134130
echo "- regenerate source and build info"
135131
rm -f "xpra/src_info.py" "xpra/build_info.py"
@@ -294,17 +290,14 @@ cp "${SITELIB}/uvloop/_noop.py" "${PYDIR}/uvloop/"
294290

295291
echo "- add xpra/server/python helper scripts"
296292
rsync -plt "${MACOS_SCRIPT_DIR}/Helpers/"* "${HELPERS_DIR}/"
297-
#we dont need the wrappers that may have been installed by distutils:
293+
# we dont need the wrappers that may have been installed by distutils:
298294
rm -f "${MACOS_DIR}/*bin"
299-
#add our own one:
300-
mv "${MACOS_SCRIPT_DIR}/launcher" "${FRAMEWORKS_DIR}/bin/Xpra"
301-
#ensure they all have a symlink to the helper name:
295+
# ensure they all have a symlink to the Python interpreter for each helper
296+
# (using the "pretty" name, converting underscores to spaces)
302297
for helper in "${HELPERS_DIR}/"*; do
303298
filename=$(basename "${helper}")
304299
name=${filename//_/ }
305-
if [ "${name}" != "Xpra" ]; then
306-
ln -sf "./Xpra" "${FRAMEWORKS_DIR}/bin/${name}"
307-
fi
300+
ln -sf "./Python" "${FRAMEWORKS_DIR}/bin/${name}"
308301
done
309302

310303
# overwrite the "Xpra" script generated by py2app with our custom one:

packaging/MacOS/sign-app.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ if [ -d "${X11_DIR}/bin" ]; then
5959
sign_runtime "${X11_DIR}/lib/dri/"*
6060
fi
6161
echo " Frameworks/bin"
62-
sign_runtime "${CONTENTS_DIR}/Frameworks/bin/"*
62+
# only sign the actual binaries / unique scripts, not the symlinks:
63+
for bin in Python daemonizer gst-inspect-1.0 gst-launch-1.0 gst-plugin-scanner sshpass xpra_signal_listener; do
64+
sign_runtime "${CONTENTS_DIR}/Frameworks/bin/${bin}"
65+
done
6366
echo " Helpers"
6467
sign_runtime "${CONTENTS_DIR}/Helpers/"*
6568
echo " MacOS/Xpra"

0 commit comments

Comments
 (0)