diff --git a/linuxdeploy-plugin-python.sh b/linuxdeploy-plugin-python.sh index 03460c9..fd9a38c 100755 --- a/linuxdeploy-plugin-python.sh +++ b/linuxdeploy-plugin-python.sh @@ -13,14 +13,14 @@ PIP_OPTIONS="${PIP_OPTIONS:---upgrade}" PIP_REQUIREMENTS="${PIP_REQUIREMENTS:-}" PYTHON_BUILD_DIR="${PYTHON_BUILD_DIR:-}" PYTHON_CONFIG="${PYTHON_CONFIG:-}" -version="3.8.2" -PYTHON_SOURCE="${PYTHON_SOURCE:-https://www.python.org/ftp/python/${version}/Python-${version}.tgz}" +PYTHON_VERSION="${PYTHON_VERSION:-3.10.12}" +PYTHON_SOURCE="${PYTHON_SOURCE:-https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz}" script=$(readlink -f $0) exe_name="$(basename ${APPIMAGE:-$script})" BASEDIR="${APPDIR:-$(readlink -m $(dirname $script))}" -prefix="usr/python" +prefix="usr" # Parse the CLI @@ -111,7 +111,7 @@ fi # Install Python from source, if not already in the AppDir set +e -python=$(ls "${APPDIR}/${prefix}/bin/python"?"."?) +python=$(ls "${APPDIR}/${prefix}/bin/python"?"."*|grep "[0-9]$") set -e if [[ -x "${python}" ]]; then @@ -149,7 +149,7 @@ else fi cd "${APPDIR}/${prefix}/bin" -PYTHON_X_Y=$(ls "python"?"."?) +PYTHON_X_Y=$(ls "python"?"."*|grep "[0-9]$") # Install any extra requirements with pip @@ -167,21 +167,21 @@ rm -rf "bin/python"*"-config" "bin/idle"* "lib/pkgconfig" \ # Wrap the Python executables -cd "$APPDIR/${prefix}/bin" -set +e -pythons=$(ls "python" "python"? "python"?"."? "python"?"."?"m" 2>/dev/null) -set -e -mkdir -p "$APPDIR/usr/bin" -cd "$APPDIR/usr/bin" -for python in $pythons -do - if [[ ! -L "$python" ]]; then - strip "$APPDIR/${prefix}/bin/${python}" - cp "${BASEDIR}/share/python-wrapper.sh" "$python" - sed -i "s|[{][{]PYTHON[}][}]|$python|g" "$python" - sed -i "s|[{][{]PREFIX[}][}]|$prefix|g" "$python" - fi -done +#cd "$APPDIR/${prefix}/bin" +#set +e +#pythons=$(ls "python" "python"? "python"?"."? "python"?"."?"m" 2>/dev/null) +#set -e +#mkdir -p "$APPDIR/usr/bin" +#cd "$APPDIR/usr/bin" +#for python in $pythons +#do +# if [[ ! -L "$python" ]]; then +# strip "$APPDIR/${prefix}/bin/${python}" +# cp "${BASEDIR}/share/python-wrapper.sh" "$python" +# sed -i "s|[{][{]PYTHON[}][}]|$python|g" "$python" +# sed -i "s|[{][{]PREFIX[}][}]|$prefix|g" "$python" +# fi +#done # Sanitize the shebangs of local Python scripts @@ -195,11 +195,11 @@ done # Set a hook in Python for cleaning the path detection -cp "$BASEDIR/share/sitecustomize.py" "$APPDIR"/${prefix}/lib/python*/site-packages +cp "$BASEDIR/sitecustomize.py" "$APPDIR"/${prefix}/lib/python*/site-packages # Patch binaries and install dependencies -excludelist="${BASEDIR}/share/excludelist" +excludelist="${BASEDIR}/excludelist" if [[ ! -f "${excludelist}" ]]; then pushd "${BASEDIR}" wget -cq --no-check-certificate "https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist" @@ -275,16 +275,16 @@ find "lib-dynload" -name '*.so' -type f | while read file; do patch_binary "${fi # Copy any TCl/Tk shared data -if [[ ! -d "${APPDIR}/${prefix}/share/tcltk" ]]; then - if [[ -d "/usr/share/tcltk" ]]; then - mkdir -p "${APPDIR}/${prefix}/share" - cp -r "/usr/share/tcltk" "${APPDIR}/${prefix}/share" - else - mkdir -p "${APPDIR}/${prefix}/share/tcltk" - tclpath="$(ls -d /usr/share/tcl* | tail -1)" - tkpath="$(ls -d /usr/share/tk* | tail -1)" - for path in "${tclpath}" "${tkpath}"; do - cp -r "${path}" "${APPDIR}/${prefix}/share/tcltk" - done - fi -fi +#if [[ ! -d "${APPDIR}/${prefix}/share/tcltk" ]]; then +# if [[ -d "/usr/share/tcltk" ]]; then +# mkdir -p "${APPDIR}/${prefix}/share" +# cp -r "/usr/share/tcltk" "${APPDIR}/${prefix}/share" +# else +# mkdir -p "${APPDIR}/${prefix}/share/tcltk" +# tclpath="$(ls -d /usr/share/tcl* | tail -1)" +# tkpath="$(ls -d /usr/share/tk* | tail -1)" +# for path in "${tclpath}" "${tkpath}"; do +# cp -r "${path}" "${APPDIR}/${prefix}/share/tcltk" +# done +# fi +#fi