mk_source_dir  $SOURCE_DIRECTORY  &&
cd  $SOURCE_DIRECTORY             &&
unpack_file  ''                   &&
cd  mozilla-1.9.2                 &&
# fix for gcc-4.4
sed -i 's/^#elif$/#else/' toolkit/xre/nsAppRunner.cpp  &&
patch -p0 < $SCRIPT_DIRECTORY/xulrunner-install-paths.patch &&

patch -p0 < $SCRIPT_DIRECTORY/xulrunner-nss.patch &&

patch -p2 < $SCRIPT_DIRECTORY/xulrunner_libpng-1.4.patch &&

# Needed to make things using XUL find NSPR.
echo "Requires: nspr" >> xulrunner/installer/libxul-embedding.pc.in &&

cp -v $SPELL_DIRECTORY/mozconfig3 .mozconfig &&

if [[ $FIREFOX_OFFICIAL == y ]]; then
  sed -i '24iac_add_options --enable-official-branding' .mozconfig
fi
