Skip to content

Instantly share code, notes, and snippets.

@sankalp-khare
Forked from joekiller/gtk-firefox.sh
Last active November 13, 2019 13:44
Show Gist options
  • Save sankalp-khare/10449966 to your computer and use it in GitHub Desktop.
Save sankalp-khare/10449966 to your computer and use it in GitHub Desktop.
#!/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/
# modified by Sankalp Khare [2014-04-11 Fri]
# http://web.iiit.ac.in/~sankalp_k/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
TARGET=/usr/local
FF_EXTRACT_DIR=/opt
function init()
{
export installroot=$TARGET/src
export workpath=$TARGET
export ffdir=$FF_EXTRACT_DIR/firefox
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/firefox.conf
$workpath/lib
$ffdir
EOF
ldconfig
"
}
function finish()
{
cd $FF_EXTRACT_DIR
# 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/
wget -r --no-parent --reject "index.html*" -nH --cut-dirs=7 http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/
tar xvf firefox*
cd $workpath/bin
ln -s $ffdir/firefox
ldconfig
rm -f $FF_EXTRACT_DIR/firefox*.tar.bz2 robots.txt
}
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
if [[ :$PATH: == *:"$TARGET/bin":* ]]
then
exit
fi
# adds the /usr/local/bin to your path by updating your .bashrc file.
# execution gets here only if /usr/local/bin isn't already in PATH.
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