Difference between revisions of "XULRunner"

From CBLFS
Jump to navigationJump to search
m (Fixing compile errors with GCC 4.6)
 
(13 intermediate revisions by 6 users not shown)
Line 2: Line 2:
 
|-
 
|-
 
!Download Source:
 
!Download Source:
| http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/{{XULRunner-Version}}/source/xulrunner-{{XULRunner-Version}}-source.tar.bz2
+
| http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/{{XULRunner-Version}}/source/xulrunner-{{XULRunner-Version}}.source.tar.bz2
|-
 
!Download Patch:
 
| http://svn.cross-lfs.org/svn/repos/patches/xulrunner/xulrunner-{{XULRunner-Version}}-system_nss-1.patch
 
 
|}
 
|}
  
Line 21: Line 18:
 
* [[NSS]]
 
* [[NSS]]
 
* [[Curl]] (Required for Crash Reporter)
 
* [[Curl]] (Required for Crash Reporter)
 +
* [[ALSA]]
 
=== Optional ===
 
=== Optional ===
 
* [[Unzip]]
 
* [[Unzip]]
Line 29: Line 27:
 
== Non-Multilib ==
 
== Non-Multilib ==
  
If you're using a system wide installation of [[NSS]] and [[NSPR]] then apply the following patch so that their headers can be found properly:
+
Fix a handful of compilation errors with gcc4:
  
  xulrunner-{{XULRunner-Version}}-system_nss-1.patch
+
  sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc &&
 +
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc &&
 +
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc
 +
 
 +
There are several incompatibilities with GCC 4.6.
 +
If you get compile errors about
 +
nsEnumeratorUtils.cpp:115:27: error: uninitialized const EmptyEnumeratorImpl::kInstance
 +
then you need to get a patch from here:
 +
https://bugzilla.mozilla.org/show_bug.cgi?id=623126
  
 
Compile the package:
 
Compile the package:
Line 40: Line 46:
  
 
  make -f client.mk install
 
  make -f client.mk install
 +
 +
Some applications rely on headers which have moved. Create symlinks to accommodate these:
 +
 +
ln -sv npfunctions.h /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/stable/npupp.h
 +
ln -sv npfunctions.h /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/npupp.h
  
 
=== 50-xulrunner.sh ===
 
=== 50-xulrunner.sh ===
Line 58: Line 69:
 
=== 32Bit ===
 
=== 32Bit ===
  
If you're using a system wide installation of [[NSS]] and [[NSPR]] then apply the following patch so that their headers can be found properly:
+
Fix a handful of compilation errors with gcc4:
  
  xulrunner-{{XULRunner-Version}}-system_nss-1.patch
+
  sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc &&
 +
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc &&
 +
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc
  
 
Use the following command to append your '''.mozconfig''' with 32bit specific flags:
 
Use the following command to append your '''.mozconfig''' with 32bit specific flags:
Line 73: Line 86:
 
  mk_add_options CONFIG_GUESS=$CLFS_TARGET32
 
  mk_add_options CONFIG_GUESS=$CLFS_TARGET32
 
  EOF
 
  EOF
 +
 +
Adjust some hardwired paths for arch-dependent config files:
 +
 +
sed -i 's/gre\.d/&-32/g' $(grep -lr 'gre\.d' *)
  
 
==== x86 ====
 
==== x86 ====
Line 83: Line 100:
  
 
  make -f client.mk OS_TEST=x86 install
 
  make -f client.mk OS_TEST=x86 install
 +
mv -v /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/js-config{,-32}.h
 +
mv -v /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/mozilla-config{,-32}.h
  
 
==== ppc64 ====
 
==== ppc64 ====
Line 93: Line 112:
  
 
  make -f client.mk OS_TEST=ppc install
 
  make -f client.mk OS_TEST=ppc install
 +
mv -v /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/js-config{,-32}.h
 +
mv -v /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/mozilla-config{,-32}.h
  
 
=== 64Bit ===
 
=== 64Bit ===
  
If you're using a system wide installation of [[NSS]] and [[NSPR]] then apply the following patch so that their headers can be found properly:
+
Fix a handful of compilation errors with gcc4:
  
  xulrunner-{{XULRunner-Version}}-system_nss-1.patch
