Conversation
8df6f50 to
07491c6
Compare
This removes some of the wrong, absolute paths pointing to the build location of the AppImage by using a different shebang and some environment variables, set by the linuxdeploy-plugin-conda-hook at the AppImage start. Fixes linuxdeploy#12, fixes linuxdeploy#25 and fixes linuxdeploy#32
|
I've added an additional replacement for 32bit conda installations. |
| # export APPDIR variable to allow for running from extracted AppDir as well | ||
| export APPDIR="${APPDIR:-$(readlink -f "$(dirname "$0")")}" | ||
| # export PATH to allow /usr/bin/env shebangs to use the supplied applications | ||
| export PATH="$APPDIR"/usr/bin:"$PATH" |
There was a problem hiding this comment.
This will break calling any sorts of external tools, because they'll then also have to use all tools contained in the AppDir. Can you think of a different solution perhaps? The use of environment variables like PATH and LD_LIBRARY_PATH is actually an antipattern and has to be done with great care.
To limit the effects, one possible solution would be to create a separate bin dir somewhere in the AppDir that only points to the bundled Python binary/binaries, but none of the other stuff in AppDir/usr/bin. But that's also a hack. I think you could even further limit the effects by generating some sort of unique name for the symlink to the main binary. Then, you can safely use /usr/bin/env linuxdeploy-plugin-conda-python or something like that with bundled tools.
Of course, bundled scripts that just point to /usr/bin/env python would still fail to run. But I'm not sure that issue can be fixed.
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.
Fixes #12, Fixes #25 and Fixes #32
I left out some of the scripts, like:
AppDir/usr/conda/shell/condabin/conda-hook.ps1: No need for PowershellAppDir/usr/conda/conda-meta/*.json: dunno...AppDir/usr/conda/lib/*/*.sh: Some config scripts, not needed I suppose?AppDir/usr/conda/lib/pkgconfig/*.pc: pkg-config files, not needed and no idea how to fix them.AppDir/usr/conda/lib/python3.8/*/*.py: dunno...I only have a base install of conda with no extra packages, so probably not all possible files are covered.
Also some of the regex could be a little bit more sophisticated...