Difference between revisions of "Firefox"

From CBLFS
Jump to navigationJump to search
m (Moved multilib bash script after build consistent with non-multilib.)
Line 2: Line 2:
 
|-
 
|-
 
!Download Source:
 
!Download Source:
| http://releases.mozilla.org/pub/mozilla.org/firefox/releases/2.0/source/firefox-2.0-source.tar.bz2
+
| http://releases.mozilla.org/pub/mozilla.org/firefox/releases/{{Firefox-Version}}/source/firefox-{{Firefox-Version}}-source.tar.bz2
 
|}
 
|}
  
Line 44: Line 44:
 
  ac_cv_visibility_pragma=no
 
  ac_cv_visibility_pragma=no
 
   
 
   
  ac_add_options --prefix=/opt/firefox-2.0
+
  ac_add_options --prefix=/opt/firefox-{{Firefox-Version}}
 
   
 
   
 
  ac_add_options --with-system-nss
 
  ac_add_options --with-system-nss
Line 96: Line 96:
 
If you're using a system installed [[NSS]] and [[NSPR]] then adjust the pkg-config files to point to the proper place:
 
If you're using a system installed [[NSS]] and [[NSPR]] then adjust the pkg-config files to point to the proper place:
  
  ln -sfv /usr/lib/pkgconfig/nss.pc /opt/firefox-2.0/lib/pkgconfig/firefox-nss.pc &&
+
  ln -sfv /usr/lib/pkgconfig/nss.pc /opt/firefox-{{Firefox-Version}}/lib/pkgconfig/firefox-nss.pc &&
  ln -sfv /usr/lib/pkgconfig/nspr.pc /opt/firefox-2.0/lib/pkgconfig/firefox-nspr.pc
+
  ln -sfv /usr/lib/pkgconfig/nspr.pc /opt/firefox-{{Firefox-Version}}/lib/pkgconfig/firefox-nspr.pc
  
 
=== 50-firefox.sh ===
 
=== 50-firefox.sh ===
Line 106: Line 106:
 
  # Begin /etc/profile.d/50-firefox.sh
 
  # Begin /etc/profile.d/50-firefox.sh
 
   
 
   
  export PATH="${PATH}:/opt/firefox-2.0/bin"
+
  export PATH="${PATH}:/opt/firefox-{{Firefox-Version}}/bin"
  export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}/opt/firefox-2.0/lib/pkgconfig"
+
  export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}/opt/firefox-{{Firefox-Version}}/lib/pkgconfig"
 
   
 
   
 
  # End /etc/profile.d/50-firefox.sh
 
  # End /etc/profile.d/50-firefox.sh
Line 159: Line 159:
 
==== Common ====
 
==== Common ====
  
  mv -v /opt/firefox-2.0/bin/firefox-config{,-32} &&
+
  mv -v /opt/firefox-{{Firefox-Version}}/bin/firefox-config{,-32} &&
  ln -sfv /usr/bin/multiarch_wrapper /opt/firefox-2.0/bin/firefox-config
+
  ln -sfv /usr/bin/multiarch_wrapper /opt/firefox-{{Firefox-Version}}/bin/firefox-config
  
 
If you're using a system installed [[NSS]] and [[NSPR]] then adjust the pkg-config files to point to the proper place:
 
If you're using a system installed [[NSS]] and [[NSPR]] then adjust the pkg-config files to point to the proper place:
  
  ln -sfv /usr/lib/pkgconfig/nss.pc /opt/firefox-2.0/lib/pkgconfig/firefox-nss.pc &&
+
  ln -sfv /usr/lib/pkgconfig/nss.pc /opt/firefox-{{Firefox-Version}}/lib/pkgconfig/firefox-nss.pc &&
  ln -sfv /usr/lib/pkgconfig/nspr.pc /opt/firefox-2.0/lib/pkgconfig/firefox-nspr.pc
+
  ln -sfv /usr/lib/pkgconfig/nspr.pc /opt/firefox-{{Firefox-Version}}/lib/pkgconfig/firefox-nspr.pc
  
 
=== 64Bit ===
 
=== 64Bit ===
Line 172: Line 172:
  
 
  cat >> .mozconfig << EOF
 
  cat >> .mozconfig << EOF
  ac_add_options --libdir=/opt/firefox-2.0/lib64