+
  sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc &&
 +
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc &&
 +
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc
  
 
Use the following command to append your '''.mozconfig''' with 64bit specific flags:
 
Use the following command to append your '''.mozconfig''' with 64bit specific flags:
Line 109: Line 132:
 
  export USE_ARCH=64
 
  export USE_ARCH=64
 
  EOF
 
  EOF
 +
 +
{{Note|For PPC64, CFLAGS and CXXFLAGS may neeed to include ''-mminimal-toc'' to avoid automatic multiple
 +
TOCs.}}
 +
 +
Adjust some hardwired paths for arch-dependent config files:
 +
 +
sed -i 's/gre\.d/&-64/g' $(grep -lr 'gre\.d' *)
  
 
Compile the package:
 
Compile the package:
Line 115: Line 145:
  
 
Install the package:
 
Install the package:
 +
 +
make -f client.mk install
 +
mv -v /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/js-config{,-64}.h
 +
mv -v /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/mozilla-config{,-64}.h
 +
 +
Some applications rely on headers which have moved. Create symlinks to accommodate these:
 +
 +
ln -sv npfunctions.h /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/stable/npupp.h
 +
ln -sv npfunctions.h /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/npupp.h
 +
 +
==== Creating Generic Stub Headers ====
 +
 +
cat > /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/js-config.h << "EOF"
 +
/* js-config.h - Stub Header  */
 +
#ifndef __STUB__XULRUNNER_JS_CONFIG_H__
 +
#define __STUB__XULRUNNER_JS_CONFIG_H__
 +
 +
#if defined(__x86_64__) || \
 +
    defined(__sparc64__) || \
 +
    defined(__arch64__) || \
 +
    defined(__powerpc64__) || \
 +
    defined (__s390x__)
 +
# include "js-config-64.h"
 +
#else
 +
# include "js-config-32.h"
 +
#endif
 +
 +
#endif /* __STUB__XULRUNNER_JS_CONFIG_H__ */
 +
EOF
 +
cat > /opt/xulrunner-{{XULRunner-Version}}/include/xulrunner-{{XULRunner-Version}}/unstable/mozilla-config.h << "EOF"
 +
/* mozilla-config.h - Stub Header  */
 +
#ifndef __STUB__XULRUNNER_MOZILLA_CONFIG_H__
 +
#define __STUB__XULRUNNER_MOZILLA_CONFIG_H__
 +
 +
#if defined(__x86_64__) || \
 +
    defined(__sparc64__) || \
 +
    defined(__arch64__) || \
 +
    defined(__powerpc64__) || \
 +
    defined (__s390x__)
 +
# include "mozilla-config-64.h"
 +
#else
 +
# include "mozilla-config-32.h"
 +
#endif
 +
 +
#endif /* __STUB__XULRUNNER_MOZILLA_CONFIG_H__ */
 +
EOF
  
 
=== 50-xulrunner.sh ===
 
=== 50-xulrunner.sh ===
Line 130: Line 206:
 
  # End /etc/profile.d/50-xulrunner.sh
 
  # End /etc/profile.d/50-xulrunner.sh
 
  EOF
 
  EOF
 +
 +
[[Category:GUI Clients]]

Latest revision as of 06:14, 24 July 2011

Download Source: http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.1.16/source/xulrunner-1.9.1.16.source.tar.bz2

Introduction to XULRunner

XULRunner is a Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It will provide mechanisms for installing, upgrading, and uninstalling these applications. XULRunner will also provide libxul, a solution which allows the embedding of Mozilla technologies in other projects and products.

Project Homepage: https://developer.mozilla.org/en/XULRunner

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 and the second line determines where the build objects are going to reside.

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.

--disable-tests prevents test programs from being built which saves a lot of disk space and time.

--disable-installer prevents the installer from being built.

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

ac_add_options --prefix=/opt/xulrunner-1.9.1.16

ac_cv_visibility_pragma=no

ac_add_options --with-nspr-prefix=/usr
ac_add_options --with-nss-prefix=/usr
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
ac_add_options --with-system-png
ac_add_options --with-system-zlib

ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --disable-xprint
ac_add_options --disable-tests

