Simple script to build phoenix with XFT for newbies.

Discussion about official Mozilla Firefox builds
Post Reply
famewolf
Posts: 7
Joined: December 11th, 2002, 12:36 pm

Simple script to build phoenix with XFT for newbies.

Post by famewolf »

Here's a simple script to compile phoenix with XFT and generate a tar.bz2 of the phoenix directory. This works on a redhat 8 system unless I messed something up in the pasting. ;)
---------cut here---------
cd /root # change to whatever dir you want to use.
mkdir phoenix-source # Comment this line out with pound sign after first run
cd phoenix-source
rm -rf mozilla*
wget http://ftp.mozilla.org/pub/mozilla/nigh ... ce.tar.bz2
tar xvjf ./mozilla-source.tar.bz2
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot checkout mozilla/browser mozilla/toolkit
cp .mozconfig mozilla #see the sample .mozconfig below and save it to /root/phoenix-source
cd mozilla && gmake -f client.mk build
cd xpinstall/packager
make MOZ_PKG_APPNAME=phoenix MOZILLA_BIN="\$(DIST)/bin/phoenix-bin"

----
Sample mozconfig
----
export MOZ_PHOENIX=1
mk_add_options MOZ_PHOENIX=1
ac_add_options --enable-crypto
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-mailnews
ac_add_options --disable-composer
ac_add_options --enable-strip
ac_add_options --enable-strip-libs
ac_add_options --enable-optimize="-O2"
ac_add_options --enable-xft
geekboy2000
Posts: 56
Joined: December 7th, 2002, 8:26 pm

Post by geekboy2000 »

Thanks very much for taking the time to put that together. As a first time builder, I ran the commands independently, rather than as a script, and it worked! Well, sort of. :)
I ended up with a sort of hybrid Mozilla/Phoenix that apparently has either no user agent string, and/or has some problem with cookies. It also has the Mozilla style sidebar with tabs. I'm not sure . . but I'm still pretty darn excited that it got *this* far. :)
User avatar
joshk
Posts: 33
Joined: November 25th, 2002, 1:33 am
Location: Palo Alto, CA
Contact:

Post by joshk »

watch it, gmake == make on Linux... ;)
<mspencer> Hitler used an aimbot.
User avatar
edcatmur
Posts: 88
Joined: November 12th, 2002, 1:42 pm

Post by edcatmur »

This is what I use - a little more complex!

Code: Select all

#!/bin/bash

for arg
do
   case "$arg" in
   '--restart')
      restart="true"
      ;;
   '--clean')
      clean="true"
      ;;
   '--usage' | '-?')
      echo "Usage: $0 [[--restart | -r] [--clean | -c] [--tarball | -t]] | [--help | -? | --usage]"
      exit
      ;;
   '--help')
      echo "
Phoenix (Mozilla) build script - ed@catmur.co.uk http://catmur.co.uk
Expects /usr/src/mozilla to exist and be writeable by user.
Uses /usr/src/mozilla/mozilla as root of build
Expects the following to exist inside /usr/src/mozilla:
   phoenix_xft.mozconfig - .mozconfig file
   extras - folder, will be copied onto program folder for plugins etc
   xpi - folder, all .xpi files (extensions etc) therein will be
   installed after build
What it does:
   If -r specified, gets source from ftp
   Updates source tree from cvs
   If -c specified, makes clean
   Builds Phoenix, generates tarball
   Creates folder named in YYYYMMDDHH format (e.g. 2002121609)
   Copies tarball to said folder, unpacks it
   Symlinks /usr/src/mozilla/latest-build to said folder, renaming the
   latest-build symlink to latest-good
   Installs extras, runs Phoenix to install xpis
If you like dogfood, I recommend you use /usr/src/mozilla/latest-build/phoenix/
as your day-to-day browser; if you encounter a bad build simply use
   $ mv -f latest-good latest-build
Note that you are expected to maintain /usr/src/mozilla yourself; if you
crontab this script it will grow at 75MB a day, so clear out old builds
occasionally!"
      exit
      ;;
   --*)
      echo "Option '$arg' not recognised."
      echo "Run $0 --usage for usage."
      exit
      ;;
   -*)
      if echo "$arg" | grep 'r' > /dev/null; then
         restart="true"
      fi
      if echo "$arg" | grep 'c' > /dev/null; then
         clean="true"
      fi
      if ! echo "$arg" | grep -x '\-[rc]*' > /dev/null; then
         for option in `echo "$arg" | grep -o '[^-rc]'`; do
            echo "Option '-$option' not recognised."
         done
         echo "Run $0 --usage for usage."
         exit
      fi
      ;;
   *)
      echo "Argument '$arg' not recognised."
      echo "Run $0 --usage for usage."
      exit
      ;;
   esac
done

if ps -A | grep phoenix-bin; then
   echo "Phoenix is running; cannot continue."
   exit
fi

cd /usr/src/mozilla

# Re-get source tarball if wanted
if [ -n "$restart" ] || [ ! -d mozilla ]; then
   echo "Destroying current tree..."
   rm -f mozilla-source.tar.bz2
   rm -f -r mozilla
   wget http://ftp.mozilla.org/pub/mozilla/nightly/latest/mozilla-source.tar.bz2
   tar xvjf ./mozilla-source.tar.bz2
fi

# If specified, make clean
if [ -n "$clean" ]; then
   cd mozilla
   make clean
   cd ..
fi

# Get files via cvs
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot checkout -A mozilla/browser mozilla/toolkit

# Record date in 2002121409 form (I do this *after* cvs checkout; is this correct?)
let "builddate = `date +%Y%m%d%H`"

# Copy in the .mozconfig for the phoenix xft build
cp phoenix_xft.mozconfig mozilla/.mozconfig

# Build it
cd mozilla
gmake -f client.mk build

# Generate tarball (dist/phoenix-i686-pc-linux-gnu.tar.gz)
cd xpinstall/packager
make MOZ_PKG_APPNAME=phoenix MOZILLA_BIN="\$(DIST)/bin/phoenix-bin"

# make builddate directory
cd /usr/src/mozilla
mkdir $builddate
cd $builddate

# copy in tarball
cp ../mozilla/dist/phoenix-i686-pc-linux-gnu.tar.gz .

# unpack tarball to builddate/phoenix
tar -xvzf phoenix-i686-pc-linux-gnu.tar.gz

# update latest-build and latest-good symlinks
cd ..
mv -f latest-build latest-good
ln -s $builddate latest-build

# Copy in all plugins etcetera
cp -dr extras/* latest-build/phoenix/

# Run all XPIs (install extensions, global XPI themes)
./latest-build/phoenix/phoenix &
sleep 5
for xpi in xpi/*.xpi; do
   ./latest-build/phoenix/phoenix -remote "openURL (file:///usr/src/mozilla/$xpi)"
done
geekboy2000
Posts: 56
Joined: December 7th, 2002, 8:26 pm

Post by geekboy2000 »

Bingo! As they say, "You Da Man"! Didn't modify a thing with respect to the script, created the required paths/directories, and 70 minutes later, this post comes from the resulting build! Nice! Thanks very much. BTW, I assume the time it takes to build varies from a few minutes to days, but I'm running an Athlon XP1600 w/1.5GB RAM. Any gut feel as to whether that time is about "normal"?
Post Reply