Skip to content

Instantly share code, notes, and snippets.

@combatpoodle
Forked from joekiller/gtk-firefox.sh
Last active December 17, 2015 17:29
Show Gist options
  • Save combatpoodle/5646881 to your computer and use it in GitHub Desktop.
Save combatpoodle/5646881 to your computer and use it in GitHub Desktop.
Updated to use current Amazon Linux packages for a most of dependencies.
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
TARGET=/usr/local
function init()
{
export installroot=$TARGET/src
export workpath=$TARGET
yum --assumeyes install make libjpeg-devel libpng-devel \
libtiff-devel gcc libffi-devel gettext-devel libmpc-devel \
libstdc++46-devel xauth gcc-c++ libtool libX11-devel \
libXext-devel libXinerama-devel libXi-devel libxml2-devel \
libXrender-devel libXrandr-devel libXt dbus-glib
mkdir -p $workpath
mkdir -p $installroot
cd $installroot
PKG_CONFIG_PATH="$workpath/lib/pkgconfig"
PATH=$workpath/bin:$PATH
export PKG_CONFIG_PATH PATH
bash -c "
cat << EOF > /etc/ld.so.conf.d/z-firefox.conf
$workpath/lib
$workpath/firefox
EOF
ldconfig
"
}
function finish()
{
cd $workpath
wget 'http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/27.0/linux-x86_64/en-US/firefox-27.0.tar.bz2'
tar -xvf firefox-21.0.tar.bz2
cd bin
rm -f "$workpath/libnss*"
ln -s ../firefox/firefox
ldconfig
}
function install()
{
wget $1
FILE=`basename $1`
if [ ${FILE: -3} == ".xz" ]
then tar xvfJ $FILE
else tar xvf $FILE
fi
SHORT=${FILE:0:4}*
cd $SHORT
./configure --prefix=$workpath
make
make install
ldconfig
cd ..
}
init
yum -y install cairo-devel fontconfig fontconfig-devel freetype-devel libXft libXft-devel libthai pixman pixman-devel autoconf freetype fontconfig pixman cairo pango pango-devel
install http://ftp.gnome.org/pub/gnome/sources/glib/2.32/glib-2.32.3.tar.xz
install http://ftp.gnome.org/pub/gnome/sources/pango/1.30/pango-1.30.0.tar.xz
install http://ftp.gnome.org/pub/gnome/sources/atk/2.4/atk-2.4.0.tar.xz
install http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.26/gdk-pixbuf-2.26.1.tar.xz
install http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.10.tar.xz
finish
# adds the /usr/local/bin to your path by updating your .bashrc file.
cat << EOF >> ~/.bashrc
PATH=/usr/local/bin:\$PATH
export PATH
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment