Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Improve Firefox Look
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Zepp
Veteran
Veteran


Joined: 15 Mar 2004
Posts: 1246
Location: Ontario, Canada

PostPosted: Thu Jul 12, 2007 3:40 pm    Post subject: Reply with quote

Been using this for awhile, found out about it on the archlinux forums, no problems,
Back to top
View user's profile Send private message
HTS
Guru
Guru


Joined: 20 Feb 2006
Posts: 410
Location: Bristol, UK

PostPosted: Fri Oct 19, 2007 8:58 pm    Post subject: Reply with quote

Sick of these ugly Firefox forms?
Try Pretty Widgets! :D

Packaged for you by HTS.

Before
After

Pretty Widgets for Gentoo

Simply run the install script as root.
It will make a backup of the forms.css in case you want to revert.
_________________
Plasma desktop on Core i7 8086K OC @ 5GHz, 64GB DDR4, 2 x M.2 Samsung 970 PRO 1TB SSDs
Back to top
View user's profile Send private message
p4ddY
n00b
n00b


Joined: 29 Jul 2007
Posts: 7

PostPosted: Sat Oct 20, 2007 12:38 am    Post subject: Reply with quote

b33fc0d3 wrote:
This is in minefield (firefox cvs trunk)


No, it's not.
This are simply pictures set by a custom style sheet.
Minefield provides real GTK form widgets.
Back to top
View user's profile Send private message
HTS
Guru
Guru


Joined: 20 Feb 2006
Posts: 410
Location: Bristol, UK

PostPosted: Sat Oct 20, 2007 1:11 am    Post subject: Reply with quote

Proper native GTK+ widgets? That's good news!

So the firefox devs finally realised their forms looked appalling ;)
_________________
Plasma desktop on Core i7 8086K OC @ 5GHz, 64GB DDR4, 2 x M.2 Samsung 970 PRO 1TB SSDs
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 563
Location: China

PostPosted: Wed Nov 28, 2007 8:41 pm    Post subject: Reply with quote

Has anyone created a firefox ebuild with a widgets flag yet? would it be enough just to attach the lines from that page to the ebuild (depending on a use flag of course)?
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 563
Location: China

PostPosted: Wed Dec 26, 2007 4:16 pm    Post subject: Reply with quote

I created an ebuild. It does not work, can you please check it? I'm not familiar with creating ebuilds yet.
I changed the IUSE and the SRC_URI parts
the instructions to unpack and install the widgets are always at the ends of the concerning sections.
Code:
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-2.0.0.11.ebuild,v 1.10 2007/12/18 00:41:35 redhatter Exp $

WANT_AUTOCONF="2.1"

inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools

PATCH="${P}-patches-0.1"
LANGS="af ar be bg ca cs da de el en-GB es-AR es-ES eu fi fr fy-NL ga-IE gu-IN he hu it ja ka ko ku lt mk mn nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ro ru sk sl sv-SE tr uk zh-CN zh-TW"
NOSHORTLANGS="en-GB es-AR pt-BR zh-TW"

DESCRIPTION="Firefox Web Browser"
HOMEPAGE="http://www.mozilla.org/projects/firefox/"

KEYWORDS="alpha amd64 ~arm hppa ia64 mips ppc ppc64 sparc x86 ~x86-fbsd"
SLOT="0"
LICENSE="MPL-1.1 GPL-2 LGPL-2.1"
IUSE="java mozdevelop bindist xforms restrict-javascript filepicker iceweasel widgets"

