diff options
| author | René de Hesselle <dehesselle@web.de> | 2019-09-23 21:54:51 +0000 |
|---|---|---|
| committer | René de Hesselle <dehesselle@web.de> | 2019-09-23 21:57:06 +0000 |
| commit | 92d0b9e68f1d9b3629076aa527bc7628cbd4777e (patch) | |
| tree | 476f3d93faa9342358f991952cb9e29e7588ab46 /packaging | |
| parent | CMake/MSYS2: Pre-compile python byte-code (.pyc files) (diff) | |
| download | inkscape-92d0b9e68f1d9b3629076aa527bc7628cbd4777e.tar.gz inkscape-92d0b9e68f1d9b3629076aa527bc7628cbd4777e.zip | |
Precompile Python packages
Remove test files from Python.framework.
Fix lxml dependencies.
Add libexslt to application bundle.
Fix Pycairo getting overwritten by PyGObject.
Fix line numbers in echo statements being off by 1.
Diffstat (limited to 'packaging')
| -rw-r--r-- | packaging/macos/030-funcs.sh | 9 | ||||
| -rwxr-xr-x | packaging/macos/220-inkscape-package.sh | 30 | ||||
| -rw-r--r-- | packaging/macos/inkscape.bundle | 3 |
3 files changed, 29 insertions, 13 deletions
diff --git a/packaging/macos/030-funcs.sh b/packaging/macos/030-funcs.sh index 74254f164..c5b8339e4 100644 --- a/packaging/macos/030-funcs.sh +++ b/packaging/macos/030-funcs.sh @@ -256,11 +256,10 @@ function readlinkf function run_annotated { - # The newlines in the last 'sed' statement are significant! - - sed 's/\(^### .* ###\).*/echo \-e "\\033[1;44m\\033[1;37m['$SELF_NAME':$(printf '%03d' $LINENO)] \1\\033[0m"/g' $SELF_DIR/$SELF_NAME | sed 's/^run_annotated/#run_annotated/' | sed '/SELF_DIR=/a\ -SELF_DIR='$SELF_DIR'\ -' | bash + sed 's/\(^### .* ###\).*/echo \-e "\\033[1;44m\\033[1;37m['$SELF_NAME':$(printf '%03d' $LINENO)] \1\\033[0m"/g' $SELF_DIR/$SELF_NAME | + sed 's/^run_annotated/#run_annotated/' | + sed 's/^SELF_DIR=.*/SELF_DIR='$(escape_sed $SELF_DIR)'/' | + bash exit $? } diff --git a/packaging/macos/220-inkscape-package.sh b/packaging/macos/220-inkscape-package.sh index a87e12fea..851c7ec50 100755 --- a/packaging/macos/220-inkscape-package.sh +++ b/packaging/macos/220-inkscape-package.sh @@ -102,9 +102,14 @@ mv inkscape.icns $APP_RES_DIR mkdir $APP_FRA_DIR get_source file://$SRC_DIR/$(basename $URL_PYTHON3_BIN) $APP_FRA_DIR +# remove 'test' folder to save space +rm -rf $APP_FRA_DIR/Python.framework/Versions/Current/lib/python3.7/test + # add it to '$PATH' in launch script insert_before $APP_EXE_DIR/Inkscape '\$EXEC' 'export PATH=$bundle_contents/Frameworks/Python.framework/Versions/Current/bin:$PATH' -# add it to '$PATH' here and now (for package installation below) +# Add it to '$PATH' here and now (for package installation below). This is an +# exception: normally we'd not change the global environment but fence it +# using subshells. export PATH=$APP_FRA_DIR/Python.framework/Versions/Current/bin:$PATH # create '.pth' file inside Framework to include our site-packages directory @@ -121,21 +126,18 @@ echo "./../../../../../../../Resources/lib/python3.7/site-packages" > $APP_FRA_D # patch 'etree' relocate_dependency @loader_path/../../../libxml2.2.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/etree.cpython-37m-darwin.so relocate_dependency @loader_path/../../../libz.1.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/etree.cpython-37m-darwin.so +relocate_dependency @loader_path/../../../libxslt.1.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/etree.cpython-37m-darwin.so +relocate_dependency @loader_path/../../../libexslt.0.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/etree.cpython-37m-darwin.so # patch 'objectify' relocate_dependency @loader_path/../../../libxml2.2.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/objectify.cpython-37m-darwin.so relocate_dependency @loader_path/../../../libz.1.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/objectify.cpython-37m-darwin.so +relocate_dependency @loader_path/../../../libxslt.1.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/objectify.cpython-37m-darwin.so +relocate_dependency @loader_path/../../../libexslt.0.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/objectify.cpython-37m-darwin.so ### install Python package: NumPy ############################################## pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_NUMPY -### install Python package: Pycairo ############################################ - -pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_PYCAIRO - -# patch '_cairo' -relocate_dependency @loader_path/../../../libcairo.2.dylib $APP_LIB_DIR/python3.7/site-packages/cairo/_cairo.cpython-37m-darwin.so - ### install Python package: PyGObject ########################################## pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_PYGOBJECT @@ -158,6 +160,14 @@ relocate_dependency @loader_path/../../../libffi.6.dylib $APP_LIB_DIR/python3.7/ relocate_dependency @loader_path/../../../libcairo.2.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so relocate_dependency @loader_path/../../../libcairo-gobject.2.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so +### install Python package: Pycairo ############################################ + +# PyGObject pulls in Pycairo, so not going to install again. +#pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_PYCAIRO + +# patch '_cairo' +relocate_dependency @loader_path/../../../libcairo.2.dylib $APP_LIB_DIR/python3.7/site-packages/cairo/_cairo.cpython-37m-darwin.so + ### install Python package: pySerial ########################################### pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_PYSERIAL @@ -166,6 +176,10 @@ pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_SCOUR +### precompile all Python packages ############################################# + +python3 -m compileall -f $APP_DIR || true + ### set default Python interpreter ############################################# # If no override is present in 'preferences.xml' (see diff --git a/packaging/macos/inkscape.bundle b/packaging/macos/inkscape.bundle index fcb04bfeb..d9322add7 100644 --- a/packaging/macos/inkscape.bundle +++ b/packaging/macos/inkscape.bundle @@ -78,6 +78,9 @@ ${prefix}/lib/inkscape/libinkscape_base.dylib </binary> <binary> + ${prefix}/lib/libexslt.0.dylib + </binary> + <binary> ${prefix}/lib/libssl.1.1.dylib </binary> <binary> |
