Last active
December 12, 2019 00:28
-
-
Save moisadoru/aa96b54a109fe890f4a685d82dd66b11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Installs libfreetype6 2.8.0 into affected electron app. | |
# For more details ee: | |
# https://github.com/atom/atom/issues/15737 | |
# https://github.com/Microsoft/vscode/issues/35675 | |
CRT=$(dpkg-query --showformat='${Version}' --show libfreetype6) | |
CRT=$(echo $CRT | sed -e 's/-.*$//g') | |
if [ "$CRT" != "2.8.1" ]; then | |
echo "libfreetype6 2.8.1 not installed (got $CRT instead), nothing to do." | |
exit | |
fi | |
CPU=$(uname -p) | |
ARCH=$(dpkg --print-architecture) | |
DEB="libfreetype6_2.8-0.2ubuntu2_$ARCH.deb" | |
URL="http://security.ubuntu.com/ubuntu/pool/main/f/freetype/$DEB" | |
copy_freetype () { | |
if [ -d "$1" ]; then | |
cp ./usr/lib/$CPU-linux-gnu/libfreetype.so.* $1 | |
echo "Copied libfreetype6 2.8.0 to '$1'." | |
else | |
echo "Skipping '$1', not installed." | |
fi | |
} | |
# create tmp folder and cd | |
mkdir -p /tmp/fix-freetype-electron | |
cd /tmp/fix-freetype-electron > /dev/null | |
# download freetype 2.8.0 deb | |
wget -q $URL ./ | |
# unpack deb | |
dpkg -x libfreetype6_2.8-0.2ubuntu2_amd64.deb . | |
# atom | |
copy_freetype /usr/share/atom/ | |
# atom-beta | |
copy_freetype /usr/share/atom-beta/ | |
# vscode | |
copy_freetype /usr/share/code/ | |
# vscode-insiders | |
copy_freetype /usr/share/code-insiders/ | |
# add you own... | |
if [ "" != "$1" ]; then | |
copy_freetype "$1" | |
fi | |
# cleanup | |
cd - > /dev/null | |
rm -rf /tmp/fix-freetype-electron | |
echo "---" | |
echo "All done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really nice, working fine on Ubuntu 18.04 with atom.
Thanks a lot!