ac_add_options --enable-canvas
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-safe-browsing
ac_add_options --enable-svg
ac_add_options --enable-system-cairo
ac_add_options --enable-system-sqlite
EOF

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

cat >> .mozconfig << "EOF"
ac_add_options --enable-xinerama
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

If you do not have JDK installed then add the following to your .mozconfig:

cat >> .mozconfig << "EOF"
ac_add_options --disable-javaxpcom
EOF

Non-Multilib

Fix a handful of compilation errors with gcc4:

sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc &&
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc &&
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc

There are several incompatibilities with GCC 4.6. If you get compile errors about nsEnumeratorUtils.cpp:115:27: error: uninitialized const EmptyEnumeratorImpl::kInstance then you need to get a patch from here: https://bugzilla.mozilla.org/show_bug.cgi?id=623126

Compile the package:

make -f client.mk build

Install the package:

make -f client.mk install

Some applications rely on headers which have moved. Create symlinks to accommodate these:

ln -sv npfunctions.h /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/stable/npupp.h
ln -sv npfunctions.h /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/npupp.h

50-xulrunner.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-xulrunner.sh << "EOF"
# Begin /etc/profile.d/50-xulrunner.sh

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

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

Multilib

32Bit

Fix a handful of compilation errors with gcc4:

sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc &&
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc &&
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc

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

Adjust some hardwired paths for arch-dependent config files:

sed -i 's/gre\.d/&-32/g' $(grep -lr 'gre\.d' *)

x86

Compile the package:

make -f client.mk OS_TEST=x86 build

Install the package:

make -f client.mk OS_TEST=x86 install
mv -v /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/js-config{,-32}.h
mv -v /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/mozilla-config{,-32}.h

ppc64

Compile the package:

make -f client.mk OS_TEST=powerpc build

Install the package:

make -f client.mk OS_TEST=ppc install
mv -v /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/js-config{,-32}.h
mv -v /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/mozilla-config{,-32}.h

64Bit

Fix a handful of compilation errors with gcc4:

sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc &&
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc &&
sed -i '1i\#include <stdio.h>' toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc

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

cat >> .mozconfig << EOF
ac_add_options --libdir=/opt/xulrunner-1.9.1.16/lib64
export CC="gcc ${BUILD64}"
export CXX="g++ ${BUILD64}"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}"
export USE_ARCH=64
EOF
Caution.png

Note

For PPC64, CFLAGS and CXXFLAGS may neeed to include -mminimal-toc to avoid automatic multiple TOCs.

Adjust some hardwired paths for arch-dependent config files:

sed -i 's/gre\.d/&-64/g' $(grep -lr 'gre\.d' *)

Compile the package:

make -f client.mk build

Install the package:

make -f client.mk install
mv -v /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/js-config{,-64}.h
mv -v /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/mozilla-config{,-64}.h

Some applications rely on headers which have moved. Create symlinks to accommodate these:

ln -sv npfunctions.h /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/stable/npupp.h
ln -sv npfunctions.h /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/npupp.h

Creating Generic Stub Headers

cat > /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/js-config.h << "EOF"
/* js-config.h - Stub Header  */
#ifndef __STUB__XULRUNNER_JS_CONFIG_H__
#define __STUB__XULRUNNER_JS_CONFIG_H__

#if defined(__x86_64__) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "js-config-64.h"
#else
# include "js-config-32.h"
#endif

#endif /* __STUB__XULRUNNER_JS_CONFIG_H__ */
EOF
cat > /opt/xulrunner-1.9.1.16/include/xulrunner-1.9.1.16/unstable/mozilla-config.h << "EOF"
/* mozilla-config.h - Stub Header  */
#ifndef __STUB__XULRUNNER_MOZILLA_CONFIG_H__
#define __STUB__XULRUNNER_MOZILLA_CONFIG_H__

#if defined(__x86_64__) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "mozilla-config-64.h"
#else
# include "mozilla-config-32.h"
#endif

#endif /* __STUB__XULRUNNER_MOZILLA_CONFIG_H__ */
EOF

50-xulrunner.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-xulrunner.sh << "EOF"
# Begin /etc/profile.d/50-xulrunner.sh

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

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