# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-libs/xulrunner/xulrunner-1.8.0.1.ebuild,v 1.1 2006/06/02 01:56:01 anarchy Exp $ inherit flag-o-matic toolchain-funcs eutils makeedit multilib autotools mozconfig-2 PVER="0.6" DESCRIPTION="Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications" HOMEPAGE="http://developer.mozilla.org/en/docs/XULRunner" SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/${PN}/releases/${PV}/source/${P}-source.tar.bz2 mirror://gentoo/${P}-patches-${PVER}.tar.bz2 http://dev.gentoo.org/~anarchy/dist/${P}-patches-${PVER}.tar.bz2" LICENSE="MPL-1.1 NPL-1.1" SLOT="0" KEYWORDS="-* ~amd64 ~x86" IUSE="java" RDEPEND="java? ( virtual/jre ) >=sys-libs/zlib-1.1.4 >=sys-devel/binutils-2.16.1 >=dev-libs/nss-3.10 >=dev-libs/nspr-4.6.1" DEPEND="${RDEPEND} dev-util/pkgconfig java? ( >=dev-java/java-config-0.2.0 )" S=${WORKDIR}/mozilla # Needed by src_compile() and src_install(). # Would do in pkg_setup but that loses the export attribute, they # become pure shell variables. export MOZ_CO_PROJECT=xulrunner export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 src_unpack() { unpack ${P}-source.tar.bz2 ${P}-patches-${PVER}.tar.bz2 # Apply our patches cd ${S} || die "cd failed" # exclude the xpcomglue-shared.patch from debian for now # until we figured out if we need also the versioning patch EPATCH_EXCLUDE="113-xpcomglue-shared.patch.bz2" EPATCH_FORCE="yes" epatch ${WORKDIR}/patch # Fix a compilation issue using the 32-bit userland with 64-bit kernel on # PowerPC, because with that configuration, it detects a ppc64 system. # -- hansmi, 2005-11-13 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \ ${S}/configure sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \ ${S}/security/coreconf/arch.mk fi WANT_AUTOCONF="2.13" \ eautoreconf || die "failed running eautoreconf" } src_compile() { declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN} #################################### # # mozconfig, CFLAGS and CXXFLAGS setup # #################################### mozconfig_init mozconfig_config mozconfig_annotate '' --enable-extensions="default,cookie,permissions" mozconfig_annotate '' --enable-native-uconv mozconfig_annotate '' --enable-image-encoder=all mozconfig_annotate '' --enable-canvas #mozconfig_annotate '' --enable-js-binary mozconfig_annotate '' --enable-embedding-tests mozconfig_annotate '' --with-system-nspr mozconfig_annotate '' --with-system-nss mozconfig_annotate '' --with-system-bz2 mozconfig_annotate '' --enable-jsd mozconfig_annotate '' --enable-xpctools # Bug 60668: Galeon doesn't build without oji enabled, so enable it # regardless of java setting. mozconfig_annotate '' --enable-oji --enable-mathml mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME} # Finalize and report settings mozconfig_final # hardened GCC uses -fstack-protector-all by default, which breaks us gcc-specs-ssp && append-flags -fno-stack-protector-all # remove -fstack-protector because now it borks firefox CFLAGS=${CFLAGS/-fstack-protector-all/} CFLAGS=${CFLAGS/-fstack-protector/} CXXFLAGS=${CXXFLAGS/-fstack-protector-all/} CXXFLAGS=${CXXFLAGS/-fstack-protector/} append-flags -freorder-blocks -fno-reorder-functions # Export CPU_ARCH_TEST as it is not exported by default. case $(tc-arch) in amd64) [[ ${ABI} == "x86" ]] && CPU_ARCH_TEST="x86" || CPU_ARCH_TEST="x86_64" ;; *) CPU_ARCH_TEST=$(tc-arch) ;; esac export CPU_ARCH_TEST #################################### # # Configure and build # #################################### CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \ econf || die # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior # to econf, but the quotes cause configure to fail. sed -i -e \ 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \ ${S}/config/autoconf.mk \ ${S}/xpfe/global/buildconfig.html # This removes extraneous CFLAGS from the Makefiles to reduce RAM # requirements while compiling edit_makefiles emake || die } src_install() { einstall || die "failed running make install" }