Skip to content

Instantly share code, notes, and snippets.

@drizzt
Last active March 5, 2020 15:46
Show Gist options
  • Save drizzt/788fe0d5ab09ac3872332967849b0bc6 to your computer and use it in GitHub Desktop.
Save drizzt/788fe0d5ab09ac3872332967849b0bc6 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
NANOVAULT_VERSION=${1:-1.2.1}
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
cd "$TMPDIR"
# Download AppImages
curl -fOL "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
curl -fOL "https://github.com/cronoh/nanovault/releases/download/v$NANOVAULT_VERSION/NanoVault-$NANOVAULT_VERSION-x86_64.AppImage"
chmod +x appimagetool-x86_64.AppImage NanoVault-"$NANOVAULT_VERSION"-x86_64.AppImage
# Download libpango-1.0-0, libpangoft2-1.0-0 and libpangocairo-1.0-0 from Ubuntu 18.04
# FIXME Yes, it sux, but I don't care so much
for package in libpango-1.0-0 libpangoft2-1.0-0 libpangocairo-1.0-0; do
curl -s "https://packages.ubuntu.com/bionic/amd64/$package/download" | sed -n 's:.*<li><a href="\([^"]*\)">.*:\1:p' | head -n1 | xargs -n1 curl -fOL
ar p "$package"_*_amd64.deb data.tar.xz | tar xvJf - ./usr/lib/x86_64-linux-gnu/
done
./NanoVault-"$NANOVAULT_VERSION"-x86_64.AppImage --appimage-extract
cp -a usr/lib/x86_64-linux-gnu/*.so.* squashfs-root/usr/lib
./appimagetool-x86_64.AppImage squashfs-root "$OLDPWD/NanoVault-$NANOVAULT_VERSION-patched-linux-x86_64.AppImage"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment