Skip to content

Bundling Google Chrome

probonopd edited this page Jul 27, 2014 · 15 revisions

This is the script I use to bundle Google Chrome.

mkdir -p chrome/chrome.AppDir/usr/lib
cd chrome
cp /usr/lib/x86_64-linux-gnu/libXss.so.1 chrome.AppDir/usr/lib/
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
cd chrome.AppDir/

find ../ -name *.deb -exec dpkg -x \{\} . \;

find . -name *.desktop -exec cp \{\} . \;

find -name product_logo_48.png -exec cp \{\} google-chrome.png \;

cd usr/bin/
ln -sf ../../opt/google/chrome/google-chrome ./google-chrome-stable
cd -

cp /lib/x86_64-linux-gnu/libudev.so.1.*.* usr/lib/libudev.so.0

sed -i -e 's|/usr/bin/google-chrome-stable %U|AppRun|g' google-chrome.desktop

cat > ./AppRun <<\EOF
#!/bin/sh
HERE=$(dirname $(readlink -f "${0}"))
export LD_LIBRARY_PATH="${HERE}"/usr/lib:$PATH
"${HERE}"/usr/bin/google-chrome-stable --no-sandbox $@
EOF
chmod a+x ./AppRun

# Try to run ./AppRun

cd ..

wget -c "https://downloads.sourceforge.net/project/portable/64bit/AppImageAssistant%200.9.3-64bit"

sudo mount -o loop "AppImageAssistant 0.9.3-64bit" /opt/

/opt/package ./chrome.AppDir/ chrome.AppImage

sudo umount /opt