Open probonopd opened 6 years ago
Thanks @TheAssassin for implementing this in https://github.com/TheAssassin/linuxdeploy-plugin-conda.
The following works for me, and produces a working FreeCAD AppImage:
wget -c "https://raw.githubusercontent.com/TheAssassin/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh"
CONDA_PACKAGES=freecad CONDA_CHANNELS=freecad bash -ex ./linuxdeploy-plugin-conda.sh --appdir AppDir
( cd AppDir ; ln -s usr/bin/FreeCAD AppRun )
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod +x linuxdeploy-x86_64.AppImage
mkdir -p AppDir/usr/share/applications/
cat > AppDir/usr/share/applications/freecad.desktop <<\EOF
[Desktop Entry]
Version=1.0
Name=FreeCAD
Name[de]=FreeCAD
Comment=Feature based Parametric Modeler
Comment[de]=Feature-basierter parametrischer Modellierer
GenericName=CAD Application
GenericName[de]=CAD-Anwendung
Exec=FreeCAD %F
Terminal=false
Type=Application
Icon=freecad
Categories=Graphics;Science;Engineering;
StartupNotify=true
GenericName[de_DE]=Feature-basierter parametrischer Modellierer
Comment[de_DE]=Feature-basierter parametrischer Modellierer
MimeType=application/x-extension-fcstd;
EOF
./linuxdeploy-x86_64.AppImage --appdir AppDir -i AppDir/usr/conda/data/Mod/Start/StartPage/freecad.png -d AppDir/usr/share/applications/freecad.desktop --output appimage
./FreeCAD-x86_64.AppImage # Works!
We are 98% there. But e.g., the version number should be carried over from Conda to the AppImage "automagically".
This is not ideal UX wise (not yet, at least), I will post an example how to do it with a single linuxdeploy call that uses the plugin via --plugin conda
.
The plugin is just for bundling a conda environment and installing packages. Versioning is out of scope. All it does is bundle user-specified packages into a conda environment in a reproducible and comprehensible way. It's minimalistic, and really good at what it does right now. That's the UNIX philosophy.
However, it could be done by a shell script called conda2appimage.sh
at some point. I guess some call to AppDir/usr/conda/bin/conda ...
will provide the information you're looking for. Add linuxdeploy and linuxdeploy-plugin-conda to the mix, and with just a few lines of bash you should be able to get what you're looking for.
Actually, instead of a separate conda2appimage
command, we should make the existing pkg2appimage
aware of Conda, using the existing yml files, but specifying Conda rather than deb ingredients.
Sure, however you like it. Perhaps we should consider replacing all the functions.sh
stuff which is not really maintained (copy_deps
etc.) with linuxdeploy.
Could it be that this last comment belongs to another issue @TheAssassin?
Yes, deleted it, will move it there. Thanks for the hint.
Similar to pkg2appimage, we could possibly make conda2appimage. Any volunteers?