+
  ac_add_options --libdir=/opt/firefox-{{Firefox-Version}}/lib64
 
  export CC="gcc ${BUILD64}"
 
  export CC="gcc ${BUILD64}"
 
  export CXX="g++ ${BUILD64}"
 
  export CXX="g++ ${BUILD64}"
Line 188: Line 188:
  
 
  make -f client.mk install &&
 
  make -f client.mk install &&
  mv -v /opt/firefox-2.0/bin/firefox-config{,-64} &&
+
  mv -v /opt/firefox-{{Firefox-Version}}/bin/firefox-config{,-64} &&
  ln -sfv /usr/bin/multiarch_wrapper /opt/firefox-2.0/bin/firefox-config
+
  ln -sfv /usr/bin/multiarch_wrapper /opt/firefox-{{Firefox-Version}}/bin/firefox-config
  
 
If you're using a system installed [[NSS]] and [[NSPR]] then adjust the pkg-config files to point to the proper place:
 
If you're using a system installed [[NSS]] and [[NSPR]] then adjust the pkg-config files to point to the proper place:
  
  ln -sfv /usr/lib64/pkgconfig/nss.pc /opt/firefox-2.0/lib64/pkgconfig/firefox-nss.pc &&
+
  ln -sfv /usr/lib64/pkgconfig/nss.pc /opt/firefox-{{Firefox-Version}}/lib64/pkgconfig/firefox-nss.pc &&
  ln -sfv /usr/lib64/pkgconfig/nspr.pc /opt/firefox-2.0/lib64/pkgconfig/firefox-nspr.pc
+
  ln -sfv /usr/lib64/pkgconfig/nspr.pc /opt/firefox-{{Firefox-Version}}/lib64/pkgconfig/firefox-nspr.pc
  
 
=== ppc64 note ===
 
=== ppc64 note ===
Line 207: Line 207:
 
  # Begin /etc/profile.d/50-firefox.sh
 
  # Begin /etc/profile.d/50-firefox.sh
 
   
 
   
  export PATH="${PATH}:/opt/firefox-2.0/bin"
+
  export PATH="${PATH}:/opt/firefox-{{Firefox-Version}}/bin"
  export PKG_CONFIG_PATH32="${PKG_CONFIG_PATH32}${PKG_CONFIG_PATH32+:}/opt/firefox-2.0/lib/pkgconfig"
+
  export PKG_CONFIG_PATH32="${PKG_CONFIG_PATH32}${PKG_CONFIG_PATH32+:}/opt/firefox-{{Firefox-Version}}/lib/pkgconfig"
  export PKG_CONFIG_PATHN32="${PKG_CONFIG_PATHN32}${PKG_CONFIG_PATHN32+:}/opt/firefox-2.0/lib32/pkgconfig"
+
  export PKG_CONFIG_PATHN32="${PKG_CONFIG_PATHN32}${PKG_CONFIG_PATHN32+:}/opt/firefox-{{Firefox-Version}}/lib32/pkgconfig"
  export PKG_CONFIG_PATH64="${PKG_CONFIG_PATH64}${PKG_CONFIG_PATH64+:}/opt/firefox-2.0/lib64/pkgconfig"
+
  export PKG_CONFIG_PATH64="${PKG_CONFIG_PATH64}${PKG_CONFIG_PATH64+:}/opt/firefox-{{Firefox-Version}}/lib64/pkgconfig"
 
   
 
   
 
  # End /etc/profile.d/50-firefox.sh
 
  # End /etc/profile.d/50-firefox.sh
Line 224: Line 224:
 
  Name=Mozilla Firefox Browser
 
  Name=Mozilla Firefox Browser
 
  Comment=Lightweight browser based on mozilla
 
  Comment=Lightweight browser based on mozilla
  Exec=/opt/firefox-2.0/bin/firefox
+
  Exec=firefox
 
  Icon=firefox.png
 
  Icon=firefox.png
 
  Terminal=false
 
  Terminal=false

Revision as of 13:50, 17 December 2006

Download Source: http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.5.7/source/firefox-3.5.7-source.tar.bz2

Introduction to Firefox

