Skip to content

Commit f9a326a

Browse files
committed
Add a dedicated AppRun
Note that PYTHON_ENTRYPOINT has been relocated to AppRun. Use the the APPRUN_ENTRYPOINT option instead (e.g. see xonsh recipe).
1 parent 22451af commit f9a326a

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

appimage/build-python.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ cp "${REPO_ROOT}/appimage/resources/python.desktop" "${name}.desktop"
6969
sed -i "s|[{][{]exe[}][}]|${exe}|g" "${name}.desktop"
7070
sed -i "s|[{][{]name[}][}]|${name}|g" "${name}.desktop"
7171

72+
cp "${REPO_ROOT}/appimage/resources/apprun.sh" "AppRun"
73+
sed -i "s|[{][{]exe[}][}]|${exe}|g" "AppRun"
74+
sed -i "s|[{][{]entrypoint[}][}]|${APPRUN_ENTRYPOINT}|g" "AppRun"
75+
7276
./"${linuxdeploy}" --appdir AppDir \
7377
--plugin python \
7478
-i "${REPO_ROOT}/appimage/resources/python.png" \
7579
-d "${name}.desktop" \
76-
--custom-apprun "AppDir/usr/bin/${exe}" \
80+
--custom-apprun "AppRun" \
7781
--output "appimage"
7882

7983
popd

appimage/recipes/scipy.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
export PYTHON_VERSION="3.8.1"
22
export PIP_REQUIREMENTS="numpy scipy matplotlib sympy pandas"
3-
4-
export LD_LIBRARY_PATH="AppDir/usr/python/lib/python3.8/site-packages/numpy/.libs:${LD_LIBRARY_PATH}"
5-
export LD_LIBRARY_PATH="AppDir/usr/python/lib/python3.8/site-packages/matplotlib/.libs:${LD_LIBRARY_PATH}"

appimage/recipes/xonsh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export PYTHON_VERSION="3.8.1"
22
export PIP_REQUIREMENTS="xonsh prompt_toolkit gnureadline Pygments"
3-
export PYTHON_ENTRYPOINT='"-u" "-c" "from xonsh.main import main; main()"'
3+
export APPRUN_ENTRYPOINT='"-u" "-c" "from xonsh.main import main; main()"'

appimage/resources/apprun.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SCRIPT=`readlink -f -- $0`
4+
SCRIPTPATH=`dirname $SCRIPT`
5+
APPDIR="${APPDIR:-$SCRIPTPATH}"
6+
7+
${APPDIR}/usr/bin/{{exe}} {{entrypoint}} "$@"

linuxdeploy-plugin-python.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ script=$(readlink -f $0)
2020
exe_name="$(basename ${APPIMAGE:-$script})"
2121
BASEDIR="${APPDIR:-$(readlink -m $(dirname $script))}"
2222

23-
PYTHON_ENTRYPOINT="${PYTHON_ENTRYPOINT:-}"
24-
2523
# Parse the CLI
2624
show_usage () {
2725
echo "Usage: ${exe_name} --appdir <path to AppDir>"
@@ -48,9 +46,6 @@ show_usage () {
4846
echo " Provide extra configuration flags for the Python build. Note"
4947
echo " that the install prefix will be overwritten"
5048
echo ""
51-
echo " PYTHON_ENTRYPOINT=\"${PYTHON_ENTRYPOINT}\""
52-
echo " Extra options when calling the python executable"
53-
echo ""
5449
echo " PYTHON_SOURCE=\"${PYTHON_SOURCE}\""
5550
echo " The source to use for Python. Can be a directory, an url or/and"
5651
echo " an archive"
@@ -171,7 +166,6 @@ do
171166
cp "${BASEDIR}/share/python-wrapper.sh" "$python"
172167
sed -i "s|[{][{]PYTHON[}][}]|$python|g" "$python"
173168
sed -i "s|[{][{]PREFIX[}][}]|$prefix|g" "$python"
174-
sed -i "s|[{][{]ENTRYPOINT[}][}]|$PYTHON_ENTRYPOINT|g" "$python"
175169
fi
176170
done
177171

share/python-wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ fi
3838
# Wrap the call to Python in order to mimic a call from the source
3939
# executable ($ARGV0), but potentially located outside of the Python
4040
# install ($PYTHONHOME)
41-
(PYTHONHOME="${APPDIR}/${prefix}" exec -a "${executable}" "$APPDIR/${prefix}/bin/${nickname}" {{ENTRYPOINT}} "$@")
41+
(PYTHONHOME="${APPDIR}/${prefix}" exec -a "${executable}" "$APPDIR/${prefix}/bin/${nickname}" "$@")
4242
exit "$?"

0 commit comments

Comments
 (0)