From 0dcfd10c4b56905c57b6a8b305e808308ed06901 Mon Sep 17 00:00:00 2001 From: Valentin Niess Date: Tue, 19 May 2020 22:05:33 +0200 Subject: [PATCH] Export ARCH when building the AppImage --- README.md | 10 +++++----- python_appimage/appimage/build.py | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ba86aaf..7bb87cf 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ single file and changing its mode to executable, e.g. as: ```sh wget https://github.com/niess/python-appimage/releases/download/\ -python3.8/python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage -chmod +x python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage +python3.8/python3.8.3-cp38-cp38-manylinux1_x86_64.AppImage +chmod +x python3.8.3-cp38-cp38-manylinux1_x86_64.AppImage -./python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage +./python3.8.3-cp38-cp38-manylinux1_x86_64.AppImage ``` This should start a Python 3.8 interactive session on _almost_ any Linux @@ -30,9 +30,9 @@ its standard library. However, if you plan to install extra packages we recommend extracting the AppImage, e.g. as: ```sh -./python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage --appimage-extract +./python3.8.3-cp38-cp38-manylinux1_x86_64.AppImage --appimage-extract mv squashfs-root python3.8 -rm -f python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage +rm -f python3.8.3-cp38-cp38-manylinux1_x86_64.AppImage export PATH="$(pwd)/python3.8/usr/bin:$PATH" ``` diff --git a/python_appimage/appimage/build.py b/python_appimage/appimage/build.py index 967cdcc..a57ed0d 100644 --- a/python_appimage/appimage/build.py +++ b/python_appimage/appimage/build.py @@ -1,4 +1,5 @@ import os +import platform import re import subprocess import sys @@ -23,7 +24,8 @@ def build_appimage(appdir=None, destination=None): log('BUILD', appdir) ensure_appimagetool() - cmd = [APPIMAGETOOL, '--no-appstream', appdir] + arch = platform.machine() + cmd = ['ARCH=' + arch, APPIMAGETOOL, '--no-appstream', appdir] if destination is not None: cmd.append(destination) cmd = ' '.join(cmd)