appimage build: better parameterise python version
This commit is contained in:
@@ -8,4 +8,4 @@ export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${APPDIR}/usr/lib/x86_64-linux-gnu${L
|
|||||||
export PATH="${APPDIR}/usr/bin:${PATH}"
|
export PATH="${APPDIR}/usr/bin:${PATH}"
|
||||||
export LDFLAGS="-L${APPDIR}/usr/lib/x86_64-linux-gnu -L${APPDIR}/usr/lib"
|
export LDFLAGS="-L${APPDIR}/usr/lib/x86_64-linux-gnu -L${APPDIR}/usr/lib"
|
||||||
|
|
||||||
exec "${APPDIR}/usr/bin/python3.9" -s "${APPDIR}/usr/bin/electrum" "$@"
|
exec "${APPDIR}/usr/bin/python3" -s "${APPDIR}/usr/bin/electrum" "$@"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export GCC_STRIP_BINARIES="1"
|
|||||||
|
|
||||||
# pinned versions
|
# pinned versions
|
||||||
PYTHON_VERSION=3.9.11
|
PYTHON_VERSION=3.9.11
|
||||||
|
PY_VER_MAJOR="3.9" # as it appears in fs paths
|
||||||
PKG2APPIMAGE_COMMIT="a9c85b7e61a3a883f4a35c41c5decb5af88b6b5d"
|
PKG2APPIMAGE_COMMIT="a9c85b7e61a3a883f4a35c41c5decb5af88b6b5d"
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ tar xf "$CACHEDIR/Python-$PYTHON_VERSION.tar.xz" -C "$BUILDDIR"
|
|||||||
# to result in a different output on macOS compared to Linux. We simply patch
|
# to result in a different output on macOS compared to Linux. We simply patch
|
||||||
# sysconfigdata to remove the extension.
|
# sysconfigdata to remove the extension.
|
||||||
# Some more info: https://bugs.python.org/issue27631
|
# Some more info: https://bugs.python.org/issue27631
|
||||||
sed -i -e 's/\.exe//g' "$APPDIR"/usr/lib/python3.9/_sysconfigdata*
|
sed -i -e 's/\.exe//g' "${APPDIR}/usr/lib/python${PY_VER_MAJOR}"/_sysconfigdata*
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ appdir_python() {
|
|||||||
env \
|
env \
|
||||||
PYTHONNOUSERSITE=1 \
|
PYTHONNOUSERSITE=1 \
|
||||||
LD_LIBRARY_PATH="$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}" \
|
LD_LIBRARY_PATH="$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}" \
|
||||||
"$APPDIR/usr/bin/python3.9" "$@"
|
"$APPDIR/usr/bin/python${PY_VER_MAJOR}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
python='appdir_python'
|
python='appdir_python'
|
||||||
@@ -159,7 +160,7 @@ info "finalizing AppDir."
|
|||||||
move_lib
|
move_lib
|
||||||
|
|
||||||
# apply global appimage blacklist to exclude stuff
|
# apply global appimage blacklist to exclude stuff
|
||||||
# move usr/include out of the way to preserve usr/include/python3.9m.
|
# move usr/include out of the way to preserve usr/include/python${PY_VER_MAJOR}.
|
||||||
mv usr/include usr/include.tmp
|
mv usr/include usr/include.tmp
|
||||||
delete_blacklisted
|
delete_blacklisted
|
||||||
mv usr/include.tmp usr/include
|
mv usr/include.tmp usr/include
|
||||||
@@ -182,7 +183,7 @@ strip_binaries()
|
|||||||
{
|
{
|
||||||
chmod u+w -R "$APPDIR"
|
chmod u+w -R "$APPDIR"
|
||||||
{
|
{
|
||||||
printf '%s\0' "$APPDIR/usr/bin/python3.9"
|
printf '%s\0' "$APPDIR/usr/bin/python${PY_VER_MAJOR}"
|
||||||
find "$APPDIR" -type f -regex '.*\.so\(\.[0-9.]+\)?$' -print0
|
find "$APPDIR" -type f -regex '.*\.so\(\.[0-9.]+\)?$' -print0
|
||||||
} | xargs -0 --no-run-if-empty --verbose strip -R .note.gnu.build-id -R .comment
|
} | xargs -0 --no-run-if-empty --verbose strip -R .note.gnu.build-id -R .comment
|
||||||
}
|
}
|
||||||
@@ -197,7 +198,7 @@ remove_emptydirs
|
|||||||
|
|
||||||
info "removing some unneeded stuff to decrease binary size."
|
info "removing some unneeded stuff to decrease binary size."
|
||||||
rm -rf "$APPDIR"/usr/{share,include}
|
rm -rf "$APPDIR"/usr/{share,include}
|
||||||
PYDIR="$APPDIR"/usr/lib/python3.9
|
PYDIR="$APPDIR/usr/lib/python${PY_VER_MAJOR}"
|
||||||
rm -rf "$PYDIR"/{test,ensurepip,lib2to3,idlelib,turtledemo}
|
rm -rf "$PYDIR"/{test,ensurepip,lib2to3,idlelib,turtledemo}
|
||||||
rm -rf "$PYDIR"/{ctypes,sqlite3,tkinter,unittest}/test
|
rm -rf "$PYDIR"/{ctypes,sqlite3,tkinter,unittest}/test
|
||||||
rm -rf "$PYDIR"/distutils/{command,tests}
|
rm -rf "$PYDIR"/distutils/{command,tests}
|
||||||
|
|||||||
Reference in New Issue
Block a user