Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GTK+ and Firefox for Amazon Linux
#!/bin/bash
#GTK+ and Firefox for Amazon Linux
#Written by Joseph Lawson 2012-06-03
#http://joekiller.com
#Free to use but please credit
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
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/firefox.conf
$workpath/lib
$workpath/firefox
EOF
ldconfig
"
}
function finish()
{
cd $workpath
wget -r --no-parent --reject "index.html*" -nH --cut-dirs=7 http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/
tar xvf firefox*
cd bin
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
install ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz
install http://download.savannah.gnu.org/releases/freetype/freetype-2.4.9.tar.gz
install http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.9.0.tar.gz
install http://ftp.gnome.org/pub/gnome/sources/glib/2.32/glib-2.32.3.tar.xz
install http://cairographics.org/releases/pixman-0.26.0.tar.gz
install http://cairographics.org/releases/cairo-1.12.2.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
@aakhedr

This comment has been minimized.

Copy link

commented Sep 4, 2015

When I run this script it halts at:

Connecting to mirror6.layerjet.com (mirror6.layerjet.com)|5.135.167.33|:80... connected.
HTTP request sent, awaiting response...

Any clues on why and how to fix it? Thanks

@harishgautam121

This comment has been minimized.

Copy link

commented Apr 20, 2017

Can you also provide us script to install GTK 3+ on Amazone Linux AMI as it required to install firefox 47 as selium driver 2.52.0 is not compatible with firefox 45

There are some links below to compile GTK 3 but we are not sure how to use these
https://developer.gnome.org/gtk3/stable/gtk-building.html
http://www.linuxfromscratch.org/blfs/view/svn/x/gtk3.html

@pragyadg

This comment has been minimized.

Copy link

commented Jun 19, 2017

I am Using Selenium 2.53.0 and Firefox 46 which is not compatible with GTK+ 2.24, Can you please provide a gist for the later versions of FF and GTK+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.