Firefox is a stand-alone browser based on the Mozilla codebase.

Dependencies

Required

Recommended

Optional

Creating a .mozconfig

The .mozconfig file contains the options that will be used to build firefox.

The first line includes the default configuration for compiling a browser and the second line determines where the build objects are going to reside. ac_cv_visibility_pragma=no fixes build errors on 32bit non-x86 systems but won't cause any trouble on x86. Having --with-system-nss and --with-system-nspr does not mean you *HAVE* to have a system installed version of nss and nspr. It makes the build system prefer to use the system installed version of nss and nspr over the internal version. --enable-canvas enables support for the <canvas></canvas> tag. --enable-svg enables support for rendering svg files. --enable-strip causes the installed binaries to be stripped. --disable-tests prevents test programs from being built which saves a lot of disk space and time. --disable-accessibility - disables a11y support. --disable-installer prevents the installer from being built. --enable-official-branding causes the installed binaries to have the official Firefox name embedded in them. Due to license restrictions, you may not distribute binaries created using this option.

cat > .mozconfig << "EOF"
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@

ac_cv_visibility_pragma=no

ac_add_options --prefix=/opt/firefox-3.5.7

ac_add_options --with-system-nss
ac_add_options --with-system-nspr

ac_add_options --with-system-zlib
ac_add_options --with-system-png
ac_add_options --with-system-jpeg
ac_add_options --enable-system-cairo

ac_add_options --enable-canvas
ac_add_options --enable-svg

ac_add_options --enable-strip
ac_add_options --disable-tests 
ac_add_options --disable-accessibility
ac_add_options --disable-installer 
ac_add_options --enable-official-branding 
EOF

If you would like dual monitor support in Firefox, append your your .mozconfig with the following:

cat >> .mozconfig << "EOF"
ac_add_options --enable-xinerama
EOF

If you have OpenLDAP installed and would like to build Firefox against it. This is required to build OpenOffice2 against Firefox. Append your .mozconfig with the following:

cat >> .mozconfig << "EOF"
ac_add_options --enable-ldap
EOF

If you would like to render fonts with Pango, append your your .mozconfig with the following. This can significantly slow font rendering.

cat >> .mozconfig << "EOF"
ac_add_options --enable-pango
EOF

Non-Multilib

sed -i "s:@MOZ_GTK2_LIBS@:& -L${XORG_PREFIX}/lib -lX11 -lXrender:g" config/autoconf.mk.in

Compile the package:

make -f client.mk build

Install the package:

make -f client.mk install

If you're using a system installed NSS and NSPR then adjust the pkg-config files to point to the proper place:

ln -sfv /usr/lib/pkgconfig/nss.pc /opt/firefox-3.5.7/lib/pkgconfig/firefox-nss.pc &&
ln -sfv /usr/lib/pkgconfig/nspr.pc /opt/firefox-3.5.7/lib/pkgconfig/firefox-nspr.pc

50-firefox.sh

If you're using the Bash Startup Files create an addition for firefox with the following commands, otherwise make sure the enviornment variables are set in your profile:

cat > /etc/profile.d/50-firefox.sh << "EOF"
# Begin /etc/profile.d/50-firefox.sh

export PATH="${PATH}:/opt/firefox-3.5.7/bin"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}/opt/firefox-3.5.7/lib/pkgconfig"

# End /etc/profile.d/50-firefox.sh
EOF

Multilib

The order that the builds are displayed on this page isn't neccesarily the order that you install them in. If you would like a 32bit browser but still require the 64bit libraries for other packages build the 32bit version last.

Remember, Use a clean source and build directory for each build, Firefox is no exception.

32Bit

Use the following command to append your .mozconfig with 32bit specific flags:

cat >> .mozconfig << EOF
export CC="gcc ${BUILD32}"
export CXX="g++ ${BUILD32}"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}"
export USE_ARCH=32
ac_add_options --host=$CLFS_TARGET32
ac_add_options --build=$CLFS_TARGET32
mk_add_options CONFIG_GUESS=$CLFS_TARGET32
EOF
sed -i "s:@MOZ_GTK2_LIBS@:& -L${XORG_PREFIX}/lib -lX11 -lXrender:g" config/autoconf.mk.in

