-
Notifications
You must be signed in to change notification settings - Fork 4
/
bundle.sh
executable file
·44 lines (32 loc) · 1.44 KB
/
bundle.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
set -e
source env.sh
echo compiling native launcher...
echo 'clang -mmacosx-version-min=10.9 -L$PREFIX/lib `python3-config --cflags --ldflags --embed` -o $PREFIX/bin/python-launcher misc/bundle/launcher.c'| jhbuild shell
echo creating app...
jhbuild run gtk-mac-bundler misc/bundle/pythonbase.bundle
echo post-processing...
APP="$QL_OSXBUNDLE_BUNDLE_DEST/pythonbase.app"
APP_PREFIX="$APP"/Contents/Resources
JHBUILD_PREFIX="$HOME/gtk/inst"
mydir=`pwd`
CMDS="run-pip run-python"
for cmd in ${CMDS}; do
cp -a "$APP"/Contents/MacOS/{pythonbase,$cmd}
if [ -e "$QL_OSXBUNDLE_BUNDLE_DEST/$cmd" ]; then
unlink "$QL_OSXBUNDLE_BUNDLE_DEST/$cmd"
fi
ln -s $(basename "$APP")/Contents/MacOS/$cmd "$QL_OSXBUNDLE_BUNDLE_DEST/"
done
# kill some useless files
rm -Rf "$APP_PREFIX"/lib/python3.11/test
rm -Rvf "$APP_PREFIX"/lib/python3.11/*/test
rm -f "$APP_PREFIX"/lib/python3.11/config/libpython3.11.a
find "$APP_PREFIX"/lib/python3.11 -name '*.pyc' -delete
find "$APP_PREFIX"/lib/python3.11 -name '*.pyo' -delete
echo checking for dynamic linking consistency : nothing should reference gtk/inst
find "$APP_PREFIX" -name '*.so' -and -print -and -exec sh -c 'otool -L $1 | grep /gtk/inst' '{}' '{}' ';'
# make openssl option dir to prevent looking into /etc
mkdir -p "$APP_PREFIX/etc/openssl"
# list the provenance of every file in the bundle
$mydir/misc/provenance.pl "$JHBUILD_PREFIX" "$APP" > "$QL_OSXBUNDLE_BUNDLE_DEST"/pythonbase.contents