Skip to content

Instantly share code, notes, and snippets.

@jrmdev
Last active June 12, 2020 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrmdev/48207c81afa1f8acc59f2bb16500dd67 to your computer and use it in GitHub Desktop.
Save jrmdev/48207c81afa1f8acc59f2bb16500dd67 to your computer and use it in GitHub Desktop.
#!/bin/bash
APP="GoogleEarth"
VERSION="7.1.8.3036-r0"
OUTFILE="GoogleEarthPro.${VERSION}.$(arch).AppImage"
rm -rf $OUTFILE ./AppDir && mkdir -p ./AppDir
if [ "$(which patchelf)" == "" ]; then
echo "Insalling patchelf..."
sudo apt install -y patchelf
fi
echo "Downloading Google Earth..."
wget -Nq https://dl.google.com/linux/earth/deb/pool/main/g/google-earth-pro-stable/google-earth-pro-stable_${VERSION}_amd64.deb
echo "Downloading AppImageTool..."
wget -Nq https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(arch).AppImage && chmod a+x appimagetool-$(arch).AppImage
cd AppDir
echo "Extracting..."
ar p ../google-earth-pro-stable_${VERSION}_amd64.deb data.tar.xz | tar xJ
echo "Patching ..."
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 ./opt/google/earth/pro/googleearth-bin 2>/dev/null
find ./opt/google/earth/pro -type f -executable -exec patchelf --set-rpath \$ORIGIN {} \; 2>/dev/null
echo "Building ..."
cp ./opt/google/earth/pro/product_logo_128.png ./icon.png ; chmod 644 ./icon.png ; cp ./icon.png ..
rm ./opt/google/earth/pro/google-earth-pro.desktop
cat > ./$APP.desktop << EOF
[Desktop Entry]
Version=1.0
Name=Google Earth
Type=Application
GenericName=3D planet viewer
Comment=Explore, search and discover the planet
Categories=Network;Application;
Exec=googleearth-bin
Terminal=false
Icon=icon
EOF
rm -rf ./usr ./etc ; mkdir ./usr ; mv ./opt/google/earth/pro ./usr/bin ; rm -rf ./opt
ln -s ./usr/bin/googleearth-bin ./AppRun
cd ..
./appimagetool-$(arch).AppImage ./AppDir ./$OUTFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment