Skip to content

Commit f2f0f73

Browse files
committed
Standalone mode for the main script
Missing dependencies are downloaded from the web when missing, e.g. excludelist and patchelf.
1 parent 10279f7 commit f2f0f73

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

linuxdeploy-plugin-python.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PIP_OPTIONS="${PIP_OPTIONS:---upgrade}"
1313
PIP_REQUIREMENTS="${PIP_REQUIREMENTS:-}"
1414
PYTHON_BUILD_DIR="${PYTHON_BUILD_DIR:-}"
1515
PYTHON_CONFIG="${PYTHON_CONFIG:-}"
16-
version="3.7.3"
16+
version="3.8.2"
1717
PYTHON_SOURCE="${PYTHON_SOURCE:-https://www.python.org/ftp/python/${version}/Python-${version}.tgz}"
1818

1919
script=$(readlink -f $0)
@@ -158,6 +158,7 @@ cd "$APPDIR/${prefix}/bin"
158158
set +e
159159
pythons=$(ls "python" "python"? "python"?"."? "python"?"."?"m" 2>/dev/null)
160160
set -e
161+
mkdir -p "$APPDIR/usr/bin"
161162
cd "$APPDIR/usr/bin"
162163
for python in $pythons
163164
do
@@ -185,7 +186,12 @@ cp "$BASEDIR/share/sitecustomize.py" "$APPDIR"/${prefix}/lib/python*/site-packag
185186

186187

187188
# Patch binaries and install dependencies
188-
excludelist=$(cat "${BASEDIR}/share/excludelist" | sed 's|#.*||g' | sed -r '/^\s*$/d')
189+
excludelist="${BASEDIR}/share/excludelist"
190+
if [ ! -f "${excludelist}" ]; then
191+
wget -cq --no-check-certificate "https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist"
192+
excludelist="excludelist"
193+
fi
194+
excludelist=$(cat "${excludelist}" | sed 's|#.*||g' | sed -r '/^\s*$/d')
189195

190196
is_excluded () {
191197
local e
@@ -199,6 +205,12 @@ set +e
199205
patchelf=$(command -v patchelf)
200206
set -e
201207
patchelf="${patchelf:-${BASEDIR}/usr/bin/patchelf}"
208+
if [ ! -f "${patchelf}" ]; then
209+
ARCH="${ARCH:-x86_64}"
210+
wget -cq https://github.com/niess/patchelf.appimage/releases/download/${ARCH}/patchelf-${ARCH}.AppImage
211+
patchelf="$(pwd)/patchelf-${ARCH}.AppImage"
212+
chmod u+x "${patchelf}"
213+
fi
202214

203215
patch_binary() {
204216
local name="$(basename $1)"

0 commit comments

Comments
 (0)