linuxdeploy / linuxdeploy-plugin-conda

Python plugin for linuxdeploy. Sets up miniconda in an AppDir and installs user specified packages.
MIT License
29 stars 13 forks source link

Good candidates for being packaged w/ linuxdeploy-plugin-conda #8

Open probonopd opened 5 years ago

probonopd commented 5 years ago

Good candidates for being packaged w/ linuxdeploy-plugin-conda:

TheAssassin commented 5 years ago

What's the intention behind this "issue"?

probonopd commented 5 years ago

A "note to self" which projects to send PRs ;-)

Vaguely along the lines of

#! /bin/bash

export APPDIR="retext.AppDir"

export PIP_REQUIREMENTS="-e git+https://github.com/retext-project/retext#egg=retext PyQt5"

wget -c https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -c "https://raw.githubusercontent.com/TheAssassin/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh"

chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-conda.sh

rm -r "$APPDIR" || true

cat > retext.desktop <<\EOF
[Desktop Entry]
Version=1.0
Name=ReText
Exec=retext %U
Terminal=false
Type=Application
Icon=retext
Categories=Office;WordProcessor;
MimeType=application/x-extension-md;application/x-extension-rst;
EOF

# set up custom AppRun script
# set up custom AppRun script
cat > AppRun.sh <<\EAT
#! /bin/sh
# make sure to set APPDIR when run directly from the AppDir
if [ -z $APPDIR ]; then APPDIR=$(readlink -f $(dirname "$0")); fi
export LD_LIBRARY_PATH="$APPDIR"/usr/lib
for path in /etc/ssl/ca-bundle.pem \
    /etc/ssl/certs/ca-certificates.crt \
    /etc/ssl/cert.pem /etc/pki/tls/certs/ca-bundle.crt \
    /etc/pki/tls/cert.pem /etc/pki/tls/cacert.pem \
    /usr/local/share/certs/ca-root-nss.crt; do
    if [ -f "$path" ]; then
        export SSL_CERT_FILE="$path"
        break
    fi
done

exec "$APPDIR"/usr/bin/python "$APPDIR"/usr/bin/retext "$@"
EAT
chmod +x AppRun.sh

touch retext.svg
./linuxdeploy-x86_64.AppImage --appdir "$APPDIR" --plugin conda -i retext.svg -d retext.desktop --custom-apprun AppRun.sh --output appimage

(kept here so that it won't be forgotten - credits to @TheAssassin, this is pure magic)

TheAssassin commented 5 years ago

Note for \: the SSL part in the AppRun script isn't strictly necessary, fixed some issues with Pext's plugin system IIRC. See https://github.com/Pext/Pext/blob/e0cf8cfd68827a678317a75226aacb8e23fe1a16/travis/build-appimage.sh#L29 for more information.