Just wanted to report it's quite easy to create a portable AppImage from an isolated calibre install (once you know what to do, that is), with multi-binary support included. That is, after following these steps, you get a compressed AppImage which can be called as /usr/local/bin/calibre, .../ebook-viewer, .../ebook-meta etc (busybox-style).
All in all, packaging calibre didn't require much hacking, so I'm hopeful this recipe should work for future upgrades.
1. Follow the official isolated install instructions (I'm unpacking to /tmp, use /opt or ~/calibre-bin depending on your circumstances):
Code:
wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin install_dir=/tmp isolated=y
2. Minimal customization
Code:
cd /tmp/calibre
ln -s resources/images/apple-touch-icon.png calibre.png
cat >AppRun <<'EOF'
#!/bin/sh
mybin=$(cd "$APPDIR"; mybin=$(basename "$ARGV0"); if test -x "$mybin"; then echo "$mybin"; else echo calibre; fi)
"$APPDIR/$mybin" "$@"
EOF
chmod +x AppRun
# desktop file as seen in Debian; only Icon= and Exec= really matter
cat >calibre.desktop <<'EOF'
[Desktop Entry]
Version=1.0
Type=Application
Name=calibre
GenericName=calibre E-book library management
Exec=calibre %F
Icon=calibre
Categories=Office;
X-GNOME-UsesNotifications=true
MimeType=text/plain;application/x-mobipocket-subscription;application/vnd.openxmlformats-officedocument.wordprocessingml.document;text/html;application/x-cbc;application/ereader;application/oebps-package+xml;image/vnd.djvu;application/x-sony-bbeb;application/vnd.ms-word.document.macroenabled.12;text/rtf;text/x-markdown;application/pdf;application/x-cbz;application/x-cbr;application/x-mobi8-ebook;text/fb2+xml;application/vnd.oasis.opendocument.text;application/epub+zip;application/x-mobipocket-ebook;application/xhtml+xml;
EOF
3. Build the appimage -- could take a while
Code:
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o /tmp/appimagetool
chmod +x /tmp/appimagetool
/tmp/appimagetool /tmp/calibre/ /usr/local/bin/calibre-x86_64.AppImage
4. Create executables, clean up:
Code:
(for f in *; do test -x "$f" && test -f "$f" && sudo ln -sf /usr/local/bin/calibre-x86_64.AppImage /usr/local/bin/"$f"; done)
cd
rm -rf /tmp/calibre-installer-cache/ /tmp/calibre /usr/local/bin/AppRun
On my system I get a portable 144M AppImage, while the full install directory is some 348M.
Upgrading is as simple as following the same instructions exactly. To view current version, use `calibre --version`. In case something goes wrong, use `calibre --appimage-extract` and retry.