"Fossies" - the Fresh Open Source Software Archive

Member "cutter-1.8.2/scripts/appimage_embed_python.sh" (20 May 2019, 948 Bytes) of package /linux/privat/cutter-1.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "appimage_embed_python.sh": 1.7.4_vs_1.8.0.

    1 #!/bin/bash
    2 
    3 if ! [[ $# -eq 1 ]]; then
    4     echo "Usage: $0 [appdir]"
    5     exit 1
    6 fi
    7 
    8 python_version=python3.6
    9 
   10 python_prefix=$(pkg-config --variable=prefix python3)
   11 appdir=$1
   12 
   13 echo "Embedding Python from prefix $python_prefix in appdir $appdir"
   14 
   15 mkdir -p "$appdir/usr"
   16 cd "$appdir/usr/" || exit 1
   17 
   18 cp -RT "$python_prefix" "." || exit 1
   19 echo "Cleaning up embedded Python"
   20 find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
   21 rm -r lib/$python_version/test lib/$python_version/idlelib lib/$python_version/curses lib/$python_version/lib2to3
   22 
   23 echo "Checking if PySide2 is available"
   24 
   25 pyside_prefix=$(pkg-config --variable=prefix pyside2)
   26 if [ $? -ne 0 ]; then
   27     echo "PySide2 is not available, ignoring."
   28     exit 0
   29 fi
   30 
   31 echo "PySide is at $pyside_prefix"
   32 
   33 if [ "$pyside_prefix" == "$python_prefix" ]; then
   34     echo "Prefixes are equal, not copying anything from lib"
   35 else
   36     cp -RT "$pyside_prefix/lib/$python_version" "lib/$python_version" || exit 1
   37 fi