x86

Compile the package:

make -f client.mk OS_TEST=x86 build

Install the package:

make -f client.mk OS_TEST=x86 install

ppc64

Compile the package:

make -f client.mk OS_TEST=ppc build

Install the package:

make -f client.mk OS_TEST=ppc install

The 32-bit version of firefox-2.0 on ppc64 crashes about as much as the 0.8 version used to, particularly when scrolling down pages in google news and wikipedia, so it is not totally ready for prime time.

The --build, --host, and CONFIG_GUESS settings are critical to ensure that xpcom is built as 32-bit. On ppc64, xpcom will silently build wrongly without these settings, unlike e.g. x86_64 where the build chokes on the extended register mnemonics.

Common

mv -v /opt/firefox-3.5.7/bin/firefox-config{,-32} &&
ln -sfv /usr/bin/multiarch_wrapper /opt/firefox-3.5.7/bin/firefox-config

If you're using a system installed NSS and NSPR then adjust the pkg-config files to point to the proper place:

ln -sfv /usr/lib/pkgconfig/nss.pc /opt/firefox-3.5.7/lib/pkgconfig/firefox-nss.pc &&
ln -sfv /usr/lib/pkgconfig/nspr.pc /opt/firefox-3.5.7/lib/pkgconfig/firefox-nspr.pc

64Bit

Use the following command to append your .mozconfig with 64bit specific flags:

cat >> .mozconfig << EOF
ac_add_options --libdir=/opt/firefox-3.5.7/lib64
export CC="gcc ${BUILD64}"
export CXX="g++ ${BUILD64}"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}"
export USE_ARCH=64
EOF
sed -i "s:@MOZ_GTK2_LIBS@:& -L${XORG_PREFIX}/lib64 -lX11 -lXrender:g" config/autoconf.mk.in

Compile the package:

make -f client.mk build

Install the package:

make -f client.mk install &&
mv -v /opt/firefox-3.5.7/bin/firefox-config{,-64} &&
ln -sfv /usr/bin/multiarch_wrapper /opt/firefox-3.5.7/bin/firefox-config

If you're using a system installed NSS and NSPR then adjust the pkg-config files to point to the proper place:

ln -sfv /usr/lib64/pkgconfig/nss.pc /opt/firefox-3.5.7/lib64/pkgconfig/firefox-nss.pc &&
ln -sfv /usr/lib64/pkgconfig/nspr.pc /opt/firefox-3.5.7/lib64/pkgconfig/firefox-nspr.pc

ppc64 note

You cannot build firefox as 64-bit on ppc64, the necessary xptcinvoke and xptcstubs code does not exist.

50-firefox.sh

If you're using the Bash Startup Files create an addition for firefox with the following commands, otherwise make sure the enviornment variables are set in your profile:

cat > /etc/profile.d/50-firefox.sh << "EOF"
# Begin /etc/profile.d/50-firefox.sh

export PATH="${PATH}:/opt/firefox-3.5.7/bin"
export PKG_CONFIG_PATH32="${PKG_CONFIG_PATH32}${PKG_CONFIG_PATH32+:}/opt/firefox-3.5.7/lib/pkgconfig"
export PKG_CONFIG_PATHN32="${PKG_CONFIG_PATHN32}${PKG_CONFIG_PATHN32+:}/opt/firefox-3.5.7/lib32/pkgconfig"
export PKG_CONFIG_PATH64="${PKG_CONFIG_PATH64}${PKG_CONFIG_PATH64+:}/opt/firefox-3.5.7/lib64/pkgconfig"

# End /etc/profile.d/50-firefox.sh
EOF

Creating the Desktop File

Since Firefox does not provide a desktop file by default below is an example one:

cat > /usr/share/applications/firefox.desktop << "EOF"
[Desktop Entry]
Encoding=UTF-8
Name=Mozilla Firefox Browser
Comment=Lightweight browser based on mozilla
Exec=firefox
Icon=firefox.png
Terminal=false
Type=Application 
Categories=Application;Network;
EOF

Grab the Firefox pixmap from http://cross-lfs.org/~jciccone/firefox.png and put it in /usr/share/pixmaps.

Retrieved from "?title=Firefox&oldid=5335"