From 6ea813a9f66e85d6b31748975efcac5fb8ad006f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sat, 14 Apr 2018 15:21:35 +0200 Subject: [PATCH] Move Python embedding for AppImage to scripts/ --- .travis.yml | 6 +----- scripts/appimage_embed_python.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100755 scripts/appimage_embed_python.sh diff --git a/.travis.yml b/.travis.yml index e176fb12..070587dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,11 +84,7 @@ after_success: sudo make INSTALL_ROOT=appdir install && sudo chown -R $USER appdir && cp -r /usr/share/radare2 appdir/usr/share/ && - cp -RT "$CUSTOM_PYTHON_PREFIX" appdir/usr/ && - cd appdir/usr/ && - find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf && - rm -r lib/python3.6/test lib/python3.6/idlelib lib/python3.6/curses lib/python3.6/lib2to3 && - cd ../.. && + "$TRAVIS_BUILD_DIR/scripts/appimage_embed_python.sh" "$CUSTOM_PYTHON_PREFIX" appdir && wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" && chmod a+x linuxdeployqt*.AppImage && unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH && diff --git a/scripts/appimage_embed_python.sh b/scripts/appimage_embed_python.sh new file mode 100755 index 00000000..17ea59f1 --- /dev/null +++ b/scripts/appimage_embed_python.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if ! [[ $# -eq 2 ]]; then + echo "Usage: $0 [Python prefix] [appdir]" + exit 1 +fi + +python_prefix=$1 +appdir=$2 + +echo "Embedding Python from prefix $python_prefix in appdir $appdir" + +cp -RT "$python_prefix" "$appdir/usr/" || exit 1 +cd "$appdir/usr/" || exit 1 + +echo "Cleaning up embedded Python" +find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf +rm -r lib/python3.6/test lib/python3.6/idlelib lib/python3.6/curses lib/python3.6/lib2to3 \ No newline at end of file