MOZ_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}"
SRC_URI="${MOZ_URI}/source/firefox-${PV}-source.tar.bz2
   mirror://gentoo/${PATCH}.tar.bz2
   iceweasel? ( mirror://gentoo/iceweasel-icons-2.0.0.11.tar.bz2 )
   widgets? ( http://users.tkk.fi/~otsaloma/art/firefox-form-widgets.tar.gz )"

# These are in
#
#  http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/
#
# for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
for X in ${LANGS} ; do
   SRC_URI="${SRC_URI}
      linguas_${X/-/_}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
   IUSE="${IUSE} linguas_${X/-/_}"
   # english is handled internally
   if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
      SRC_URI="${SRC_URI}
         linguas_${X%%-*}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
      IUSE="${IUSE} linguas_${X%%-*}"
   fi
done

RDEPEND="java? ( virtual/jre )
   >=www-client/mozilla-launcher-1.55
   >=sys-devel/binutils-2.16.1
   >=dev-libs/nss-3.11.7
   >=dev-libs/nspr-4.6.7"

DEPEND="${RDEPEND}
   java? ( >=dev-java/java-config-0.2.0 )"

PDEPEND="restrict-javascript? ( x11-plugins/noscript )"

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=browser
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1

linguas() {
   local LANG SLANG
   for LANG in ${LINGUAS}; do
      if has ${LANG} en en_US; then
         has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
         continue
      elif has ${LANG} ${LANGS//-/_}; then
         has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
         continue
      elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
         for X in ${LANGS}; do
            if [[ "${X}" == "${LANG}-"* ]] && \
               [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
               has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
               continue 2
            fi
         done
      fi
      ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
   done
}

pkg_setup(){
   if ! built_with_use x11-libs/cairo X; then
      eerror "Cairo is not built with X useflag."
      eerror "Please add 'X' to your USE flags, and re-emerge cairo."
      die "Cairo needs X"
   fi

   if ! use bindist && ! use iceweasel; then
      elog "You are enabling official branding. You may not redistribute this build"
      elog "to any users on your network or the internet. Doing so puts yourself into"
      elog "a legal problem with Mozilla Foundation"
      elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"

   fi

   use moznopango && warn_mozilla_launcher_stub
}

src_unpack() {
   unpack firefox-${PV}-source.tar.bz2  ${PATCH}.tar.bz2

   if use iceweasel; then
      unpack iceweasel-icons-2.0.0.11.tar.bz2

      cp -r iceweaselicons/browser mozilla/
   fi

   linguas
   for X in ${linguas}; do
      [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
   done
   if [[ ${linguas} != "" ]]; then
      einfo "Selected language packs (first will be default): ${linguas}"
   fi

   # Apply our patches
   cd "${S}" || die "cd failed"
   EPATCH_SUFFIX="patch" \
   EPATCH_FORCE="yes" \
   epatch "${WORKDIR}"/patch

   if use filepicker; then
      epatch "${FILESDIR}"/mozilla-filepicker.patch
   fi

   if use iceweasel; then
      sed -i -e "s|Bon Echo|Iceweasel|" browser/locales/en-US/chrome/branding/brand.*
   fi

   eautoreconf

   if use widgets; then
      unpack firefox-form-widgets.tar.gz
   fi
}

src_compile() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   mozconfig_init
   mozconfig_config

   mozconfig_annotate '' --enable-application=browser
   mozconfig_annotate '' --enable-image-encoder=all
   mozconfig_annotate '' --enable-canvas
   mozconfig_annotate '' --with-system-nspr
   mozconfig_annotate '' --with-system-nss

   if use xforms; then
      mozconfig_annotate '' --enable-extensions=default,xforms,schema-validation,typeaheadfind
   else
      mozconfig_annotate '' --enable-extensions=default,typeaheadfind
   fi

   if use ia64; then
      echo "ac_cv_visibility_pragma=no" >>  "${S}/.mozconfig"
   fi

   if ! use bindist && ! use iceweasel; then
      mozconfig_annotate '' --enable-official-branding
   fi

   # Bug 60668: Galeon doesn't build without oji enabled, so enable it
   # regardless of java setting.
   mozconfig_annotate '' --enable-oji --enable-mathml

   # Other ff-specific settings
   mozconfig_use_enable mozdevelop jsd
   mozconfig_use_enable mozdevelop xpctools
   mozconfig_use_extension mozdevelop venkman
   mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}

   # Finalize and report settings
   mozconfig_final

   # -fstack-protector breaks us
   if gcc-version ge 4 1; then
      gcc-specs-ssp && append-flags -fno-stack-protector
   else
      gcc-specs-ssp && append-flags -fno-stack-protector-all
   fi
      filter-flags -fstack-protector -fstack-protector-all

   ####################################
   #
   #  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}"/toolkit/content/buildconfig.html

   # This removes extraneous CFLAGS from the Makefiles to reduce RAM
   # requirements while compiling
   edit_makefiles

   # Should the build use multiprocessing? Not enabled by default, as it tends to break
   [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
   emake ${jobs} || die
}//users.tkk.fi/~otsaloma/art/firefox-form-widgets.tar.gz

pkg_preinst() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   einfo "Removing old installs with some really ugly code.  It potentially"
   einfo "eliminates any problems during the install, however suggestions to"
   einfo "replace this are highly welcome.  Send comments and suggestions to"
   einfo "mozilla@gentoo.org."
   rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
}

src_install() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   # Most of the installation happens here
   dodir "${MOZILLA_FIVE_HOME}"
   cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"

   linguas
   for X in ${linguas}; do
      [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
   done

   local LANG=${linguas%% *}
   if [[ -n ${LANG} && ${LANG} != "en" ]]; then
      elog "Setting default locale to ${LANG}"
      dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
         "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
         "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
         die "sed failed to change locale"
   fi

   # Create /usr/bin/firefox
   install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"

   # Install icon and .desktop for menu entry
   if use iceweasel; then
      newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
      newmenu "${FILESDIR}"/icon/iceweasel.desktop \
         mozilla-firefox-2.0.desktop
   elif ! use bindist; then
      doicon "${FILESDIR}"/icon/firefox-icon.png
      newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
         mozilla-firefox-2.0.desktop
   else
      doicon "${FILESDIR}"/icon/firefox-icon-unbranded.png
      newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
         mozilla-firefox-2.0.desktop
   fi

   # Fix icons to look the same everywhere
   insinto "${MOZILLA_FIVE_HOME}"/icons
   doins "${S}"/dist/branding/mozicon16.xpm
   doins "${S}"/dist/branding/mozicon50.xpm

   # Install files necessary for applications to build against firefox
   einfo "Installing includes and idl files..."
   cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
   cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"

   # Dirty hack to get some applications using this header running
   dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
      "${MOZILLA_FIVE_HOME}"/include/nsIURI.h

   # Install pkgconfig files
   insinto /usr/"$(get_libdir)"/pkgconfig
   doins "${S}"/build/unix/*.pc

   insinto "${MOZILLA_FIVE_HOME}"/greprefs
   newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
   insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
   newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js

   if use widgets; then
   cp /usr/$(get_libdir)/mozilla-firefox/res/forms.css /usr/$(get_libdir)/mozilla-firefox/res/forms.css.bak
   cat firefox-form-widgets/res/forms-extra.css >> /usr/$(get_libdir)/mozilla-firefox/res/forms.css > /dev/null

   cp -r firefox-form-widgets/res/form-widgets /usr/$(get_libdir)/mozilla-firefox/res
   fi
}

pkg_postinst() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   # This should be called in the postinst and postrm of all the
   # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
   # thunderbird-bin ebuilds.
   update_mozilla_launcher_symlinks

   # Update mimedb for the new .desktop file
   fdo-mime_desktop_database_update

   elog "Please remember to rebuild any packages that you have built"
   elog "against Firefox. Some packages might be broken by the upgrade; if this"
   elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
   elog "if one does not exist. Before filing any bugs, please move or remove"
   elog " ~/.mozilla and test with a clean profile directory."
}

pkg_postrm() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   update_mozilla_launcher_symlinks
}


Last edited by MalleRIM on Wed Dec 26, 2007 4:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Wed Dec 26, 2007 4:25 pm    Post subject: Reply with quote

I am not sure about the restrictions that mozilla imposes, but I think that you should consider disabling everything related to that css if the "bindist" use flag is set, since that is a non-official inclusion, and mozilla would not like if people redistribute binary packages with that.
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 563
Location: China

PostPosted: Wed Dec 26, 2007 4:32 pm    Post subject: Reply with quote

These parts have been in the ebuild before I changed it so I think they shouldn't cause any legal problem. Correct me, when I'm wrong.

edit: I can't even use ebuild <file> digest for the firefox ebuild in portage...?
edit2: everything ok, I must have changed it by accident
Back to top
View user's profile Send private message
Belliash
Advocate
Advocate


Joined: 24 Nov 2004
Posts: 2503
Location: Wroclaw, Poland

PostPosted: Wed Dec 26, 2007 4:51 pm    Post subject: Reply with quote

Maybe we should make 3rd party ebuild (as addon for firefox) which would make changes for us?
After every reemerging of firefox we will just need to emerge that package also...

This would save time (looking / waiting for new ebuild).. Just install firefox from portage and "crack".

What do U think?
_________________
Asio Software Technologies
Belliash IT Weblog
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 563
Location: China

PostPosted: Thu Dec 27, 2007 3:24 pm    Post subject: Reply with quote

The package would mess up another ebuild's files which isn't a good idea I think. The new firefox ebuilds wouldn't be delayed very long because once you found out how to make them, you won't have any problems with it. So a changed firefox ebuild is the best sollution.
I'm just trying the new ebuild (not the one above but a working one ;))
edit: hum, the src_install part does not work :(
Back to top
View user's profile Send private message
Belliash
Advocate
Advocate


Joined: 24 Nov 2004
Posts: 2503
Location: Wroclaw, Poland

PostPosted: Thu Dec 27, 2007 5:50 pm    Post subject: Reply with quote

So, ... any working ebuild? :)
_________________
Asio Software Technologies
Belliash IT Weblog
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 563
Location: China

PostPosted: Thu Dec 27, 2007 10:50 pm    Post subject: Reply with quote

nope, I don't know how to do this :(
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 563
Location: China

PostPosted: Sun Dec 30, 2007 1:44 pm    Post subject: Reply with quote

I created an ebuild that works but it doesn't create the files I want to have. This is it:
Code:
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-2.0.0.11.ebuild,v 1.10 2007/12/18 00:41:35 redhatter Exp $

WANT_AUTOCONF="2.1"

inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools

PATCH="${P}-patches-0.1"
LANGS="af ar be bg ca cs da de el en-GB es-AR es-ES eu fi fr fy-NL ga-IE gu-IN he hu it ja ka ko ku lt mk mn nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ro ru sk sl sv-SE tr uk zh-CN zh-TW"
NOSHORTLANGS="en-GB es-AR pt-BR zh-TW"

DESCRIPTION="Firefox Web Browser"
HOMEPAGE="http://www.mozilla.org/projects/firefox/"

KEYWORDS="alpha amd64 ~arm hppa ia64 mips ppc ppc64 sparc x86 ~x86-fbsd"
SLOT="0"
LICENSE="MPL-1.1 GPL-2 LGPL-2.1"
IUSE="java mozdevelop bindist xforms restrict-javascript filepicker iceweasel widgets"

MOZ_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}"
SRC_URI="${MOZ_URI}/source/firefox-${PV}-source.tar.bz2
   mirror://gentoo/${PATCH}.tar.bz2
   iceweasel? ( mirror://gentoo/iceweasel-icons-2.0.0.11.tar.bz2 )
   widgets? ( http://users.tkk.fi/~otsaloma/art/firefox-form-widgets.tar.gz )"


# These are in
#
#  http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/
#
# for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
for X in ${LANGS} ; do
   SRC_URI="${SRC_URI}
      linguas_${X/-/_}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
   IUSE="${IUSE} linguas_${X/-/_}"
   # english is handled internally
   if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
      SRC_URI="${SRC_URI}
         linguas_${X%%-*}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
      IUSE="${IUSE} linguas_${X%%-*}"
   fi
done

RDEPEND="java? ( virtual/jre )
   >=www-client/mozilla-launcher-1.55
   >=sys-devel/binutils-2.16.1
   >=dev-libs/nss-3.11.7
   >=dev-libs/nspr-4.6.7"

DEPEND="${RDEPEND}
   java? ( >=dev-java/java-config-0.2.0 )"

PDEPEND="restrict-javascript? ( x11-plugins/noscript )"

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=browser
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1

linguas() {
   local LANG SLANG
   for LANG in ${LINGUAS}; do
      if has ${LANG} en en_US; then
         has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
         continue
      elif has ${LANG} ${LANGS//-/_}; then
         has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
         continue
      elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
         for X in ${LANGS}; do
            if [[ "${X}" == "${LANG}-"* ]] && \
               [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
               has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
               continue 2
            fi
         done
      fi
      ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
   done
}

pkg_setup(){
   if ! built_with_use x11-libs/cairo X; then
      eerror "Cairo is not built with X useflag."
      eerror "Please add 'X' to your USE flags, and re-emerge cairo."
      die "Cairo needs X"
   fi

   if ! use bindist && ! use iceweasel; then
      elog "You are enabling official branding. You may not redistribute this build"
      elog "to any users on yourWORKDIR network or the internet. Doing so puts yourself into"
      elog "a legal problem with Mozilla Foundation"
      elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"

   fi

   use moznopango && warn_mozilla_launcher_stub
}

src_unpack() {
   unpack firefox-${PV}-source.tar.bz2  ${PATCH}.tar.bz2

   if use iceweasel; then
      unpack iceweasel-icons-2.0.0.11.tar.bz2

      cp -r iceweaselicons/browser mozilla/
   fi

   linguas
   for X in ${linguas}; do
      [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
   done
   if [[ ${linguas} != "" ]]; then
      einfo "Selected language packs (first will be default): ${linguas}"
   fi

   # Apply our patches
   cd "${S}" || die "cd failed"
   EPATCH_SUFFIX="patch" \
   EPATCH_FORCE="yes" \
   epatch "${WORKDIR}"/patch

   if use filepicker; then
      epatch "${FILESDIR}"/mozilla-filepicker.patch
   fi

   if use iceweasel; then
      sed -i -e "s|Bon Echo|Iceweasel|" browser/locales/en-US/chrome/branding/brand.*
   fi

   eautoreconf

   if use widgets; then
      unpack firefox-form-widgets.tar.gz
   fi
}

src_compile() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   mozconfig_init
   mozconfig_config

   mozconfig_annotate '' --enable-application=browser
   mozconfig_annotate '' --enable-image-encoder=all
   mozconfig_annotate '' --enable-canvas
   mozconfig_annotate '' --with-system-nspr
   mozconfig_annotate '' --with-system-nss

   if use xforms; then
      mozconfig_annotate '' --enable-extensions=default,xforms,schema-validation,typeaheadfind
   else
      mozconfig_annotate '' --enable-extensions=default,typeaheadfind
   fi

   if use ia64; then
      echo "ac_cv_visibility_pragma=no" >>  "${S}/.mozconfig"
   fi

   if ! use bindist && ! use iceweasel; then
      mozconfig_annotate '' --enable-official-branding
   fi

   # Bug 60668: Galeon doesn't build without oji enabled, so enable it
   # regardless of java setting.
   mozconfig_annotate '' --enable-oji --enable-mathml

   # Other ff-specific settings
   mozconfig_use_enable mozdevelop jsd
   mozconfig_use_enable mozdevelop xpctools
   mozconfig_use_extension mozdevelop venkman
   mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}

   # Finalize and report settings
   mozconfig_final

   # -fstack-protector breaks us
   if gcc-version ge 4 1; then
      gcc-specs-ssp && append-flags -fno-stack-protector
   else
      gcc-specs-ssp && append-flags -fno-stack-protector-all
   fi
      filter-flags -fstack-protector -fstack-protector-all

   ####################################
   #
   #  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}"/toolkit/content/buildconfig.html

   # This removes extraneous CFLAGS from the Makefiles to reduce RAM
   # requirements while compiling
   edit_makefiles

   # Should the build use multiprocessing? Not enabled by default, as it tends to break
   [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
   emake ${jobs} || die
}

pkg_preinst() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   einfo "Removing old installs with some really ugly code.  It potentially"
   einfo "eliminates any problems during the install, however suggestions to"
   einfo "replace this are highly welcome.  Send comments and suggestions to"
   einfo "mozilla@gentoo.org."
   rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
}

src_install() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   # Most of the installation happens here
   dodir "${MOZILLA_FIVE_HOME}"
   cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"

   linguas
   for X in ${linguas}; do
      [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
   done

   local LANG=${linguas%% *}
   if [[ -n ${LANG} && ${LANG} != "en" ]]; then
      elog "Setting default locale to ${LANG}"
      dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
         "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
         "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
         die "sed failed to change locale"
   fi

   # Create /usr/bin/firefox
   install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"

   # Install icon and .desktop for menu entry
   if use iceweasel; then
      newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
      newmenu "${FILESDIR}"/icon/iceweasel.desktop \
         mozilla-firefox-2.0.desktop
   elif ! use bindist; then
      doicon "${FILESDIR}"/icon/firefox-icon.png
      newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
         mozilla-firefox-2.0.desktop
   else
      doicon "${FILESDIR}"/icon/firefox-icon-unbranded.png
      newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
         mozilla-firefox-2.0.desktop
   fi

   # Fix icons to look the same everywhere
   insinto "${MOZILLA_FIVE_HOME}"/icons
   doins "${S}"/dist/branding/mozicon16.xpm
   doins "${S}"/dist/branding/mozicon50.xpm

   # Install files necessary for applications to build against firefox
   einfo "Installing includes and idl files..."
   cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
   cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"

   # Dirty hack to get some applications using this header running
   dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
      "${MOZILLA_FIVE_HOME}"/include/nsIURI.h

   # Install pkgconfig files
   insinto /usr/"$(get_libdir)"/pkgconfig
   doins "${S}"/build/unix/*.pc

   insinto "${MOZILLA_FIVE_HOME}"/greprefs
   newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
   insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
   newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js

   if use widgets; then
      cp ${D}/usr/$(get_libdir)/mozilla-firefox/res/forms.css ${D}/usr/$(get_libdir)/mozilla-firefox/res/forms.css.bak
      cat ${S}/firefox-form-widgets/res/forms-extra.css >> ${D}/usr/$(get_libdir)/mozilla-firefox/res/forms.css > /dev/null
       cp -r ${S}firefox-form-widgets/res/form-widgets ${D}/usr/$(get_libdir)/mozilla-firefox/res
   fi
}

pkg_postinst() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   # This should be called in the postinst and postrm of all the
   # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
   # thunderbird-bin ebuilds.
   update_mozilla_launcher_symlinks

   # Update mimedb for the new .desktop file
   fdo-mime_desktop_database_update

   elog "Please remember to rebuild any packages that you have built"
   elog "against Firefox. Some packages might be broken by the upgrade; if this"
   elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
   elog "if one does not exist. Before filing any bugs, please move or remove"
   elog " ~/.mozilla and test with a clean profile directory."
}

pkg_postrm() {
   declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"

   update_mozilla_launcher_symlinks
}
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 563
Location: China

PostPosted: Mon Feb 18, 2008 2:56 pm    Post subject: Reply with quote

I'm not going to try creating an ebuild any longer as I installed FF3 beta3 which has, as mentioned before, native GTK-Widgets - not for all kinds of dropdown menus though (?). Just get it from the overlay "mozilla". It also seems to be faster than FF2.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum