From 9896e68dce45157070c17647a4030fe83cb0fc060de3ec4309894e2fecf90bf3 Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Tue, 28 Jun 2011 18:42:13 +0000 Subject: [PATCH] update to thunderbird 5 OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaThunderbird?expand=0&rev=116 --- MozillaThunderbird.changes | 9 + MozillaThunderbird.spec | 159 ++-- compare-locales.tar.bz2 | 3 + create-tar.sh | 17 +- enigmail-1.1.2.tar.bz2 | 3 - enigmail-1.1.99.tar.bz2 | 3 + enigmail-cz-CZ-fix.patch | 68 ++ l10n-3.1.11.tar.bz2 | 3 - l10n-5.0.tar.bz2 | 3 + mozilla-cairo-lcd.patch | 1333 +++++++++++++++++++++++++++++ mozilla-cairo-return.patch | 21 + mozilla-gcc46.patch | 105 --- mozilla-gdk-pixbuf.patch | 31 - mozilla-gio.patch | 284 ++++++ mozilla-language.patch | 48 ++ mozilla-shared-nss-db.patch | 77 +- mozilla-xsmp.patch | 192 ----- mozilla.sh.in | 13 +- tb-develdirs.patch | 19 +- tb-ssldap.patch | 4 +- thunderbird-3.1.11-source.tar.bz2 | 3 - thunderbird-5.0-source.tar.bz2 | 3 + thunderbird-appname.patch | 26 - thunderbird-gio.patch | 254 ++++++ thunderbird-shared-nss-db.patch | 28 +- 25 files changed, 2206 insertions(+), 503 deletions(-) create mode 100644 compare-locales.tar.bz2 delete mode 100644 enigmail-1.1.2.tar.bz2 create mode 100644 enigmail-1.1.99.tar.bz2 create mode 100644 enigmail-cz-CZ-fix.patch delete mode 100644 l10n-3.1.11.tar.bz2 create mode 100644 l10n-5.0.tar.bz2 create mode 100644 mozilla-cairo-lcd.patch create mode 100644 mozilla-cairo-return.patch delete mode 100644 mozilla-gcc46.patch delete mode 100644 mozilla-gdk-pixbuf.patch create mode 100644 mozilla-gio.patch create mode 100644 mozilla-language.patch delete mode 100644 mozilla-xsmp.patch delete mode 100644 thunderbird-3.1.11-source.tar.bz2 create mode 100644 thunderbird-5.0-source.tar.bz2 delete mode 100644 thunderbird-appname.patch create mode 100644 thunderbird-gio.patch diff --git a/MozillaThunderbird.changes b/MozillaThunderbird.changes index c29ad0f..fc6a5c3 100644 --- a/MozillaThunderbird.changes +++ b/MozillaThunderbird.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Jun 25 08:31:05 UTC 2011 - wr@rosenauer.org + +- update to version 5.0 +- new enigmail cvs snapshot +- improved logic for the launcher command +- enable gio usage (instead of gnomevfs) for 11.4 and newer +- build dump_syms dynamic to build on 12.1 and above + ------------------------------------------------------------------- Mon Jun 20 09:36:22 UTC 2011 - wr@rosenauer.org diff --git a/MozillaThunderbird.spec b/MozillaThunderbird.spec index 30a475f..febc18f 100644 --- a/MozillaThunderbird.spec +++ b/MozillaThunderbird.spec @@ -20,16 +20,14 @@ Name: MozillaThunderbird -BuildRequires: autoconf213 fdupes gcc-c++ hunspell-devel libcurl-devel libgnomeui-devel libidl-devel libnotify-devel python startup-notification-devel unzip update-desktop-files zip +BuildRequires: autoconf213 fdupes gcc-c++ hunspell-devel libcurl-devel libgnomeui-devel libidl-devel libnotify-devel python startup-notification-devel unzip update-desktop-files Mesa-devel yasm zip BuildRequires: mozilla-nss-devel >= 3.12.8 -%if %suse_version > 1100 BuildRequires: nss-shared-helper-devel -%endif License: MPLv1.1 or GPLv2+ or LGPLv2+ -%define mainversion 3.1.11 +%define mainversion 5.0 Version: %{mainversion} Release: 1 -%define releasedate 2011061600 +%define releasedate 2011062400 Provides: thunderbird = %{version} Summary: The Stand-Alone Mozilla Mail Component Url: http://www.mozilla.org/products/thunderbird/ @@ -43,27 +41,30 @@ Source4: l10n-%{version}.tar.bz2 Source6: suse-default-prefs.js Source7: find-external-requires.sh Source8: MozillaThunderbird-rpmlintrc -Source9: enigmail-1.1.2.tar.bz2 +Source9: enigmail-1.1.99.tar.bz2 Source10: create-tar.sh -Patch1: mozilla-dump_syms-static.patch -Patch2: thunderbird-appname.patch -Patch4: tb-ssldap.patch -Patch5: tb-develdirs.patch -Patch9: mozilla-shared-nss-db.patch -Patch10: mozilla-gdk-pixbuf.patch -Patch11: thunderbird-shared-nss-db.patch -Patch13: mozilla-xsmp.patch -Patch14: mozilla-gcc46.patch +Source11: compare-locales.tar.bz2 +# Gecko/Toolkit +Patch1: mozilla-shared-nss-db.patch +Patch2: mozilla-cairo-lcd.patch +Patch3: mozilla-language.patch +Patch4: mozilla-gio.patch +Patch5: mozilla-cairo-return.patch +Patch6: mozilla-dump_syms-static.patch +# Thunderbird/mail +Patch10: tb-ssldap.patch +Patch11: tb-develdirs.patch +Patch12: thunderbird-shared-nss-db.patch +Patch13: thunderbird-gio.patch +#enigmail +Patch20: enigmail-cz-CZ-fix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: coreutils fileutils textutils /bin/sh ### build options %define build_enigmail 1 %define crashreporter 1 %define has_system_cairo 0 -%if %suse_version > 1110 -%define has_system_cairo 1 -%endif -%define localize 1 +%define localize 1 ### build options end %define _use_internal_dependency_generator 0 %define __find_requires sh %{SOURCE7} @@ -86,7 +87,7 @@ written using the XUL user interface language and designed to be cross-platform. It is a stand-alone application instead of part of the Mozilla application suite. - +%if %localize %package translations-common License: MPLv1.1 or GPLv2+ or LGPLv2+ Summary: Common translations for MozillaThunderbird @@ -111,7 +112,7 @@ Obsoletes: %{name}-translations < %{version}-%{release} %description translations-other This package contains several optional languages for the user interface of MozillaThunderbird. - +%endif %package devel License: MPLv1.1 or GPLv2+ or LGPLv2+ @@ -126,7 +127,6 @@ Software Development Kit to build plugins/extensions against Thunderbird. %if %crashreporter - %package buildsymbols License: MPLv1.1 or GPLv2+ or LGPLv2+ Summary: Breakpad buildsymbols for %{name} @@ -138,9 +138,8 @@ symbols meant for upload to Mozilla's crash collector database. %endif %if %build_enigmail - %package -n enigmail -Version: 1.1.2 +Version: 1.1.99 Release: 7 License: MPLv1.1 or GPLv2+ Summary: OpenPGP addon for Thunderbird and SeaMonkey @@ -159,25 +158,35 @@ This package contains the Enigmail OpenPGP Addon for Thunderbird and SeaMonkey. %prep %if %build_enigmail -%setup -n thunderbird -q -b 4 -b 9 +%setup -n thunderbird -q -b 4 -b 11 -b 9 %else -%setup -n thunderbird -q -b 4 +%setup -n thunderbird -q -b 4 -b 11 %endif # xulrunner patches pushd mozilla %patch1 -p1 -%patch9 -p1 -%patch10 -p1 -%patch13 -p1 -%patch14 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 popd # comm-central patches -%patch2 -p1 -%patch4 -p1 -%patch5 +%patch10 -p1 %patch11 -p1 +%patch12 -p1 +%patch13 -p1 +pushd ../enigmail +%patch20 -p1 +popd %build +# no need to add build time to binaries +modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" +DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" +TIME="\"$(date -d "${modified}" "+%%R")\"" +find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} + +# export SUSE_ASNEEDED=0 export MOZ_BUILD_DATE=%{releasedate} export MOZILLA_OFFICIAL=1 @@ -194,6 +203,7 @@ mk_add_options MOZILLA_OFFICIAL=1 mk_add_options BUILD_OFFICIAL=1 mk_add_options MOZ_MILESTONE_RELEASE=1 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs} +mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj ac_add_options --enable-application=mail ac_add_options --prefix=%{_prefix} ac_add_options --libdir=%{progdir} @@ -201,25 +211,26 @@ ac_add_options --includedir=%{_includedir} ac_add_options --disable-tests ac_add_options --disable-debug ac_add_options --enable-optimize -ac_add_options --enable-static -ac_add_options --disable-shared ac_add_options --with-system-nspr ac_add_options --with-system-nss ac_add_options --with-system-jpeg ac_add_options --with-system-zlib -ac_add_options --with-l10n-base=../l10n +ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n ac_add_options --disable-updater #ac_add_options --with-system-png # no apng support -%if %suse_version > 1030 ac_add_options --enable-system-hunspell -%endif -ac_add_options --enable-ldap-experimental ac_add_options --disable-installer ac_add_options --disable-mochitest ac_add_options --enable-startup-notification ac_add_options --enable-official-branding ac_add_options --disable-necko-wifi EOF +%if %suse_version > 1130 +cat << EOF >> $MOZCONFIG +ac_add_options --disable-gnomevfs +ac_add_options --enable-gio +EOF +%endif %if %has_system_cairo cat << EOF >> $MOZCONFIG ac_add_options --enable-system-cairo @@ -235,40 +246,55 @@ make -f client.mk build ### enigmail build %if %build_enigmail cp -r $RPM_BUILD_DIR/enigmail $RPM_BUILD_DIR/thunderbird/mailnews/extensions/ -(cd $RPM_BUILD_DIR/thunderbird/mailnews/extensions/enigmail; ./makemake -r; make; make xpi) + +pushd $RPM_BUILD_DIR/thunderbird/mailnews/extensions/enigmail + ./makemake -r -o '../../../../obj' +popd +pushd $RPM_BUILD_DIR/obj/mailnews/extensions/enigmail +make MOZ_CHROME_FILE_FORMAT=jar +make xpi +popd %endif %install +cd ../obj make -C mail/installer STRIP=/bin/true # copy tree into RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{progdir} -cp -rf $RPM_BUILD_DIR/thunderbird/mozilla/dist/thunderbird/* \ +cp -rf $RPM_BUILD_DIR/obj/mozilla/dist/thunderbird/* \ $RPM_BUILD_ROOT%{progdir} # build additional locales %if %localize %if 0%{?SOURCE5:1} -cp %SOURCE5 mail/locales/shipped-locales +cp %SOURCE5 ../thunderbird/mail/locales/shipped-locales %endif rm -f %{_tmppath}/translations.* -for locale in $(awk '{ print $1; }' mail/locales/shipped-locales); do +touch %{_tmppath}/translations.{common,other} +for locale in $(awk '{ print $1; }' ../thunderbird/mail/locales/all-locales); do case $locale in - ja-JP-mac|en-US) + ja-JP-mac|en-US|ta-LK) # locales not to be included in translations package ;; *) - make -C mail/locales libs-$locale || continue - cp mozilla/dist/xpi-stage/locale-$locale/chrome/$locale.jar \ - $RPM_BUILD_ROOT%{progdir}/chrome - cp mozilla/dist/xpi-stage/locale-$locale/chrome/$locale.manifest \ - $RPM_BUILD_ROOT%{progdir}/chrome + pushd $RPM_BUILD_DIR/compare-locales + PYTHONPATH=lib \ + scripts/compare-locales -m ../l10n-merged/$locale \ + ../thunderbird/mail/locales/l10n.ini ../l10n $locale + popd + LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \ + make -C mail/locales langpack-$locale || continue + cp -r mozilla/dist/xpi-stage/locale-$locale \ + $RPM_BUILD_ROOT%{progdir}/extensions/langpack-$locale@thunderbird.mozilla.org + # remove prefs and profile defaults from langpack + rm -rf $RPM_BUILD_ROOT%{progdir}/extensions/langpack-$locale@thunderbird.mozilla.org/defaults # check against the fixed common list and sort into the right filelist _matched=0 for _match in ar ca cs da de en-GB es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do [ "$_match" = "$locale" ] && _matched=1 done [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other - echo %{progdir}/chrome/$locale.jar >> %{_tmppath}/translations.$_l10ntarget - echo %{progdir}/chrome/$locale.manifest >> %{_tmppath}/translations.$_l10ntarget + echo %{progdir}/extensions/langpack-$locale@thunderbird.mozilla.org \ + >> %{_tmppath}/translations.$_l10ntarget esac done %endif @@ -356,6 +382,7 @@ done # excluded files rm -f $RPM_BUILD_ROOT%{progdir}/thunderbird rm -f $RPM_BUILD_ROOT%{progdir}/removed-files +rm -f $RPM_BUILD_ROOT%{progdir}/precomplete rm -f $RPM_BUILD_ROOT%{progdir}/updater rm -f $RPM_BUILD_ROOT%{progdir}/updater.ini rm -f $RPM_BUILD_ROOT%{progdir}/update.locale @@ -418,18 +445,13 @@ exit 0 %dir %{progdir} %{progdir}/application.ini %{progdir}/blocklist.xml -%{progdir}/res/ +%{progdir}/chrome.manifest %{progdir}/README.txt -%{progdir}/libldap60.so -%{progdir}/libprldap60.so -%{progdir}/libssldap60.so -%{progdir}/libldif60.so -%{progdir}/libsqlite3.so -%{progdir}/libmozjs.so -%{progdir}/libxpcom_core.so -%{progdir}/libxpcom.so +%{progdir}/*.so %{progdir}/mozilla-xremote-client +%{progdir}/omni.jar %{progdir}/platform.ini +%{progdir}/plugin-container %{progdir}/run-mozilla.sh %{progdir}/thunderbird-bin # crashreporter files @@ -439,28 +461,18 @@ exit 0 %{progdir}/Throbber-small.gif %endif %{progdir}/components/ -%{progdir}/modules/ %dir %{progdir}/chrome/ -%{progdir}/chrome/classic.* -%{progdir}/chrome/comm.* -%{progdir}/chrome/en-US.* -%{progdir}/chrome/gloda.* -%{progdir}/chrome/messenger.* -%{progdir}/chrome/newsblog.* -%{progdir}/chrome/pippki.* -%{progdir}/chrome/toolkit.* %{progdir}/chrome/icons/ %dir %{progdir}/dictionaries/ %{progdir}/defaults/ -%{progdir}/greprefs/ -%{progdir}/extensions/ +%dir %{progdir}/extensions/ +%{progdir}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} %{progdir}/isp/ %{_datadir}/applications/%{desktop_file_name}.desktop %{_datadir}/icons/hicolor/*/apps/%{progname}.png %{_bindir}/%{progname} %if %localize - %files translations-common -f %{_tmppath}/translations.common %defattr(-,root,root) @@ -471,7 +483,6 @@ exit 0 %files devel %defattr(-,root,root) %{_libdir}/%{progname}/*.a -%{_libdir}/%{progname}/regxpcom %{_libdir}/%{progname}/xpidl %{_libdir}/%{progname}/xpt_dump %{_libdir}/%{progname}/xpt_link @@ -479,7 +490,6 @@ exit 0 %{_includedir}/%{progname}/ %if %build_enigmail - %files -n enigmail %defattr(-,root,root) %dir %{_libdir}/mozilla @@ -487,7 +497,6 @@ exit 0 %endif %if %crashreporter - %files buildsymbols %defattr(-,root,root) %{_datadir}/mozilla/ diff --git a/compare-locales.tar.bz2 b/compare-locales.tar.bz2 new file mode 100644 index 0000000..c4ef109 --- /dev/null +++ b/compare-locales.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd5366bf0c4db4c38f29f7230cac1fa6c8f539dd9fb830531a901bd065f3bf42 +size 25651 diff --git a/create-tar.sh b/create-tar.sh index cc16fd5..1913338 100644 --- a/create-tar.sh +++ b/create-tar.sh @@ -1,9 +1,9 @@ #!/bin/bash -BRANCH="releases/comm-1.9.2" # comm-central -RELEASE_TAG="THUNDERBIRD_3_1_11_RELEASE" -VERSION="3.1.11" +BRANCH="releases/comm-miramar" +RELEASE_TAG="THUNDERBIRD_5_0_RELEASE " +VERSION="5.0" echo "cloning $BRANCH..." hg clone http://hg.mozilla.org/$BRANCH thunderbird @@ -12,7 +12,7 @@ hg update -r $RELEASE_TAG echo "running client.py..." [ "$RELEASE_TAG" == "default" ] || _extra="--comm-rev=$RELEASE_TAG --mozilla-rev=$RELEASE_TAG" # temporary! -_extra="--mozilla-repo=http://hg.mozilla.org/releases/mozilla-1.9.2 $_extra" +#_extra="--mozilla-repo=http://hg.mozilla.org/releases/mozilla-miramar $_extra" python client.py checkout --skip-chatzilla --skip-venkman $_extra popd echo "creating archive..." @@ -24,7 +24,7 @@ echo "fetching locales..." if [ -e shipped-locales ]; then SHIPPED_LOCALES=shipped-locales else - SHIPPED_LOCALES=thunderbird/mail/locales/shipped-locales + SHIPPED_LOCALES=thunderbird/mail/locales/all-locales fi test ! -d l10n && mkdir l10n for locale in $(awk '{ print $1; }' $SHIPPED_LOCALES); do @@ -33,7 +33,7 @@ for locale in $(awk '{ print $1; }' $SHIPPED_LOCALES); do ;; *) echo "fetching $locale ..." - hg clone http://hg.mozilla.org/releases/l10n-mozilla-1.9.2/$locale l10n/$locale + hg clone http://hg.mozilla.org/releases/l10n-miramar/$locale l10n/$locale hg -R l10n/$locale up -C -r $RELEASE_TAG ;; esac @@ -43,3 +43,8 @@ tar cjf l10n-$VERSION.tar.bz2 \ --exclude=.hgtags --exclude=.hgignore --exclude=.hg --exclude=browser --exclude=calendar \ --exclude=suite \ l10n + +# compare-locales +hg clone http://hg.mozilla.org/build/compare-locales +tar cjf compare-locales.tar.bz2 --exclude=.hgtags --exclude=.hgignore --exclude=.hg compare-locales + diff --git a/enigmail-1.1.2.tar.bz2 b/enigmail-1.1.2.tar.bz2 deleted file mode 100644 index 045bb22..0000000 --- a/enigmail-1.1.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:463878db781e019e6687350f2618d0a31331848f2e9aa45f359a4b700d22a82e -size 891190 diff --git a/enigmail-1.1.99.tar.bz2 b/enigmail-1.1.99.tar.bz2 new file mode 100644 index 0000000..f7a33f6 --- /dev/null +++ b/enigmail-1.1.99.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acd2bd3823d466d5aff03fe870747f858e255441e010e0f7a54a38d2e895dc55 +size 951495 diff --git a/enigmail-cz-CZ-fix.patch b/enigmail-cz-CZ-fix.patch new file mode 100644 index 0000000..e4e7bab --- /dev/null +++ b/enigmail-cz-CZ-fix.patch @@ -0,0 +1,68 @@ +--- + lang/cs-CZ/enigmail.dtd | 44 ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 42 insertions(+), 2 deletions(-) + +--- a/lang/cs-CZ/enigmail.dtd ++++ b/lang/cs-CZ/enigmail.dtd +@@ -73,7 +73,7 @@ + + + +- ++ + + + +@@ -174,7 +174,7 @@ + + + +- ++ + + + +@@ -556,3 +556,43 @@ + Děkujeme za používání Enigmailu."> + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ diff --git a/l10n-3.1.11.tar.bz2 b/l10n-3.1.11.tar.bz2 deleted file mode 100644 index 01808a1..0000000 --- a/l10n-3.1.11.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c21aa265252f3f37cebb5b62c9262aa1ae097e25a90ef0c31111da1bfc7b77aa -size 20472893 diff --git a/l10n-5.0.tar.bz2 b/l10n-5.0.tar.bz2 new file mode 100644 index 0000000..4823290 --- /dev/null +++ b/l10n-5.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76980d781ca01d1ecfc396b2548f101569db7e4632a15d8aa9a9012b38b50470 +size 23978736 diff --git a/mozilla-cairo-lcd.patch b/mozilla-cairo-lcd.patch new file mode 100644 index 0000000..68d8981 --- /dev/null +++ b/mozilla-cairo-lcd.patch @@ -0,0 +1,1333 @@ +Description: Add a Cairo LCD filter to use FreeType LCD colour filtering features +Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=404637 +Bug-Cairo: http://bugs.freedesktop.org/show_bug.cgi?id=10301 + +diff --git a/config/system-headers b/config/system-headers +--- a/config/system-headers ++++ b/config/system-headers +@@ -267,16 +267,17 @@ Font.h + Fonts.h + fp.h + fpieee.h + frame/log.h + frame/req.h + freetype/freetype.h + freetype/ftcache.h + freetype/ftglyph.h ++freetype/ftlcdfil.h + freetype/ftsynth.h + freetype/ftoutln.h + freetype/ttnameid.h + freetype/tttables.h + freetype/t1tables.h + fribidi/fribidi.h + FSp_fopen.h + fstream +diff --git a/gfx/cairo/cairo/src/cairo-font-options.c b/gfx/cairo/cairo/src/cairo-font-options.c +--- a/gfx/cairo/cairo/src/cairo-font-options.c ++++ b/gfx/cairo/cairo/src/cairo-font-options.c +@@ -34,41 +34,44 @@ + * Owen Taylor + */ + + #include "cairoint.h" + + static const cairo_font_options_t _cairo_font_options_nil = { + CAIRO_ANTIALIAS_DEFAULT, + CAIRO_SUBPIXEL_ORDER_DEFAULT, ++ CAIRO_LCD_FILTER_DEFAULT, + CAIRO_HINT_STYLE_DEFAULT, + CAIRO_HINT_METRICS_DEFAULT + }; + + /** + * _cairo_font_options_init_default: + * @options: a #cairo_font_options_t + * + * Initializes all fields of the font options object to default values. + **/ + void + _cairo_font_options_init_default (cairo_font_options_t *options) + { + options->antialias = CAIRO_ANTIALIAS_DEFAULT; + options->subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT; ++ options->lcd_filter = CAIRO_LCD_FILTER_DEFAULT; + options->hint_style = CAIRO_HINT_STYLE_DEFAULT; + options->hint_metrics = CAIRO_HINT_METRICS_DEFAULT; + } + + void + _cairo_font_options_init_copy (cairo_font_options_t *options, + const cairo_font_options_t *other) + { + options->antialias = other->antialias; + options->subpixel_order = other->subpixel_order; ++ options->lcd_filter = other->lcd_filter; + options->hint_style = other->hint_style; + options->hint_metrics = other->hint_metrics; + } + + /** + * cairo_font_options_create: + * + * Allocates a new font options object with all options initialized +@@ -184,16 +187,18 @@ cairo_font_options_merge (cairo_font_opt + + if (cairo_font_options_status ((cairo_font_options_t *) other)) + return; + + if (other->antialias != CAIRO_ANTIALIAS_DEFAULT) + options->antialias = other->antialias; + if (other->subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT) + options->subpixel_order = other->subpixel_order; ++ if (other->lcd_filter != CAIRO_LCD_FILTER_DEFAULT) ++ options->lcd_filter = other->lcd_filter; + if (other->hint_style != CAIRO_HINT_STYLE_DEFAULT) + options->hint_style = other->hint_style; + if (other->hint_metrics != CAIRO_HINT_METRICS_DEFAULT) + options->hint_metrics = other->hint_metrics; + } + slim_hidden_def (cairo_font_options_merge); + + /** +@@ -216,16 +221,17 @@ cairo_font_options_equal (const cairo_fo + if (cairo_font_options_status ((cairo_font_options_t *) other)) + return FALSE; + + if (options == other) + return TRUE; + + return (options->antialias == other->antialias && + options->subpixel_order == other->subpixel_order && ++ options->lcd_filter == other->lcd_filter && + options->hint_style == other->hint_style && + options->hint_metrics == other->hint_metrics); + } + slim_hidden_def (cairo_font_options_equal); + + /** + * cairo_font_options_hash: + * @options: a #cairo_font_options_t +@@ -241,17 +247,18 @@ slim_hidden_def (cairo_font_options_equa + unsigned long + cairo_font_options_hash (const cairo_font_options_t *options) + { + if (cairo_font_options_status ((cairo_font_options_t *) options)) + options = &_cairo_font_options_nil; /* force default values */ + + return ((options->antialias) | + (options->subpixel_order << 4) | +- (options->hint_style << 8) | ++ (options->lcd_filter << 8) | ++ (options->hint_style << 12) | + (options->hint_metrics << 16)); + } + slim_hidden_def (cairo_font_options_hash); + + /** + * cairo_font_options_set_antialias: + * @options: a #cairo_font_options_t + * @antialias: the new antialiasing mode +@@ -323,16 +330,58 @@ cairo_font_options_get_subpixel_order (c + { + if (cairo_font_options_status ((cairo_font_options_t *) options)) + return CAIRO_SUBPIXEL_ORDER_DEFAULT; + + return options->subpixel_order; + } + + /** ++ * _cairo_font_options_set_lcd_filter: ++ * @options: a #cairo_font_options_t ++ * @lcd_filter: the new LCD filter ++ * ++ * Sets the LCD filter for the font options object. The LCD filter ++ * specifies how pixels are filtered when rendered with an antialiasing ++ * mode of %CAIRO_ANTIALIAS_SUBPIXEL. See the documentation for ++ * #cairo_lcd_filter_t for full details. ++ * ++ * Since: 1.8 ++ **/ ++void ++_cairo_font_options_set_lcd_filter (cairo_font_options_t *options, ++ cairo_lcd_filter_t lcd_filter) ++{ ++ if (cairo_font_options_status (options)) ++ return; ++ ++ options->lcd_filter = lcd_filter; ++} ++ ++/** ++ * _cairo_font_options_get_lcd_filter: ++ * @options: a #cairo_font_options_t ++ * ++ * Gets the LCD filter for the font options object. ++ * See the documentation for #cairo_lcd_filter_t for full details. ++ * ++ * Return value: the LCD filter for the font options object ++ * ++ * Since: 1.8 ++ **/ ++cairo_lcd_filter_t ++_cairo_font_options_get_lcd_filter (const cairo_font_options_t *options) ++{ ++ if (cairo_font_options_status ((cairo_font_options_t *) options)) ++ return CAIRO_LCD_FILTER_DEFAULT; ++ ++ return options->lcd_filter; ++} ++ ++/** + * cairo_font_options_set_hint_style: + * @options: a #cairo_font_options_t + * @hint_style: the new hint style + * + * Sets the hint style for font outlines for the font options object. + * This controls whether to fit font outlines to the pixel grid, + * and if so, whether to optimize for fidelity or contrast. + * See the documentation for #cairo_hint_style_t for full details. +diff --git a/gfx/cairo/cairo/src/cairo-ft-font.c b/gfx/cairo/cairo/src/cairo-ft-font.c +--- a/gfx/cairo/cairo/src/cairo-ft-font.c ++++ b/gfx/cairo/cairo/src/cairo-ft-font.c +@@ -54,16 +54,38 @@ + #include FT_FREETYPE_H + #include FT_OUTLINE_H + #include FT_IMAGE_H + #include FT_TRUETYPE_TABLES_H + #if HAVE_FT_GLYPHSLOT_EMBOLDEN + #include FT_SYNTHESIS_H + #endif + ++#include FT_LCD_FILTER_H ++ ++/* Fontconfig version older than 2.6 didn't have these options */ ++#ifndef FC_LCD_FILTER ++#define FC_LCD_FILTER "lcdfilter" ++#endif ++/* Some Ubuntu versions defined FC_LCD_FILTER without defining the following */ ++#ifndef FC_LCD_NONE ++#define FC_LCD_NONE 0 ++#define FC_LCD_DEFAULT 1 ++#define FC_LCD_LIGHT 2 ++#define FC_LCD_LEGACY 3 ++#endif ++ ++/* FreeType version older than 2.3.5(?) didn't have these options */ ++#ifndef FT_LCD_FILTER_NONE ++#define FT_LCD_FILTER_NONE 0 ++#define FT_LCD_FILTER_DEFAULT 1 ++#define FT_LCD_FILTER_LIGHT 2 ++#define FT_LCD_FILTER_LEGACY 16 ++#endif ++ + #define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 64.0)) + #define DOUBLE_FROM_26_6(t) ((double)(t) / 64.0) + #define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0)) + #define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0) + + /* This is the max number of FT_face objects we keep open at once + */ + #define MAX_OPEN_FACES 10 +@@ -774,45 +796,309 @@ _cairo_ft_unscaled_font_set_scale (cairo + unscaled->face->available_sizes[best_i].height); + if (error) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + } + + return CAIRO_STATUS_SUCCESS; + } + +-/* Empirically-derived subpixel filtering values thanks to Keith +- * Packard and libXft. */ +-static const int filters[3][3] = { +- /* red */ +-#if 0 +- { 65538*4/7,65538*2/7,65538*1/7 }, +- /* green */ +- { 65536*1/4, 65536*2/4, 65537*1/4 }, +- /* blue */ +- { 65538*1/7,65538*2/7,65538*4/7 }, ++/* we sometimes need to convert the glyph bitmap in a FT_GlyphSlot ++ * into a different format. For example, we want to convert a ++ * FT_PIXEL_MODE_LCD or FT_PIXEL_MODE_LCD_V bitmap into a 32-bit ++ * ARGB or ABGR bitmap. ++ * ++ * this function prepares a target descriptor for this operation. ++ * ++ * input :: target bitmap descriptor. The function will set its ++ * 'width', 'rows' and 'pitch' fields, and only these ++ * ++ * slot :: the glyph slot containing the source bitmap. this ++ * function assumes that slot->format == FT_GLYPH_FORMAT_BITMAP ++ * ++ * mode :: the requested final rendering mode. supported values are ++ * MONO, NORMAL (i.e. gray), LCD and LCD_V ++ * ++ * the function returns the size in bytes of the corresponding buffer, ++ * it's up to the caller to allocate the corresponding memory block ++ * before calling _fill_xrender_bitmap ++ * ++ * it also returns -1 in case of error (e.g. incompatible arguments, ++ * like trying to convert a gray bitmap into a monochrome one) ++ */ ++static int ++_compute_xrender_bitmap_size(FT_Bitmap *target, ++ FT_GlyphSlot slot, ++ FT_Render_Mode mode) ++{ ++ FT_Bitmap *ftbit; ++ int width, height, pitch; ++ ++ if (slot->format != FT_GLYPH_FORMAT_BITMAP) ++ return -1; ++ ++ /* compute the size of the final bitmap */ ++ ftbit = &slot->bitmap; ++ ++ width = ftbit->width; ++ height = ftbit->rows; ++ pitch = (width + 3) & ~3; ++ ++ switch (ftbit->pixel_mode) { ++ case FT_PIXEL_MODE_MONO: ++ if (mode == FT_RENDER_MODE_MONO) { ++ pitch = (((width + 31) & ~31) >> 3); ++ break; ++ } ++ /* fall-through */ ++ ++ case FT_PIXEL_MODE_GRAY: ++ if (mode == FT_RENDER_MODE_LCD || ++ mode == FT_RENDER_MODE_LCD_V) ++ { ++ /* each pixel is replicated into a 32-bit ARGB value */ ++ pitch = width * 4; ++ } ++ break; ++ ++ case FT_PIXEL_MODE_LCD: ++ if (mode != FT_RENDER_MODE_LCD) ++ return -1; ++ ++ /* horz pixel triplets are packed into 32-bit ARGB values */ ++ width /= 3; ++ pitch = width * 4; ++ break; ++ ++ case FT_PIXEL_MODE_LCD_V: ++ if (mode != FT_RENDER_MODE_LCD_V) ++ return -1; ++ ++ /* vert pixel triplets are packed into 32-bit ARGB values */ ++ height /= 3; ++ pitch = width * 4; ++ break; ++ ++ default: /* unsupported source format */ ++ return -1; ++ } ++ ++ target->width = width; ++ target->rows = height; ++ target->pitch = pitch; ++ target->buffer = NULL; ++ ++ return pitch * height; ++} ++ ++/* this functions converts the glyph bitmap found in a FT_GlyphSlot ++ * into a different format (see _compute_xrender_bitmap_size) ++ * ++ * you should call this function after _compute_xrender_bitmap_size ++ * ++ * target :: target bitmap descriptor. Note that its 'buffer' pointer ++ * must point to memory allocated by the caller ++ * ++ * slot :: the glyph slot containing the source bitmap ++ * ++ * mode :: the requested final rendering mode ++ * ++ * bgr :: boolean, set if BGR or VBGR pixel ordering is needed ++ */ ++static void ++_fill_xrender_bitmap(FT_Bitmap *target, ++ FT_GlyphSlot slot, ++ FT_Render_Mode mode, ++ int bgr) ++{ ++ FT_Bitmap *ftbit = &slot->bitmap; ++ unsigned char *srcLine = ftbit->buffer; ++ unsigned char *dstLine = target->buffer; ++ int src_pitch = ftbit->pitch; ++ int width = target->width; ++ int height = target->rows; ++ int pitch = target->pitch; ++ int subpixel; ++ int h; ++ ++ subpixel = (mode == FT_RENDER_MODE_LCD || ++ mode == FT_RENDER_MODE_LCD_V); ++ ++ if (src_pitch < 0) ++ srcLine -= src_pitch * (ftbit->rows - 1); ++ ++ target->pixel_mode = ftbit->pixel_mode; ++ ++ switch (ftbit->pixel_mode) { ++ case FT_PIXEL_MODE_MONO: ++ if (subpixel) { ++ /* convert mono to ARGB32 values */ ++ ++ for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch) { ++ int x; ++ ++ for (x = 0; x < width; x++) { ++ if (srcLine[(x >> 3)] & (0x80 >> (x & 7))) ++ ((unsigned int *) dstLine)[x] = 0xffffffffU; ++ } ++ } ++ target->pixel_mode = FT_PIXEL_MODE_LCD; ++ ++ } else if (mode == FT_RENDER_MODE_NORMAL) { ++ /* convert mono to 8-bit gray */ ++ ++ for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch) { ++ int x; ++ ++ for (x = 0; x < width; x++) { ++ if (srcLine[(x >> 3)] & (0x80 >> (x & 7))) ++ dstLine[x] = 0xff; ++ } ++ } ++ target->pixel_mode = FT_PIXEL_MODE_GRAY; ++ ++ } else { ++ /* copy mono to mono */ ++ ++ int bytes = (width + 7) >> 3; ++ ++ for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch) ++ memcpy (dstLine, srcLine, bytes); ++ } ++ break; ++ ++ case FT_PIXEL_MODE_GRAY: ++ if (subpixel) { ++ /* convert gray to ARGB32 values */ ++ ++ for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch) { ++ int x; ++ unsigned int *dst = (unsigned int *) dstLine; ++ ++ for (x = 0; x < width; x++) { ++ unsigned int pix = srcLine[x]; ++ ++ pix |= (pix << 8); ++ pix |= (pix << 16); ++ ++ dst[x] = pix; ++ } ++ } ++ target->pixel_mode = FT_PIXEL_MODE_LCD; ++ } else { ++ /* copy gray into gray */ ++ ++ for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch) ++ memcpy (dstLine, srcLine, width); ++ } ++ break; ++ ++ case FT_PIXEL_MODE_LCD: ++ if (!bgr) { ++ /* convert horizontal RGB into ARGB32 */ ++ ++ for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch) { ++ int x; ++ unsigned char *src = srcLine; ++ unsigned int *dst = (unsigned int *) dstLine; ++ ++ for (x = 0; x < width; x++, src += 3) { ++ unsigned int pix; ++ ++ pix = ((unsigned int)src[0] << 16) | ++ ((unsigned int)src[1] << 8) | ++ ((unsigned int)src[2] ) | ++ ((unsigned int)src[1] << 24) ; ++ ++ dst[x] = pix; ++ } ++ } ++ } else { ++ /* convert horizontal BGR into ARGB32 */ ++ ++ for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch) { ++ ++ int x; ++ unsigned char *src = srcLine; ++ unsigned int *dst = (unsigned int *) dstLine; ++ ++ for (x = 0; x < width; x++, src += 3) { ++ unsigned int pix; ++ ++ pix = ((unsigned int)src[2] << 16) | ++ ((unsigned int)src[1] << 8) | ++ ((unsigned int)src[0] ) | ++ ((unsigned int)src[1] << 24) ; ++ ++ dst[x] = pix; ++ } ++ } ++ } ++ break; ++ ++ default: /* FT_PIXEL_MODE_LCD_V */ ++ /* convert vertical RGB into ARGB32 */ ++ if (!bgr) { ++ ++ for (h = height; h > 0; h--, srcLine += 3 * src_pitch, dstLine += pitch) { ++ int x; ++ unsigned char* src = srcLine; ++ unsigned int* dst = (unsigned int *) dstLine; ++ ++ for (x = 0; x < width; x++, src += 1) { ++ unsigned int pix; ++#if 1 ++ pix = ((unsigned int)src[0] << 16) | ++ ((unsigned int)src[src_pitch] << 8) | ++ ((unsigned int)src[src_pitch*2] ) | ++ 0xFF000000 ; ++#else ++ pix = ((unsigned int)src[0] << 16) | ++ ((unsigned int)src[src_pitch] << 8) | ++ ((unsigned int)src[src_pitch*2] ) | ++ ((unsigned int)src[src_pitch] << 24) ; + #endif +- { 65538*9/13,65538*3/13,65538*1/13 }, +- /* green */ +- { 65538*1/6, 65538*4/6, 65538*1/6 }, +- /* blue */ +- { 65538*1/13,65538*3/13,65538*9/13 }, +-}; ++ dst[x] = pix; ++ } ++ } ++ } else { ++ ++ for (h = height; h > 0; h--, srcLine += 3*src_pitch, dstLine += pitch) { ++ int x; ++ unsigned char *src = srcLine; ++ unsigned int *dst = (unsigned int *) dstLine; ++ ++ for (x = 0; x < width; x++, src += 1) { ++ unsigned int pix; ++ ++ pix = ((unsigned int)src[src_pitch * 2] << 16) | ++ ((unsigned int)src[src_pitch] << 8) | ++ ((unsigned int)src[0] ) | ++ ((unsigned int)src[src_pitch] << 24) ; ++ ++ dst[x] = pix; ++ } ++ } ++ } ++ } ++} ++ + + /* Fills in val->image with an image surface created from @bitmap + */ + static cairo_status_t + _get_bitmap_surface (FT_Bitmap *bitmap, + cairo_bool_t own_buffer, + cairo_font_options_t *font_options, + cairo_image_surface_t **surface) + { + int width, height, stride; + unsigned char *data; + int format = CAIRO_FORMAT_A8; ++ cairo_image_surface_t *image; + + width = bitmap->width; + height = bitmap->rows; + + if (width == 0 || height == 0) { + *surface = (cairo_image_surface_t *) + cairo_image_surface_create_for_data (NULL, format, 0, 0, 0); + return (*surface)->base.status; +@@ -859,150 +1145,63 @@ _get_bitmap_surface (FT_Bitmap *bi + } + #endif + format = CAIRO_FORMAT_A1; + break; + + case FT_PIXEL_MODE_LCD: + case FT_PIXEL_MODE_LCD_V: + case FT_PIXEL_MODE_GRAY: +- switch (font_options->antialias) { +- case CAIRO_ANTIALIAS_DEFAULT: +- case CAIRO_ANTIALIAS_GRAY: +- case CAIRO_ANTIALIAS_NONE: +- default: ++ if (font_options->antialias != CAIRO_ANTIALIAS_SUBPIXEL) { + stride = bitmap->pitch; + if (own_buffer) { + data = bitmap->buffer; + } else { + data = _cairo_malloc_ab (height, stride); + if (!data) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + + memcpy (data, bitmap->buffer, stride * height); + } + format = CAIRO_FORMAT_A8; +- break; +- case CAIRO_ANTIALIAS_SUBPIXEL: { +- int x, y; +- unsigned char *in_line, *out_line, *in; +- unsigned int *out; +- unsigned int red, green, blue; +- int rf, gf, bf; +- int s; +- int o, os; +- unsigned char *data_rgba; +- unsigned int width_rgba, stride_rgba; +- int vmul = 1; +- int hmul = 1; +- +- switch (font_options->subpixel_order) { +- case CAIRO_SUBPIXEL_ORDER_DEFAULT: +- case CAIRO_SUBPIXEL_ORDER_RGB: +- case CAIRO_SUBPIXEL_ORDER_BGR: +- default: +- width /= 3; +- hmul = 3; +- break; +- case CAIRO_SUBPIXEL_ORDER_VRGB: +- case CAIRO_SUBPIXEL_ORDER_VBGR: +- vmul = 3; +- height /= 3; +- break; +- } +- /* +- * Filter the glyph to soften the color fringes +- */ +- width_rgba = width; ++ } else { ++ /* if we get there, the data from the source bitmap ++ * really comes from _fill_xrender_bitmap, and is ++ * made of 32-bit ARGB or ABGR values */ ++ assert (own_buffer != 0); ++ assert (bitmap->pixel_mode != FT_PIXEL_MODE_GRAY); ++ ++ data = bitmap->buffer; + stride = bitmap->pitch; +- stride_rgba = (width_rgba * 4 + 3) & ~3; +- data_rgba = calloc (stride_rgba, height); +- if (unlikely (data_rgba == NULL)) { +- if (own_buffer) +- free (bitmap->buffer); +- return _cairo_error (CAIRO_STATUS_NO_MEMORY); +- } +- +- os = 1; +- switch (font_options->subpixel_order) { +- case CAIRO_SUBPIXEL_ORDER_VRGB: +- os = stride; +- case CAIRO_SUBPIXEL_ORDER_DEFAULT: +- case CAIRO_SUBPIXEL_ORDER_RGB: +- default: +- rf = 0; +- gf = 1; +- bf = 2; +- break; +- case CAIRO_SUBPIXEL_ORDER_VBGR: +- os = stride; +- case CAIRO_SUBPIXEL_ORDER_BGR: +- bf = 0; +- gf = 1; +- rf = 2; +- break; +- } +- in_line = bitmap->buffer; +- out_line = data_rgba; +- for (y = 0; y < height; y++) +- { +- in = in_line; +- out = (unsigned int *) out_line; +- in_line += stride * vmul; +- out_line += stride_rgba; +- for (x = 0; x < width * hmul; x += hmul) +- { +- red = green = blue = 0; +- o = 0; +- for (s = 0; s < 3; s++) +- { +- red += filters[rf][s]*in[x+o]; +- green += filters[gf][s]*in[x+o]; +- blue += filters[bf][s]*in[x+o]; +- o += os; +- } +- red = red / 65536; +- green = green / 65536; +- blue = blue / 65536; +- *out++ = (green << 24) | (red << 16) | (green << 8) | blue; +- } +- } +- +- /* Images here are stored in native format. The +- * backend must convert to its own format as needed +- */ +- +- if (own_buffer) +- free (bitmap->buffer); +- data = data_rgba; +- stride = stride_rgba; + format = CAIRO_FORMAT_ARGB32; +- break; +- } + } + break; + case FT_PIXEL_MODE_GRAY2: + case FT_PIXEL_MODE_GRAY4: + /* These could be triggered by very rare types of TrueType fonts */ + default: + if (own_buffer) + free (bitmap->buffer); + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + } + +- *surface = (cairo_image_surface_t *) ++ /* XXX */ ++ *surface = image = (cairo_image_surface_t *) + cairo_image_surface_create_for_data (data, + format, + width, height, stride); +- if ((*surface)->base.status) { ++ if (image->base.status) { + free (data); + return (*surface)->base.status; + } + +- _cairo_image_surface_assume_ownership_of_data ((*surface)); ++ if (font_options->antialias == CAIRO_ANTIALIAS_SUBPIXEL) ++ pixman_image_set_component_alpha (image->pixman_image, TRUE); ++ ++ _cairo_image_surface_assume_ownership_of_data ((image)); + + _cairo_debug_check_image_surface_is_defined (&(*surface)->base); + + return CAIRO_STATUS_SUCCESS; + } + + /* Converts an outline FT_GlyphSlot into an image + * +@@ -1019,129 +1218,169 @@ _get_bitmap_surface (FT_Bitmap *bi + * when we add subpixel support. If so, we may want to eliminate + * this version of the code path entirely. + */ + static cairo_status_t + _render_glyph_outline (FT_Face face, + cairo_font_options_t *font_options, + cairo_image_surface_t **surface) + { ++ int rgba = FC_RGBA_UNKNOWN; ++ int lcd_filter = FT_LCD_FILTER_LEGACY; + FT_GlyphSlot glyphslot = face->glyph; + FT_Outline *outline = &glyphslot->outline; + FT_Bitmap bitmap; + FT_BBox cbox; +- FT_Matrix matrix; +- int hmul = 1; +- int vmul = 1; +- unsigned int width, height, stride; +- cairo_bool_t subpixel = FALSE; ++ unsigned int width, height; + cairo_status_t status; ++ FT_Error fterror; ++ FT_Library library = glyphslot->library; ++ FT_Render_Mode render_mode = FT_RENDER_MODE_NORMAL; ++ ++ switch (font_options->antialias) { ++ case CAIRO_ANTIALIAS_NONE: ++ render_mode = FT_RENDER_MODE_MONO; ++ break; ++ ++ case CAIRO_ANTIALIAS_SUBPIXEL: ++ switch (font_options->subpixel_order) { ++ case CAIRO_SUBPIXEL_ORDER_DEFAULT: ++ case CAIRO_SUBPIXEL_ORDER_RGB: ++ case CAIRO_SUBPIXEL_ORDER_BGR: ++ render_mode = FT_RENDER_MODE_LCD; ++ break; ++ ++ case CAIRO_SUBPIXEL_ORDER_VRGB: ++ case CAIRO_SUBPIXEL_ORDER_VBGR: ++ render_mode = FT_RENDER_MODE_LCD_V; ++ break; ++ } ++ ++ switch (font_options->lcd_filter) { ++ case CAIRO_LCD_FILTER_NONE: ++ lcd_filter = FT_LCD_FILTER_NONE; ++ break; ++ case CAIRO_LCD_FILTER_DEFAULT: ++ case CAIRO_LCD_FILTER_INTRA_PIXEL: ++ lcd_filter = FT_LCD_FILTER_LEGACY; ++ break; ++ case CAIRO_LCD_FILTER_FIR3: ++ lcd_filter = FT_LCD_FILTER_LIGHT; ++ break; ++ case CAIRO_LCD_FILTER_FIR5: ++ lcd_filter = FT_LCD_FILTER_DEFAULT; ++ break; ++ } ++ ++ break; ++ ++ case CAIRO_ANTIALIAS_DEFAULT: ++ case CAIRO_ANTIALIAS_GRAY: ++ render_mode = FT_RENDER_MODE_NORMAL; ++ } + + FT_Outline_Get_CBox (outline, &cbox); + + cbox.xMin &= -64; + cbox.yMin &= -64; + cbox.xMax = (cbox.xMax + 63) & -64; + cbox.yMax = (cbox.yMax + 63) & -64; + + width = (unsigned int) ((cbox.xMax - cbox.xMin) >> 6); + height = (unsigned int) ((cbox.yMax - cbox.yMin) >> 6); +- stride = (width * hmul + 3) & ~3; + + if (width * height == 0) { + cairo_format_t format; + /* Looks like fb handles zero-sized images just fine */ +- switch (font_options->antialias) { +- case CAIRO_ANTIALIAS_NONE: ++ switch (render_mode) { ++ case FT_RENDER_MODE_MONO: + format = CAIRO_FORMAT_A1; + break; +- case CAIRO_ANTIALIAS_SUBPIXEL: ++ case FT_RENDER_MODE_LCD: ++ case FT_RENDER_MODE_LCD_V: + format= CAIRO_FORMAT_ARGB32; + break; +- case CAIRO_ANTIALIAS_DEFAULT: +- case CAIRO_ANTIALIAS_GRAY: ++ case FT_RENDER_MODE_LIGHT: ++ case FT_RENDER_MODE_NORMAL: ++ case FT_RENDER_MODE_MAX: + default: + format = CAIRO_FORMAT_A8; + break; + } + + (*surface) = (cairo_image_surface_t *) + cairo_image_surface_create_for_data (NULL, format, 0, 0, 0); + if ((*surface)->base.status) + return (*surface)->base.status; + } else { + +- matrix.xx = matrix.yy = 0x10000L; +- matrix.xy = matrix.yx = 0; +- +- switch (font_options->antialias) { +- case CAIRO_ANTIALIAS_NONE: +- bitmap.pixel_mode = FT_PIXEL_MODE_MONO; +- bitmap.num_grays = 1; +- stride = ((width + 31) & -32) >> 3; ++ int bitmap_size; ++ ++ switch (render_mode) { ++ case FT_RENDER_MODE_LCD: ++ if (font_options->subpixel_order == CAIRO_SUBPIXEL_ORDER_BGR) { ++ rgba = FC_RGBA_BGR; ++ } else { ++ rgba = FC_RGBA_RGB; ++ } + break; +- case CAIRO_ANTIALIAS_DEFAULT: +- case CAIRO_ANTIALIAS_GRAY: +- bitmap.pixel_mode = FT_PIXEL_MODE_GRAY; +- bitmap.num_grays = 256; +- stride = (width + 3) & -4; ++ case FT_RENDER_MODE_LCD_V: ++ if (font_options->subpixel_order == CAIRO_SUBPIXEL_ORDER_VBGR) { ++ rgba = FC_RGBA_VBGR; ++ } else { ++ rgba = FC_RGBA_VRGB; ++ } + break; +- case CAIRO_ANTIALIAS_SUBPIXEL: +- switch (font_options->subpixel_order) { +- case CAIRO_SUBPIXEL_ORDER_RGB: +- case CAIRO_SUBPIXEL_ORDER_BGR: +- case CAIRO_SUBPIXEL_ORDER_DEFAULT: +- default: +- matrix.xx *= 3; +- hmul = 3; +- subpixel = TRUE; +- break; +- case CAIRO_SUBPIXEL_ORDER_VRGB: +- case CAIRO_SUBPIXEL_ORDER_VBGR: +- matrix.yy *= 3; +- vmul = 3; +- subpixel = TRUE; +- break; +- } +- FT_Outline_Transform (outline, &matrix); +- +- bitmap.pixel_mode = FT_PIXEL_MODE_GRAY; +- bitmap.num_grays = 256; +- stride = (width * hmul + 3) & -4; ++ case FT_RENDER_MODE_MONO: ++ case FT_RENDER_MODE_LIGHT: ++ case FT_RENDER_MODE_NORMAL: ++ case FT_RENDER_MODE_MAX: ++ default: ++ break; + } + +- bitmap.pitch = stride; +- bitmap.width = width * hmul; +- bitmap.rows = height * vmul; +- bitmap.buffer = calloc (stride, bitmap.rows); ++ FT_Library_SetLcdFilter (library, lcd_filter); ++ ++ fterror = FT_Render_Glyph (face->glyph, render_mode); ++ ++ FT_Library_SetLcdFilter (library, FT_LCD_FILTER_NONE); ++ ++ if (fterror != 0) ++ return _cairo_error (CAIRO_STATUS_NO_MEMORY); ++ ++ bitmap_size = _compute_xrender_bitmap_size (&bitmap, ++ face->glyph, ++ render_mode); ++ if (bitmap_size < 0) ++ return _cairo_error (CAIRO_STATUS_NO_MEMORY); ++ ++ bitmap.buffer = calloc (1, bitmap_size); + if (unlikely (bitmap.buffer == NULL)) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + +- FT_Outline_Translate (outline, -cbox.xMin*hmul, -cbox.yMin*vmul); +- +- if (FT_Outline_Get_Bitmap (glyphslot->library, outline, &bitmap) != 0) { +- free (bitmap.buffer); +- return _cairo_error (CAIRO_STATUS_NO_MEMORY); +- } +- ++ _fill_xrender_bitmap (&bitmap, face->glyph, render_mode, ++ (rgba == FC_RGBA_BGR || rgba == FC_RGBA_VBGR)); ++ ++ /* Note: ++ * _get_bitmap_surface will free bitmap.buffer if there is an error ++ */ + status = _get_bitmap_surface (&bitmap, TRUE, font_options, surface); + if (unlikely (status)) + return status; ++ ++ /* Note: the font's coordinate system is upside down from ours, so the ++ * Y coordinate of the control box needs to be negated. Moreover, device ++ * offsets are position of glyph origin relative to top left while xMin ++ * and yMax are offsets of top left relative to origin. Another negation. ++ */ ++ cairo_surface_set_device_offset (&(*surface)->base, ++ (double)-glyphslot->bitmap_left, ++ (double)+glyphslot->bitmap_top); + } + +- /* +- * Note: the font's coordinate system is upside down from ours, so the +- * Y coordinate of the control box needs to be negated. Moreover, device +- * offsets are position of glyph origin relative to top left while xMin +- * and yMax are offsets of top left relative to origin. Another negation. +- */ +- cairo_surface_set_device_offset (&(*surface)->base, +- floor (-(double) cbox.xMin / 64.0), +- floor (+(double) cbox.yMax / 64.0)); +- + return CAIRO_STATUS_SUCCESS; + } + + /* Converts a bitmap (or other) FT_GlyphSlot into an image */ + static cairo_status_t + _render_glyph_bitmap (FT_Face face, + cairo_font_options_t *font_options, + cairo_image_surface_t **surface) +@@ -1350,16 +1589,17 @@ _get_pattern_ft_options (FcPattern *patt + + /* disable antialiasing if requested */ + if (FcPatternGetBool (pattern, + FC_ANTIALIAS, 0, &antialias) != FcResultMatch) + antialias = FcTrue; + + if (antialias) { + cairo_subpixel_order_t subpixel_order; ++ int lcd_filter; + + /* disable hinting if requested */ + if (FcPatternGetBool (pattern, + FC_HINTING, 0, &hinting) != FcResultMatch) + hinting = FcTrue; + + if (FcPatternGetInteger (pattern, + FC_RGBA, 0, &rgba) != FcResultMatch) +@@ -1385,16 +1625,35 @@ _get_pattern_ft_options (FcPattern *patt + break; + } + + if (subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT) { + ft_options.base.subpixel_order = subpixel_order; + ft_options.base.antialias = CAIRO_ANTIALIAS_SUBPIXEL; + } + ++ if (FcPatternGetInteger (pattern, ++ FC_LCD_FILTER, 0, &lcd_filter) == FcResultMatch) ++ { ++ switch (lcd_filter) { ++ case FC_LCD_NONE: ++ ft_options.base.lcd_filter = CAIRO_LCD_FILTER_NONE; ++ break; ++ case FC_LCD_DEFAULT: ++ ft_options.base.lcd_filter = CAIRO_LCD_FILTER_FIR5; ++ break; ++ case FC_LCD_LIGHT: ++ ft_options.base.lcd_filter = CAIRO_LCD_FILTER_FIR3; ++ break; ++ case FC_LCD_LEGACY: ++ ft_options.base.lcd_filter = CAIRO_LCD_FILTER_INTRA_PIXEL; ++ break; ++ } ++ } ++ + #ifdef FC_HINT_STYLE + if (FcPatternGetInteger (pattern, + FC_HINT_STYLE, 0, &hintstyle) != FcResultMatch) + hintstyle = FC_HINT_FULL; + + if (!hinting) + hintstyle = FC_HINT_NONE; + +@@ -1486,16 +1745,22 @@ _cairo_ft_options_merge (cairo_ft_option + } + + if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT) + options->base.hint_style = other->base.hint_style; + + if (other->base.hint_style == CAIRO_HINT_STYLE_NONE) + options->base.hint_style = CAIRO_HINT_STYLE_NONE; + ++ if (options->base.lcd_filter == CAIRO_LCD_FILTER_DEFAULT) ++ options->base.lcd_filter = other->base.lcd_filter; ++ ++ if (other->base.lcd_filter == CAIRO_LCD_FILTER_NONE) ++ options->base.lcd_filter = CAIRO_LCD_FILTER_NONE; ++ + if (options->base.antialias == CAIRO_ANTIALIAS_NONE) { + if (options->base.hint_style == CAIRO_HINT_STYLE_NONE) + load_flags |= FT_LOAD_NO_HINTING; + else + load_target = FT_LOAD_TARGET_MONO; + load_flags |= FT_LOAD_MONOCHROME; + } else { + switch (options->base.hint_style) { +@@ -1509,21 +1774,21 @@ _cairo_ft_options_merge (cairo_ft_option + break; + case CAIRO_HINT_STYLE_FULL: + case CAIRO_HINT_STYLE_DEFAULT: + if (options->base.antialias == CAIRO_ANTIALIAS_SUBPIXEL) { + switch (options->base.subpixel_order) { + case CAIRO_SUBPIXEL_ORDER_DEFAULT: + case CAIRO_SUBPIXEL_ORDER_RGB: + case CAIRO_SUBPIXEL_ORDER_BGR: +- load_target |= FT_LOAD_TARGET_LCD; ++ load_target = FT_LOAD_TARGET_LCD; + break; + case CAIRO_SUBPIXEL_ORDER_VRGB: + case CAIRO_SUBPIXEL_ORDER_VBGR: +- load_target |= FT_LOAD_TARGET_LCD_V; ++ load_target = FT_LOAD_TARGET_LCD_V; + break; + } + } + break; + } + } + + options->load_flags = load_flags | load_target; +@@ -2512,16 +2777,44 @@ _cairo_ft_font_options_substitute (const + rgba = FC_RGBA_NONE; + } + + if (! FcPatternAddInteger (pattern, FC_RGBA, rgba)) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + } + } + ++ if (options->lcd_filter != CAIRO_LCD_FILTER_DEFAULT) ++ { ++ if (FcPatternGet (pattern, FC_LCD_FILTER, 0, &v) == FcResultNoMatch) ++ { ++ int lcd_filter; ++ ++ switch (options->lcd_filter) { ++ case CAIRO_LCD_FILTER_NONE: ++ lcd_filter = FT_LCD_FILTER_NONE; ++ break; ++ case CAIRO_LCD_FILTER_DEFAULT: ++ case CAIRO_LCD_FILTER_INTRA_PIXEL: ++ lcd_filter = FT_LCD_FILTER_LEGACY; ++ break; ++ case CAIRO_LCD_FILTER_FIR3: ++ lcd_filter = FT_LCD_FILTER_LIGHT; ++ break; ++ default: ++ case CAIRO_LCD_FILTER_FIR5: ++ lcd_filter = FT_LCD_FILTER_DEFAULT; ++ break; ++ } ++ ++ if (! FcPatternAddInteger (pattern, FC_LCD_FILTER, lcd_filter)) ++ return _cairo_error (CAIRO_STATUS_NO_MEMORY); ++ } ++ } ++ + if (options->hint_style != CAIRO_HINT_STYLE_DEFAULT) + { + if (FcPatternGet (pattern, FC_HINTING, 0, &v) == FcResultNoMatch) + { + if (! FcPatternAddBool (pattern, + FC_HINTING, + options->hint_style != CAIRO_HINT_STYLE_NONE)) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); +diff --git a/gfx/cairo/cairo/src/cairo-surface.c b/gfx/cairo/cairo/src/cairo-surface.c +--- a/gfx/cairo/cairo/src/cairo-surface.c ++++ b/gfx/cairo/cairo/src/cairo-surface.c +@@ -68,16 +68,17 @@ const cairo_surface_t name = { \ + NULL, /* snapshot_detach */ \ + { 0, /* size */ \ + 0, /* num_elements */ \ + 0, /* element_size */ \ + NULL, /* elements */ \ + }, /* snapshots */ \ + { CAIRO_ANTIALIAS_DEFAULT, /* antialias */ \ + CAIRO_SUBPIXEL_ORDER_DEFAULT, /* subpixel_order */ \ ++ CAIRO_LCD_FILTER_DEFAULT, /* lcd_filter */ \ + CAIRO_HINT_STYLE_DEFAULT, /* hint_style */ \ + CAIRO_HINT_METRICS_DEFAULT /* hint_metrics */ \ + } /* font_options */ \ + } + + /* XXX error object! */ + + static DEFINE_NIL_SURFACE(CAIRO_STATUS_NO_MEMORY, _cairo_surface_nil); +diff --git a/gfx/cairo/cairo/src/cairo-types-private.h b/gfx/cairo/cairo/src/cairo-types-private.h +--- a/gfx/cairo/cairo/src/cairo-types-private.h ++++ b/gfx/cairo/cairo/src/cairo-types-private.h +@@ -112,19 +112,45 @@ struct _cairo_array { + unsigned int size; + unsigned int num_elements; + unsigned int element_size; + char **elements; + + cairo_bool_t is_snapshot; + }; + ++ ++/** ++ * cairo_lcd_filter_t: ++ * @CAIRO_LCD_FILTER_DEFAULT: Use the default LCD filter for ++ * font backend and target device ++ * @CAIRO_LCD_FILTER_NONE: Do not perform LCD filtering ++ * @CAIRO_LCD_FILTER_INTRA_PIXEL: Intra-pixel filter ++ * @CAIRO_LCD_FILTER_FIR3: FIR filter with a 3x3 kernel ++ * @CAIRO_LCD_FILTER_FIR5: FIR filter with a 5x5 kernel ++ * ++ * The LCD filter specifies the low-pass filter applied to LCD-optimized ++ * bitmaps generated with an antialiasing mode of %CAIRO_ANTIALIAS_SUBPIXEL. ++ * ++ * Note: This API was temporarily made available in the public ++ * interface during the 1.7.x development series, but was made private ++ * before 1.8. ++ **/ ++typedef enum _cairo_lcd_filter { ++ CAIRO_LCD_FILTER_DEFAULT, ++ CAIRO_LCD_FILTER_NONE, ++ CAIRO_LCD_FILTER_INTRA_PIXEL, ++ CAIRO_LCD_FILTER_FIR3, ++ CAIRO_LCD_FILTER_FIR5 ++} cairo_lcd_filter_t; ++ + struct _cairo_font_options { + cairo_antialias_t antialias; + cairo_subpixel_order_t subpixel_order; ++ cairo_lcd_filter_t lcd_filter; + cairo_hint_style_t hint_style; + cairo_hint_metrics_t hint_metrics; + }; + + /* XXX: Right now, the _cairo_color structure puts unpremultiplied + color in the doubles and premultiplied color in the shorts. Yes, + this is crazy insane, (but at least we don't export this + madness). I'm still working on a cleaner API, but in the meantime, +diff --git a/gfx/cairo/cairo/src/cairo-xlib-screen.c b/gfx/cairo/cairo/src/cairo-xlib-screen.c +--- a/gfx/cairo/cairo/src/cairo-xlib-screen.c ++++ b/gfx/cairo/cairo/src/cairo-xlib-screen.c +@@ -56,16 +56,23 @@ + + #include "cairo-xlib-private.h" + #include "cairo-xlib-xrender-private.h" + + #include "cairo-xlib-surface-private.h" + + #include + ++#ifndef FC_LCD_NONE ++#define FC_LCD_NONE 0 ++#define FC_LCD_DEFAULT 1 ++#define FC_LCD_LIGHT 2 ++#define FC_LCD_LEGACY 3 ++#endif ++ + static int + parse_boolean (const char *v) + { + char c0, c1; + + c0 = *v; + if (c0 == 't' || c0 == 'T' || c0 == 'y' || c0 == 'Y' || c0 == '1') + return 1; +@@ -145,23 +152,32 @@ get_integer_default (Display *dpy, + static void + _cairo_xlib_init_screen_font_options (Display *dpy, + cairo_xlib_screen_t *info) + { + cairo_bool_t xft_hinting; + cairo_bool_t xft_antialias; + int xft_hintstyle; + int xft_rgba; ++ int xft_lcdfilter; + cairo_antialias_t antialias; + cairo_subpixel_order_t subpixel_order; ++ cairo_lcd_filter_t lcd_filter; + cairo_hint_style_t hint_style; + + if (!get_boolean_default (dpy, "antialias", &xft_antialias)) + xft_antialias = TRUE; + ++ if (!get_integer_default (dpy, "lcdfilter", &xft_lcdfilter)) { ++ /* -1 is an non-existant Fontconfig constant used to differentiate ++ * the case when no lcdfilter property is available. ++ */ ++ xft_lcdfilter = -1; ++ } ++ + if (!get_boolean_default (dpy, "hinting", &xft_hinting)) + xft_hinting = TRUE; + + if (!get_integer_default (dpy, "hintstyle", &xft_hintstyle)) + xft_hintstyle = FC_HINT_FULL; + + if (!get_integer_default (dpy, "rgba", &xft_rgba)) + { +@@ -234,28 +250,47 @@ _cairo_xlib_init_screen_font_options (Di + subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR; + break; + case FC_RGBA_UNKNOWN: + case FC_RGBA_NONE: + default: + subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT; + } + ++ switch (xft_lcdfilter) { ++ case FC_LCD_NONE: ++ lcd_filter = CAIRO_LCD_FILTER_NONE; ++ break; ++ case FC_LCD_DEFAULT: ++ lcd_filter = CAIRO_LCD_FILTER_FIR5; ++ break; ++ case FC_LCD_LIGHT: ++ lcd_filter = CAIRO_LCD_FILTER_FIR3; ++ break; ++ case FC_LCD_LEGACY: ++ lcd_filter = CAIRO_LCD_FILTER_INTRA_PIXEL; ++ break; ++ default: ++ lcd_filter = CAIRO_LCD_FILTER_DEFAULT; ++ break; ++ } ++ + if (xft_antialias) { + if (subpixel_order == CAIRO_SUBPIXEL_ORDER_DEFAULT) + antialias = CAIRO_ANTIALIAS_GRAY; + else + antialias = CAIRO_ANTIALIAS_SUBPIXEL; + } else { + antialias = CAIRO_ANTIALIAS_NONE; + } + + cairo_font_options_set_hint_style (&info->font_options, hint_style); + cairo_font_options_set_antialias (&info->font_options, antialias); + cairo_font_options_set_subpixel_order (&info->font_options, subpixel_order); ++ _cairo_font_options_set_lcd_filter (&info->font_options, lcd_filter); + cairo_font_options_set_hint_metrics (&info->font_options, CAIRO_HINT_METRICS_ON); + } + + cairo_xlib_screen_t * + _cairo_xlib_screen_reference (cairo_xlib_screen_t *info) + { + assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&info->ref_count)); + +diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h +--- a/gfx/cairo/cairo/src/cairoint.h ++++ b/gfx/cairo/cairo/src/cairoint.h +@@ -1400,16 +1400,23 @@ extern const cairo_private uint16_t _cai + + cairo_private void + _cairo_font_options_init_default (cairo_font_options_t *options); + + cairo_private void + _cairo_font_options_init_copy (cairo_font_options_t *options, + const cairo_font_options_t *other); + ++cairo_private void ++_cairo_font_options_set_lcd_filter (cairo_font_options_t *options, ++ cairo_lcd_filter_t lcd_filter); ++ ++cairo_private cairo_lcd_filter_t ++_cairo_font_options_get_lcd_filter (const cairo_font_options_t *options); ++ + /* cairo-hull.c */ + cairo_private cairo_status_t + _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices); + + /* cairo-lzw.c */ + cairo_private unsigned char * + _cairo_lzw_compress (unsigned char *data, unsigned long *size_in_out); + +diff --git a/js/src/config/system-headers b/js/src/config/system-headers +--- a/js/src/config/system-headers ++++ b/js/src/config/system-headers +@@ -267,16 +267,17 @@ Font.h + Fonts.h + fp.h + fpieee.h + frame/log.h + frame/req.h + freetype/freetype.h + freetype/ftcache.h + freetype/ftglyph.h ++freetype/ftlcdfil.h + freetype/ftsynth.h + freetype/ftoutln.h + freetype/ttnameid.h + freetype/tttables.h + freetype/t1tables.h + fribidi/fribidi.h + FSp_fopen.h + fstream diff --git a/mozilla-cairo-return.patch b/mozilla-cairo-return.patch new file mode 100644 index 0000000..cb2c6d1 --- /dev/null +++ b/mozilla-cairo-return.patch @@ -0,0 +1,21 @@ +# HG changeset patch +# User Wolfgang Rosenauer +# Parent e36e1a20cb5e1ba0e4bc3facac58029544d92e0a +Bug 631155 - undefined return value in function '_cairo_surface_wrapper_flush' + +diff --git a/gfx/cairo/cairo/src/cairo-surface-wrapper.c b/gfx/cairo/cairo/src/cairo-surface-wrapper.c +--- a/gfx/cairo/cairo/src/cairo-surface-wrapper.c ++++ b/gfx/cairo/cairo/src/cairo-surface-wrapper.c +@@ -526,9 +526,12 @@ _cairo_surface_wrapper_fini (cairo_surfa + } + + cairo_status_t + _cairo_surface_wrapper_flush (cairo_surface_wrapper_t *wrapper) + { + if (wrapper->target->backend->flush) { + return wrapper->target->backend->flush(wrapper->target); + } ++ ++ // this is preliminary to cool down gcc and build checks ++ return CAIRO_STATUS_SUCCESS; + } diff --git a/mozilla-gcc46.patch b/mozilla-gcc46.patch deleted file mode 100644 index 425dfb7..0000000 --- a/mozilla-gcc46.patch +++ /dev/null @@ -1,105 +0,0 @@ -See the following bug reports; - -https://bugzilla.mozilla.org/show_bug.cgi?id=623116 -https://bugzilla.mozilla.org/show_bug.cgi?id=623123 -https://bugzilla.mozilla.org/show_bug.cgi?id=623126 -https://bugzilla.mozilla.org/show_bug.cgi?id=628371 - -diff --git a/xpcom/base/nsDebugImpl.h b/xpcom/base/nsDebugImpl.h ---- a/xpcom/base/nsDebugImpl.h -+++ b/xpcom/base/nsDebugImpl.h -@@ -40,6 +40,7 @@ - class nsDebugImpl : public nsIDebug2 - { - public: -+ nsDebugImpl() {} - NS_DECL_ISUPPORTS - NS_DECL_NSIDEBUG - NS_DECL_NSIDEBUG2 -diff --git a/xpcom/base/nsTraceRefcntImpl.h b/xpcom/base/nsTraceRefcntImpl.h ---- a/xpcom/base/nsTraceRefcntImpl.h -+++ b/xpcom/base/nsTraceRefcntImpl.h -@@ -44,6 +44,7 @@ - class nsTraceRefcntImpl : public nsITraceRefcnt - { - public: -+ nsTraceRefcntImpl() {} - NS_DECL_ISUPPORTS - NS_DECL_NSITRACEREFCNT - -diff --git a/xpcom/glue/nsEnumeratorUtils.cpp b/xpcom/glue/nsEnumeratorUtils.cpp ---- a/xpcom/glue/nsEnumeratorUtils.cpp -+++ b/xpcom/glue/nsEnumeratorUtils.cpp -@@ -52,6 +52,7 @@ class EmptyEnumeratorImpl : public nsISi - public nsIStringEnumerator - { - public: -+ EmptyEnumeratorImpl() {} - // nsISupports interface - NS_DECL_ISUPPORTS_INHERITED // not really inherited, but no mRefCnt - -diff --git a/xpcom/io/nsUnicharInputStream.h b/xpcom/io/nsUnicharInputStream.h ---- a/xpcom/io/nsUnicharInputStream.h -+++ b/xpcom/io/nsUnicharInputStream.h -@@ -51,6 +51,7 @@ class nsSimpleUnicharStreamFactory : - private nsISimpleUnicharStreamFactory - { - public: -+ nsSimpleUnicharStreamFactory() {} - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIFACTORY - NS_DECL_NSISIMPLEUNICHARSTREAMFACTORY -diff --git a/intl/unicharutil/util/nsUnicharUtils.h b/intl/unicharutil/util/nsUnicharUtils.h ---- a/intl/unicharutil/util/nsUnicharUtils.h -+++ b/intl/unicharutil/util/nsUnicharUtils.h -@@ -103,6 +103,7 @@ public: - class nsCaseInsensitiveStringComparator : public nsStringComparator - { - public: -+ nsCaseInsensitiveStringComparator() {} - virtual int operator() (const PRUnichar*, - const PRUnichar*, - PRUint32 aLength) const; -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -616,6 +616,7 @@ class nsXULAppInfo : public nsIXULAppInf - - { - public: -+ nsXULAppInfo() {} - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIXULAPPINFO - NS_DECL_NSIXULRUNTIME -diff --git a/embedding/browser/gtk/src/EmbedPrivate.cpp b/embedding/browser/gtk/src/EmbedPrivate.cpp -index 57fd9b1..0052ca7 100644 ---- a/embedding/browser/gtk/src/EmbedPrivate.cpp -+++ b/embedding/browser/gtk/src/EmbedPrivate.cpp -@@ -99,6 +99,7 @@ nsIDirectoryServiceProvider *EmbedPrivate::sAppFileLocProvider = nsnull; - class GTKEmbedDirectoryProvider : public nsIDirectoryServiceProvider2 - { - public: -+ GTKEmbedDirectoryProvider() {} - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIDIRECTORYSERVICEPROVIDER - NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 ---- a/gfx/ots/src/os2.cc 2011-02-22 09:34:58.000000000 +0100 -+++ b/gfx/ots/src/os2.cc 2011-03-25 10:08:02.183485823 +0100 -@@ -5,6 +5,7 @@ - #include "os2.h" - - #include "head.h" -+#include - - // OS/2 - OS/2 and Windows Metrics - // http://www.microsoft.com/opentype/otspec/os2.htm ---- a/toolkit/crashreporter/google-breakpad/src/common/linux/language.cc 2011-02-22 09:35:48.000000000 +0100 -+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/language.cc 2011-03-25 10:33:34.367485573 +0100 -@@ -39,6 +39,7 @@ - // C++ language-specific operations. - class CPPLanguage: public Language { - public: -+ CPPLanguage() {}; - string MakeQualifiedName(const string &parent_name, - const string &name) const { - if (parent_name.empty()) diff --git a/mozilla-gdk-pixbuf.patch b/mozilla-gdk-pixbuf.patch deleted file mode 100644 index df834f3..0000000 --- a/mozilla-gdk-pixbuf.patch +++ /dev/null @@ -1,31 +0,0 @@ -# HG changeset patch -# Parent ca3a2bf92df09c5425fa1b2486366d40ed757fa1 -Fix compilation with Gnome > 2.30 - -diff --git a/toolkit/system/gnome/Makefile.in b/toolkit/system/gnome/Makefile.in ---- a/toolkit/system/gnome/Makefile.in -+++ b/toolkit/system/gnome/Makefile.in -@@ -77,21 +77,23 @@ endif - EXTRA_DSO_LDOPTS += \ - $(XPCOM_GLUE_LDOPTS) \ - $(XPCOM_FROZEN_LDOPTS) \ - $(NSPR_LIBS) \ - $(MOZ_GCONF_LIBS) \ - $(MOZ_GNOMEVFS_LIBS) \ - $(GLIB_LIBS) \ - $(MOZ_LIBNOTIFY_LIBS) \ -+ $(MOZ_GTK2_LIBS) \ - $(NULL) - - LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/components/build/ - - include $(topsrcdir)/config/rules.mk - - CXXFLAGS += \ - $(MOZ_GTK2_CFLAGS) \ - $(MOZ_GCONF_CFLAGS) \ - $(MOZ_GNOMEVFS_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(MOZ_LIBNOTIFY_CFLAGS) \ -+ $(MOZ_GTK2_CFLAGS) \ - $(NULL) diff --git a/mozilla-gio.patch b/mozilla-gio.patch new file mode 100644 index 0000000..650b86f --- /dev/null +++ b/mozilla-gio.patch @@ -0,0 +1,284 @@ +# HG changeset patch +# User Chris Coulson +# Parent 0ebe30f9eacfe67fa0b699457e524d5a9c96359e +Bug 611953 - GNOME 3.0 readiness (patch 2 + 3) + +diff --git a/toolkit/system/gnome/nsGIOService.cpp b/toolkit/system/gnome/nsGIOService.cpp +--- a/toolkit/system/gnome/nsGIOService.cpp ++++ b/toolkit/system/gnome/nsGIOService.cpp +@@ -101,25 +101,25 @@ nsGIOMimeApp::GetName(nsACString& aName) + return NS_OK; + } + + NS_IMETHODIMP + nsGIOMimeApp::GetCommand(nsACString& aCommand) + { + get_commandline_t g_app_info_get_commandline_ptr; + +- void *libHandle = dlopen("libgio-2.0.so", RTLD_LAZY); ++ void *libHandle = dlopen("libgio-2.0.so.0", RTLD_LAZY); + if (!libHandle) { + return NS_ERROR_FAILURE; + } + dlerror(); /* clear any existing error */ + g_app_info_get_commandline_ptr = + (get_commandline_t) dlsym(libHandle, "g_app_info_get_commandline"); +- if (dlerror() != NULL) { +- const char cmd = *g_app_info_get_commandline_ptr(mApp); ++ if (dlerror() == NULL) { ++ const char *cmd = g_app_info_get_commandline_ptr(mApp); + if (!cmd) { + dlclose(libHandle); + return NS_ERROR_FAILURE; + } + aCommand.Assign(cmd); + } + dlclose(libHandle); + return NS_OK; +@@ -277,16 +277,43 @@ nsGIOMimeApp::SetAsDefaultForFileExtensi + } else { + *ext_pos = '\0'; + } + } + g_free(extensions); + return NS_OK; + } + ++/** ++ * Set default application for URI's of a particular scheme ++ * @param aURIScheme string containing the URI scheme ++ * @return NS_OK when application was set as default for URI scheme, ++ * NS_ERROR_FAILURE otherwise ++ */ ++NS_IMETHODIMP ++nsGIOMimeApp::SetAsDefaultForURIScheme(nsACString const& aURIScheme) ++{ ++ GError *error = NULL; ++ nsCAutoString contentType("x-scheme-handler/"); ++ contentType.Append(aURIScheme); ++ ++ g_app_info_set_as_default_for_type(mApp, ++ contentType.get(), ++ &error); ++ if (error) { ++ g_warning("Cannot set application as default for URI scheme (%s): %s", ++ PromiseFlatCString(aURIScheme).get(), ++ error->message); ++ g_error_free(error); ++ return NS_ERROR_FAILURE; ++ } ++ ++ return NS_OK; ++} ++ + nsresult + nsGIOService::Init() + { + // do nothing, gvfs/gio does not init. + return NS_OK; + } + + NS_IMPL_ISUPPORTS1(nsGIOService, nsIGIOService) +@@ -317,29 +344,45 @@ nsGIOService::GetMimeTypeFromExtension(c + g_free(mime_type); + g_free(content_type); + + return NS_OK; + } + // used in nsGNOMERegistry + // ----------------------------------------------------------------------------- + NS_IMETHODIMP ++nsGIOService::GetAppForURIScheme(const nsACString& aURIScheme, ++ nsIGIOMimeApp** aApp) ++{ ++ *aApp = nsnull; ++ ++ GAppInfo *app_info = g_app_info_get_default_for_uri_scheme( ++ PromiseFlatCString(aURIScheme).get()); ++ if (app_info) { ++ nsGIOMimeApp *mozApp = new nsGIOMimeApp(app_info); ++ NS_ADDREF(*aApp = mozApp); ++ } else { ++ return NS_ERROR_FAILURE; ++ } ++ return NS_OK; ++} ++ ++NS_IMETHODIMP + nsGIOService::GetAppForMimeType(const nsACString& aMimeType, + nsIGIOMimeApp** aApp) + { + *aApp = nsnull; + char *content_type = + get_content_type_from_mime_type(PromiseFlatCString(aMimeType).get()); + if (!content_type) + return NS_ERROR_FAILURE; + + GAppInfo *app_info = g_app_info_get_default_for_type(content_type, false); + if (app_info) { + nsGIOMimeApp *mozApp = new nsGIOMimeApp(app_info); +- NS_ENSURE_TRUE(mozApp, NS_ERROR_OUT_OF_MEMORY); + NS_ADDREF(*aApp = mozApp); + } else { + g_free(content_type); + return NS_ERROR_FAILURE; + } + g_free(content_type); + return NS_OK; + } +@@ -414,75 +457,46 @@ nsGIOService::CreateAppFromCommand(nsACS + nsIGIOMimeApp** appInfo) + { + GError *error = NULL; + *appInfo = nsnull; + + GAppInfo *app_info = NULL, *app_info_from_list = NULL; + GList *apps = g_app_info_get_all(); + GList *apps_p = apps; +- get_commandline_t g_app_info_get_commandline_ptr; +- +- void *libHandle = dlopen("libgio-2.0.so", RTLD_LAZY); +- if (!libHandle) { +- return NS_ERROR_FAILURE; +- } +- dlerror(); /* clear any existing error */ +- g_app_info_get_commandline_ptr = +- (get_commandline_t) dlsym(libHandle, "g_app_info_get_commandline"); +- if (dlerror() != NULL) { +- g_app_info_get_commandline_ptr = NULL; +- } + + // Try to find relevant and existing GAppInfo in all installed application ++ // We do this by comparing each GAppInfo's executable with out own + while (apps_p) { + app_info_from_list = (GAppInfo*) apps_p->data; +- /* This is a silly test. It just compares app names but not +- * commands. This is due to old version of Glib/Gio. The required +- * function which allows to do a regular check of existence of desktop file +- * is possible by using function g_app_info_get_commandline. This function +- * has been introduced in Glib 2.20. */ +- if (app_info_from_list && strcmp(g_app_info_get_name(app_info_from_list), +- PromiseFlatCString(appName).get()) == 0 ) +- { +- if (g_app_info_get_commandline_ptr) +- { +- /* Following test is only possible with Glib >= 2.20. +- * Compare path only by using strncmp */ +- if (strncmp(g_app_info_get_commandline_ptr(app_info_from_list), +- PromiseFlatCString(cmd).get(), +- strlen(PromiseFlatCString(cmd).get())) == 0) +- { +- app_info = app_info_from_list; +- break; +- } else { +- g_object_unref(app_info_from_list); +- } +- } else { ++ if (!app_info) { ++ // If the executable is not absolute, get it's full path ++ char *executable = g_find_program_in_path(g_app_info_get_executable(app_info_from_list)); ++ ++ if (executable && strcmp(executable, PromiseFlatCString(cmd).get()) == 0) { ++ g_object_ref (app_info_from_list); + app_info = app_info_from_list; +- break; + } +- } else { +- g_object_unref(app_info_from_list); ++ g_free(executable); + } ++ ++ g_object_unref(app_info_from_list); + apps_p = apps_p->next; + } + g_list_free(apps); + + if (!app_info) { + app_info = g_app_info_create_from_commandline(PromiseFlatCString(cmd).get(), + PromiseFlatCString(appName).get(), + G_APP_INFO_CREATE_SUPPORTS_URIS, + &error); + } + + if (!app_info) { + g_warning("Cannot create application info from command: %s", error->message); + g_error_free(error); +- dlclose(libHandle); + return NS_ERROR_FAILURE; + } + nsGIOMimeApp *mozApp = new nsGIOMimeApp(app_info); + NS_ENSURE_TRUE(mozApp, NS_ERROR_OUT_OF_MEMORY); + NS_ADDREF(*appInfo = mozApp); +- dlclose(libHandle); + return NS_OK; + } +diff --git a/xpcom/system/nsIGIOService.idl b/xpcom/system/nsIGIOService.idl +--- a/xpcom/system/nsIGIOService.idl ++++ b/xpcom/system/nsIGIOService.idl +@@ -39,17 +39,17 @@ + + #include "nsISupports.idl" + + interface nsIUTF8StringEnumerator; + interface nsIURI; + + /* nsIGIOMimeApp holds information about an application that is looked up + with nsIGIOService::GetAppForMimeType. */ +-// 66009894-9877-405b-9321-bf30420e34e6 prev uuid ++// e77021b4-4012-407d-b686-7a1f18050109 prev uuid + + [scriptable, uuid(e77021b4-4012-407d-b686-7a1f18050109)] + interface nsIGIOMimeApp : nsISupports + { + const long EXPECTS_URIS = 0; + const long EXPECTS_PATHS = 1; + const long EXPECTS_URIS_FOR_NON_FILES = 2; + +@@ -57,41 +57,45 @@ interface nsIGIOMimeApp : nsISupports + readonly attribute AUTF8String name; + readonly attribute AUTF8String command; + readonly attribute long expectsURIs; // see constants above + readonly attribute nsIUTF8StringEnumerator supportedURISchemes; + + void launch(in AUTF8String uri); + void setAsDefaultForMimeType(in AUTF8String mimeType); + void setAsDefaultForFileExtensions(in AUTF8String extensions); ++ void setAsDefaultForURIScheme(in AUTF8String uriScheme); + }; + + /* + * The VFS service makes use of two distinct registries. + * + * The application registry holds information about applications (uniquely + * identified by id), such as which MIME types and URI schemes they are + * capable of handling, whether they run in a terminal, etc. + * + * The MIME registry holds information about MIME types, such as which + * extensions map to a given MIME type. The MIME registry also stores the + * id of the application selected to handle each MIME type. + */ + +-// prev id dea20bf0-4e4d-48c5-b932-dc3e116dc64b +-[scriptable, uuid(47e372c2-78bb-4899-8114-56aa7d9cdac5)] ++// prev id 47e372c2-78bb-4899-8114-56aa7d9cdac5 ++[scriptable, uuid(74ca8791-330d-4786-9569-2a2a19f0b486)] + interface nsIGIOService : nsISupports + { + + /*** MIME registry methods ***/ + + /* Obtain the MIME type registered for an extension. The extension + should not include a leading dot. */ + AUTF8String getMimeTypeFromExtension(in AUTF8String extension); + ++ /* Obtain the preferred application for opening a given URI scheme */ ++ nsIGIOMimeApp getAppForURIScheme(in AUTF8String aURIScheme); ++ + /* Obtain the preferred application for opening a given MIME type */ + nsIGIOMimeApp getAppForMimeType(in AUTF8String mimeType); + + /* Obtain the preferred application for opening a given MIME type */ + nsIGIOMimeApp createAppFromCommand(in AUTF8String cmd, + in AUTF8String appName); + + /* Obtain a description for the given MIME type */ diff --git a/mozilla-language.patch b/mozilla-language.patch new file mode 100644 index 0000000..76e0e29 --- /dev/null +++ b/mozilla-language.patch @@ -0,0 +1,48 @@ +# HG changeset patch +# User Wolfgang Rosenauer +# Parent db620d83124746201970dcf50c661957df979eca +Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE + +diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp +--- a/intl/locale/src/nsLocaleService.cpp ++++ b/intl/locale/src/nsLocaleService.cpp +@@ -181,16 +181,17 @@ nsLocaleService::nsLocaleService(void) + } + + + #ifdef MOZ_WIDGET_QT + const char* lang = QLocale::system().name().toAscii(); + #else + // Get system configuration + const char* lang = getenv("LANG"); ++ const char* language = getenv("LANGUAGE"); + #endif + + for( i = 0; i < LocaleListLength; i++ ) { + nsresult result; + // setlocale( , "") evaluates LC_* and LANG + char* lc_temp = setlocale(posix_locale_category[i], ""); + CopyASCIItoUTF16(LocaleList[i], category); + category_platform = category; +@@ -206,16 +207,21 @@ nsLocaleService::nsLocaleService(void) + else { + CopyASCIItoUTF16(lang, platformLocale); + result = posixConverter->GetXPLocale(lang, xpLocale); + } + } + if (NS_FAILED(result)) { + return; + } ++ // LANGUAGE is overriding LC_MESSAGES ++ if (i == LC_MESSAGES && language && *language) { ++ CopyASCIItoUTF16(language, platformLocale); ++ result = posixConverter->GetXPLocale(language, xpLocale); ++ } + resultLocale->AddCategory(category, xpLocale); + resultLocale->AddCategory(category_platform, platformLocale); + } + mSystemLocale = do_QueryInterface(resultLocale); + mApplicationLocale = do_QueryInterface(resultLocale); + } // if ( NS_SUCCEEDED )... + + #endif // XP_UNIX diff --git a/mozilla-shared-nss-db.patch b/mozilla-shared-nss-db.patch index 0bc0d86..4763dc9 100644 --- a/mozilla-shared-nss-db.patch +++ b/mozilla-shared-nss-db.patch @@ -1,13 +1,13 @@ From: Hans Petter Jansson Wolfgang Rosenauer Subject: use libnsssharedhelper if available at compile time - (can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1) + (can be disabled by exporting MOZ_TB_NO_NSSHELPER=1) References: diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in -@@ -561,16 +561,20 @@ MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNO +@@ -571,16 +571,20 @@ MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -22,30 +22,30 @@ diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in + MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@ + export CL_INCLUDES_PREFIX = @CL_INCLUDES_PREFIX@ + MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@ COMPILER_DEPEND = @COMPILER_DEPEND@ MDDEPDIR := @MDDEPDIR@ - - MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@ - + CC_WRAPPER = @CC_WRAPPER@ diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in -@@ -8016,16 +8016,32 @@ AC_SUBST(QCMS_LIBS) +@@ -8610,16 +8610,31 @@ AC_SUBST(QCMS_LIBS) dnl ======================================================== - dnl OTS + dnl HarfBuzz dnl ======================================================== - MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)' - AC_SUBST(MOZ_OTS_LIBS) + MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)' + AC_SUBST(MOZ_HARFBUZZ_LIBS) dnl ======================================================== +dnl Check for nss-shared-helper +dnl ======================================================== + + PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper, -+ [MOZ_ENABLE_NSSHELPER=1], -+ [MOZ_ENABLE_NSSHELPER=]) ++ [MOZ_ENABLE_NSSHELPER=1], ++ [MOZ_ENABLE_NSSHELPER=]) + +if test "$MOZ_ENABLE_NSSHELPER"; then + AC_DEFINE(MOZ_ENABLE_NSSHELPER) @@ -54,21 +54,20 @@ diff --git a/configure.in b/configure.in +AC_SUBST(NSSHELPER_CFLAGS) +AC_SUBST(NSSHELPER_LIBS) + -+ +dnl ======================================================== + dnl OTS + dnl ======================================================== + MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)' + AC_SUBST(MOZ_OTS_LIBS) + + dnl ======================================================== dnl disable xul dnl ======================================================== - MOZ_ARG_DISABLE_BOOL(xul, - [ --disable-xul Disable XUL], - MOZ_XUL= ) - if test "$MOZ_XUL"; then - AC_DEFINE(MOZ_XUL) - else diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in --- a/security/manager/ssl/src/Makefile.in +++ b/security/manager/ssl/src/Makefile.in -@@ -133,19 +133,20 @@ REQUIRES = nspr \ - $(NULL) +@@ -117,19 +117,20 @@ CSRCS += md4.c + EXTRA_DEPS = $(NSS_DEP_LIBS) @@ -116,30 +115,34 @@ diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/ #include "nsNetUtil.h" #include "nsAppDirectoryServiceDefs.h" -@@ -1606,17 +1613,31 @@ nsNSSComponent::InitializeNSS(PRBool sho - // The call to ConfigureInternalPKCS11Token needs to be done before NSS is initialized, - // but affects only static data. - // If we could assume i18n will not change between profiles, one call per application - // run were sufficient. As I can't predict what happens in the future, let's repeat - // this call for every re-init of NSS. - +@@ -1658,18 +1665,34 @@ nsNSSComponent::InitializeNSS(PRBool sho ConfigureInternalPKCS11Token(); -- SECStatus init_rv = ::NSS_InitReadWrite(profileStr.get()); + // The NSS_INIT_NOROOTINIT flag turns off the loading of the root certs + // module by NSS_Initialize because we will load it in InstallLoadableRoots + // later. It also allows us to work around a bug in the system NSS in + // Ubuntu 8.04, which loads any nonexistent "/libnssckbi.so" as + // "/usr/lib/nss/libnssckbi.so". + PRUint32 init_flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE; +- SECStatus init_rv = ::NSS_Initialize(profileStr.get(), "", "", +- SECMOD_DB, init_flags); + SECStatus init_rv = SECFailure; +#ifdef MOZ_ENABLE_NSSHELPER -+ if (PR_GetEnv("MOZ_TB_NO_NSSHELPER")) { -+ init_rv = ::NSS_InitReadWrite(profileStr.get()); ++ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) { ++ init_rv = ::NSS_Initialize(profileStr.get(), "", "", ++ SECMOD_DB, init_flags); + } else { -+ init_rv = ::nsshelp_open_db ("Thunderbird", profileStr.get(), 0); ++ init_rv = ::nsshelp_open_db ("Thunderbird", profileStr.get(), init_flags); + + if (init_rv != SECSuccess) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get())); -+ init_rv = ::NSS_InitReadWrite(profileStr.get()); ++ init_rv = ::NSS_Initialize(profileStr.get(), "", "", ++ SECMOD_DB, init_flags); + } + } +#else -+ init_rv = ::NSS_InitReadWrite(profileStr.get()); ++ init_rv = ::NSS_Initialize(profileStr.get(), "", "", ++ SECMOD_DB, init_flags); +#endif if (init_rv != SECSuccess) { @@ -152,7 +155,7 @@ diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/ diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in --- a/toolkit/library/Makefile.in +++ b/toolkit/library/Makefile.in -@@ -189,17 +189,17 @@ else +@@ -169,17 +169,17 @@ ifndef MOZ_ENABLE_LIBXUL EXTRA_DSO_LDOPTS += \ $(MOZ_COMPONENT_LIBS) \ $(MOZ_JS_LIBS) \ @@ -161,12 +164,12 @@ diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in DEFINES += -DIMPL_XREAPI --EXTRA_DSO_LDOPTS += $(NSPR_LIBS) -+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(NSSHELPER_LIBS) +-EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) ++EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) $(NSSHELPER_LIBS) ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) CXXFLAGS += $(TK_CFLAGS) - EXTRA_DSO_LDOPTS += \ + OS_LIBS += \ -framework SystemConfiguration \ -framework QuickTime \ -framework IOKit \ diff --git a/mozilla-xsmp.patch b/mozilla-xsmp.patch deleted file mode 100644 index edf92fb..0000000 --- a/mozilla-xsmp.patch +++ /dev/null @@ -1,192 +0,0 @@ -From: Wolfgang Rosenauer -Subject: XSMP restore doesn't work for Thunderbird -References: -https://bugzilla.mozilla.org/show_bug.cgi?id=508986 -https://bugzilla.novell.com/show_bug.cgi?id=528406 - -diff --git a/toolkit/xre/nsNativeAppSupportUnix.cpp b/toolkit/xre/nsNativeAppSupportUnix.cpp ---- a/toolkit/xre/nsNativeAppSupportUnix.cpp -+++ b/toolkit/xre/nsNativeAppSupportUnix.cpp -@@ -94,108 +94,52 @@ typedef enum { - GNOME_DIALOG_NORMAL - } GnomeDialogType; - - typedef GnomeProgram * (*_gnome_program_init_fn)(const char *, const char *, - const GnomeModuleInfo *, int, - char **, const char *, ...); - typedef const GnomeModuleInfo * (*_libgnomeui_module_info_get_fn)(); - typedef GnomeClient * (*_gnome_master_client_fn)(void); --typedef void (*GnomeInteractFunction)(GnomeClient *, gint, GnomeDialogType, -- gpointer); --typedef void (*_gnome_client_request_interaction_fn)(GnomeClient *, -- GnomeDialogType, -- GnomeInteractFunction, -- gpointer); --typedef void (*_gnome_interaction_key_return_fn)(gint, gboolean); - typedef void (*_gnome_client_set_restart_command_fn)(GnomeClient*, gint, gchar*[]); - --static _gnome_client_request_interaction_fn gnome_client_request_interaction; --static _gnome_interaction_key_return_fn gnome_interaction_key_return; - static _gnome_client_set_restart_command_fn gnome_client_set_restart_command; - --void interact_cb(GnomeClient *client, gint key, -- GnomeDialogType type, gpointer data) --{ -- nsCOMPtr obsServ = -- do_GetService("@mozilla.org/observer-service;1"); -- nsCOMPtr cancelQuit = -- do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID); -- -- cancelQuit->SetData(PR_FALSE); -- -- obsServ->NotifyObservers(cancelQuit, "quit-application-requested", nsnull); -- -- PRBool abortQuit; -- cancelQuit->GetData(&abortQuit); -- -- gnome_interaction_key_return(key, abortQuit); --} -- - gboolean save_yourself_cb(GnomeClient *client, gint phase, - GnomeSaveStyle style, gboolean shutdown, - GnomeInteractStyle interact, gboolean fast, - gpointer user_data) - { -- if (!shutdown) -- return TRUE; -- - nsCOMPtr obsServ = - do_GetService("@mozilla.org/observer-service;1"); - - nsCOMPtr didSaveSession = - do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID); - - if (!obsServ || !didSaveSession) - return TRUE; // OOM - -+ // Notify observers to save the session state - didSaveSession->SetData(PR_FALSE); - obsServ->NotifyObservers(didSaveSession, "session-save", nsnull); - - PRBool status; - didSaveSession->GetData(&status); - -- // Didn't save, or no way of saving. So signal for quit-application. -- if (!status) { -- if (interact == GNOME_INTERACT_ANY) -- gnome_client_request_interaction(client, GNOME_DIALOG_NORMAL, -- interact_cb, nsnull); -- return TRUE; -- } -- -- // Is there a request to suppress default binary launcher? -- char* argv1 = getenv("MOZ_APP_LAUNCHER"); -+ // If there was no session saved and the save_yourself request is -+ // caused by upcoming shutdown we like to prepare for it -+ if (!status && shutdown) { -+ nsCOMPtr cancelQuit = -+ do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID); - -- if(!argv1) { -- // Tell GNOME the command for restarting us so that we can be part of XSMP session restore -- NS_ASSERTION(gDirServiceProvider, "gDirServiceProvider is NULL! This shouldn't happen!"); -- nsCOMPtr executablePath; -- nsresult rv; -+ cancelQuit->SetData(PR_FALSE); -+ obsServ->NotifyObservers(cancelQuit, "quit-application-requested", nsnull); - -- PRBool dummy; -- rv = gDirServiceProvider->GetFile(XRE_EXECUTABLE_FILE, &dummy, getter_AddRefs(executablePath)); -- -- if (NS_SUCCEEDED(rv)) { -- nsCAutoString path; -- -- // Strip off the -bin suffix to get the shell script we should run; this is what Breakpad does -- nsCAutoString leafName; -- rv = executablePath->GetNativeLeafName(leafName); -- if (NS_SUCCEEDED(rv) && StringEndsWith(leafName, NS_LITERAL_CSTRING("-bin"))) { -- leafName.SetLength(leafName.Length() - strlen("-bin")); -- executablePath->SetNativeLeafName(leafName); -- } -- -- executablePath->GetNativePath(path); -- argv1 = (char*)(path.get()); -- } -- } -- -- if(argv1) { -- gnome_client_set_restart_command(client, 1, &argv1); -+ PRBool abortQuit; -+ cancelQuit->GetData(&abortQuit); - } - - return TRUE; - } - - void die_cb(GnomeClient *client, gpointer user_data) - { - nsCOMPtr appService = -@@ -446,29 +390,59 @@ nsNativeAppSupportUnix::Start(PRBool *aR - } - #endif - - // Careful! These libraries cannot be unloaded after this point because - // gnome_program_init causes atexit handlers to be registered. Strange - // crashes will occur if these libraries are unloaded. - - #ifdef MOZ_X11 -- gnome_client_request_interaction = (_gnome_client_request_interaction_fn) -- PR_FindFunctionSymbol(gnomeuiLib, "gnome_client_request_interaction"); -- gnome_interaction_key_return = (_gnome_interaction_key_return_fn) -- PR_FindFunctionSymbol(gnomeuiLib, "gnome_interaction_key_return"); - gnome_client_set_restart_command = (_gnome_client_set_restart_command_fn) - PR_FindFunctionSymbol(gnomeuiLib, "gnome_client_set_restart_command"); - - _gnome_master_client_fn gnome_master_client = (_gnome_master_client_fn) - PR_FindFunctionSymbol(gnomeuiLib, "gnome_master_client"); - - GnomeClient *client = gnome_master_client(); - g_signal_connect(client, "save-yourself", G_CALLBACK(save_yourself_cb), NULL); - g_signal_connect(client, "die", G_CALLBACK(die_cb), NULL); -+ -+ // Set the correct/requested restart command in any case. -+ -+ // Is there a request to suppress default binary launcher? -+ char* argv1 = getenv("MOZ_APP_LAUNCHER"); -+ -+ if(!argv1) { -+ // Tell the desktop the command for restarting us so that we can be part of XSMP session restore -+ NS_ASSERTION(gDirServiceProvider, "gDirServiceProvider is NULL! This shouldn't happen!"); -+ nsCOMPtr executablePath; -+ nsresult rv; -+ -+ PRBool dummy; -+ rv = gDirServiceProvider->GetFile(XRE_EXECUTABLE_FILE, &dummy, getter_AddRefs(executablePath)); -+ -+ if (NS_SUCCEEDED(rv)) { -+ nsCAutoString path; -+ -+ // Strip off the -bin suffix to get the shell script we should run; this is what Breakpad does -+ nsCAutoString leafName; -+ rv = executablePath->GetNativeLeafName(leafName); -+ if (NS_SUCCEEDED(rv) && StringEndsWith(leafName, NS_LITERAL_CSTRING("-bin"))) { -+ leafName.SetLength(leafName.Length() - strlen("-bin")); -+ executablePath->SetNativeLeafName(leafName); -+ } -+ -+ executablePath->GetNativePath(path); -+ argv1 = (char*)(path.get()); -+ } -+ } -+ -+ if (argv1) { -+ gnome_client_set_restart_command(client, 1, &argv1); -+ } - #endif /* MOZ_X11 */ - - return NS_OK; - } - - NS_IMETHODIMP - nsNativeAppSupportUnix::Stop(PRBool *aResult) - { diff --git a/mozilla.sh.in b/mozilla.sh.in index 8dbf4d5..11b4761 100644 --- a/mozilla.sh.in +++ b/mozilla.sh.in @@ -59,11 +59,20 @@ MOZ_DIST_LIB="%PROGDIR" MOZ_APPNAME="%APPNAME" MOZ_PROGRAM="$MOZ_DIST_LIB/$MOZ_APPNAME-bin" -export MOZ_APP_LAUNCHER="$MOZ_DIST_LIB/$MOZ_APPNAME.sh" +MOZ_APP_LAUNCHER="$MOZ_DIST_LIB/$MOZ_APPNAME.sh" +if [ "$0" = "$MOZ_APP_LAUNCHER" ]; then + [ -h "/usr/bin/$MOZ_APPNAME" ] && \ + _link=$(readlink -f "/usr/bin/$MOZ_APPNAME") + if [ "$_link" = "$MOZ_APP_LAUNCHER" ]; then + export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME" + fi +else + export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME" +fi mozilla_lib=`file $MOZ_PROGRAM` LIB=lib -echo $mozilla_lib | grep -q -E 'x86-64|s390x|ppc64' && LIB=lib64 +echo $mozilla_lib | grep -q -E 'x86-64|s390x|64-bit.PowerPC' && LIB=lib64 BROWSER_PLUGIN_DIR=/usr/$LIB/browser-plugins if [ ! -d $BROWSER_PLUGIN_DIR ]; then diff --git a/tb-develdirs.patch b/tb-develdirs.patch index d2c4ddc..0883865 100644 --- a/tb-develdirs.patch +++ b/tb-develdirs.patch @@ -1,6 +1,12 @@ ---- config/autoconf.mk.in.orig 2009-02-11 20:12:19.000000000 +0100 -+++ config/autoconf.mk.in 2009-02-11 20:13:15.000000000 +0100 -@@ -60,11 +60,11 @@ MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@ +diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in +--- a/config/autoconf.mk.in ++++ b/config/autoconf.mk.in +@@ -56,21 +56,21 @@ MOZ_APP_NAME = @MOZ_APP_NAME@ + MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@ + MOZ_APP_VERSION = @MOZ_APP_VERSION@ + + MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@ + prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -10,7 +16,12 @@ datadir = @datadir@ mandir = @mandir@ -idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -+idldir = @libdir@/$(MOZ_APP_NAME)3 ++idldir = $(datadir)/idl/$(MOZ_APP_NAME)3 installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) + + MOZDEPTH = $(DEPTH)/mozilla + DIST = $(MOZDEPTH)/dist + LIBXUL_SDK = @LIBXUL_SDK@ + diff --git a/tb-ssldap.patch b/tb-ssldap.patch index f7ab820..91c2185 100644 --- a/tb-ssldap.patch +++ b/tb-ssldap.patch @@ -1,7 +1,7 @@ diff --git a/mail/installer/package-manifest.in b/mail/installer/package-manifest.in --- a/mail/installer/package-manifest.in +++ b/mail/installer/package-manifest.in -@@ -240,16 +240,17 @@ +@@ -268,16 +268,17 @@ #ifdef XP_WIN32 @BINPATH@/nsldap32v60@DLL_SUFFIX@ @BINPATH@/nsldappr32v60@DLL_SUFFIX@ @@ -18,4 +18,4 @@ diff --git a/mail/installer/package-manifest.in b/mail/installer/package-manifes @BINPATH@/components/nsLoginInfo.js @BINPATH@/components/nsLoginManager.js @BINPATH@/components/nsLoginManagerPrompter.js - @BINPATH@/components/storage-Legacy.js + @BINPATH@/components/passwordmgr.manifest diff --git a/thunderbird-3.1.11-source.tar.bz2 b/thunderbird-3.1.11-source.tar.bz2 deleted file mode 100644 index 778d53f..0000000 --- a/thunderbird-3.1.11-source.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5a9985c450b6a2f5b8aa7ae137c9e2f2ad3c1b3a111a72b16127a9e015e675c3 -size 68643272 diff --git a/thunderbird-5.0-source.tar.bz2 b/thunderbird-5.0-source.tar.bz2 new file mode 100644 index 0000000..d280cc0 --- /dev/null +++ b/thunderbird-5.0-source.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b01aa9346ee270e10e84b40124bc5411122d94dbd08cd3ceb202bd736db22355 +size 86688765 diff --git a/thunderbird-appname.patch b/thunderbird-appname.patch deleted file mode 100644 index b8fb722..0000000 --- a/thunderbird-appname.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/mail/components/shell/nsMailGNOMEIntegration.cpp b/mail/components/shell/nsMailGNOMEIntegration.cpp ---- a/mail/components/shell/nsMailGNOMEIntegration.cpp -+++ b/mail/components/shell/nsMailGNOMEIntegration.cpp -@@ -93,16 +93,22 @@ nsMailGNOMEIntegration::Init() - rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR, - getter_AddRefs(appPath)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = appPath->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_NAME)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = appPath->GetNativePath(mAppPath); -+ -+ /* This path of thunderbird is hardcoded for the default path setting -+ * And the above code is not used. -+ */ -+ mAppPath.Assign ("/usr/bin/thunderbird"); -+ - return rv; - } - - NS_IMPL_ISUPPORTS1(nsMailGNOMEIntegration, nsIShellService) - - - NS_IMETHODIMP - nsMailGNOMEIntegration::IsDefaultClient(PRBool aStartupCheck, PRUint16 aApps, PRBool * aIsDefaultClient) diff --git a/thunderbird-gio.patch b/thunderbird-gio.patch new file mode 100644 index 0000000..2f1dfd4 --- /dev/null +++ b/thunderbird-gio.patch @@ -0,0 +1,254 @@ +Bug 624341 - Update check for default mailer to work the new way (glib >= 2.27.1) + +diff --git a/mail/components/shell/nsMailGNOMEIntegration.cpp b/mail/components/shell/nsMailGNOMEIntegration.cpp +--- a/mail/components/shell/nsMailGNOMEIntegration.cpp ++++ b/mail/components/shell/nsMailGNOMEIntegration.cpp +@@ -33,28 +33,30 @@ + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + + #include "nsMailGNOMEIntegration.h" + #include "nsIGConfService.h" ++#include "nsIGIOService.h" + #include "nsCOMPtr.h" + #include "nsIServiceManager.h" + #include "prenv.h" + #include "nsIFile.h" + #include "nsIStringBundle.h" + #include "nsIPromptService.h" + #include "nsIPrefService.h" + #include "nsIPrefBranch.h" + #include "nsDirectoryServiceDefs.h" + #include "nsDirectoryServiceUtils.h" + #include "nsEmbedCID.h" + #include "nsMemory.h" ++#include "nsIStringBundle.h" + + #include + #include + #include + + static const char* const sMailProtocols[] = { + "mailto" + }; +@@ -77,18 +79,19 @@ nsMailGNOMEIntegration::nsMailGNOMEInteg + nsresult + nsMailGNOMEIntegration::Init() + { + nsresult rv; + + // GConf _must_ be available, or we do not allow CreateInstance to succeed. + + nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); ++ nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + +- if (!gconf) ++ if (!gconf && !giovfs) + return NS_ERROR_NOT_AVAILABLE; + + // Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use + // the locale encoding. If it's not set, they use UTF-8. + mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nsnull; + + if (GetAppPathFromLauncher()) + return NS_OK; +@@ -117,18 +120,18 @@ nsMailGNOMEIntegration::GetAppPathFromLa + return PR_FALSE; + + if (g_path_is_absolute(launcher)) { + mAppPath = launcher; + tmp = g_path_get_basename(launcher); + gchar *fullpath = g_find_program_in_path(tmp); + if (fullpath && mAppPath.Equals(fullpath)) { + mAppIsInPath = PR_TRUE; +- g_free(fullpath); + } ++ g_free(fullpath); + } else { + tmp = g_find_program_in_path(launcher); + if (!tmp) + return PR_FALSE; + mAppPath = tmp; + mAppIsInPath = PR_TRUE; + } + +@@ -210,66 +213,117 @@ nsMailGNOMEIntegration::KeyMatchesAppNam + return PR_FALSE; + + PRBool matches = mAppPath.Equals(commandPath); + g_free(commandPath); + return matches; + } + + PRBool ++nsMailGNOMEIntegration::CheckHandlerMatchesAppName(const nsACString &handler) const ++{ ++ gint argc; ++ gchar **argv; ++ nsCAutoString command(handler); ++ ++ if (g_shell_parse_argv(command.get(), &argc, &argv, NULL)) { ++ command.Assign(argv[0]); ++ g_strfreev(argv); ++ } else { ++ return PR_FALSE; ++ } ++ ++ return KeyMatchesAppName(command.get()); ++} ++ ++PRBool + nsMailGNOMEIntegration::checkDefault(const char* const *aProtocols, unsigned int aLength) + { + nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); ++ nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + + PRBool enabled; + nsCAutoString handler; ++ nsresult rv; + + for (unsigned int i = 0; i < aLength; ++i) { +- handler.Truncate(); +- nsresult rv = gconf->GetAppForProtocol(nsDependentCString(aProtocols[i]), +- &enabled, handler); +- if (NS_SUCCEEDED(rv)) +- { +- // The string will be something of the form: [/path/to/]app "%s" +- // We want to remove all of the parameters and get just the binary name. ++ if (gconf) { ++ handler.Truncate(); ++ rv = gconf->GetAppForProtocol(nsDependentCString(aProtocols[i]), ++ &enabled, handler); ++ if (NS_SUCCEEDED(rv) && (!CheckHandlerMatchesAppName(handler) || !enabled)) { ++ return PR_FALSE; ++ } ++ } + +- gint argc; +- gchar **argv; +- +- if (g_shell_parse_argv(handler.get(), &argc, &argv, NULL) && argc > 0) { +- handler.Assign(argv[0]); +- g_strfreev(argv); +- } else ++ if (giovfs) { ++ handler.Truncate(); ++ nsCOMPtr app; ++ rv = giovfs->GetAppForURIScheme(nsDependentCString(aProtocols[i]), ++ getter_AddRefs(app)); ++ if (NS_FAILED(rv) || !app) { + return PR_FALSE; +- +- if (!KeyMatchesAppName(handler.get()) || !enabled) +- return PR_FALSE; // the handler is disabled or set to another app ++ } ++ rv = app->GetCommand(handler); ++ if (NS_SUCCEEDED(rv) && !CheckHandlerMatchesAppName(handler)) { ++ return PR_FALSE; ++ } + } + } + + return PR_TRUE; + } + + nsresult + nsMailGNOMEIntegration::MakeDefault(const char* const *aProtocols, + unsigned int aLength) + { + nsCAutoString appKeyValue; + nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); ++ nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + if(mAppIsInPath) { + // mAppPath is in the users path, so use only the basename as the launcher + gchar *tmp = g_path_get_basename(mAppPath.get()); + appKeyValue = tmp; + g_free(tmp); + } else { + appKeyValue = mAppPath; + } + + appKeyValue.AppendLiteral(" %s"); + +- for (unsigned int i = 0; i < aLength; ++i) { +- nsresult rv = gconf->SetAppForProtocol(nsDependentCString(aProtocols[i]), +- appKeyValue); ++ nsresult rv; ++ if (gconf) { ++ for (unsigned int i = 0; i < aLength; ++i) { ++ rv = gconf->SetAppForProtocol(nsDependentCString(aProtocols[i]), ++ appKeyValue); ++ NS_ENSURE_SUCCESS(rv, rv); ++ } ++ } ++ ++ if (giovfs) { ++ nsCOMPtr bundleService = ++ do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); ++ ++ nsCOMPtr brandBundle; ++ rv = bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle)); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ nsString brandShortName; ++ brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(), ++ getter_Copies(brandShortName)); ++ ++ // use brandShortName as the application id. ++ NS_ConvertUTF16toUTF8 id(brandShortName); ++ ++ nsCOMPtr app; ++ rv = giovfs->CreateAppFromCommand(mAppPath, id, getter_AddRefs(app)); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ for (unsigned int i = 0; i < aLength; ++i) { ++ rv = app->SetAsDefaultForURIScheme(nsDependentCString(aProtocols[i])); ++ NS_ENSURE_SUCCESS(rv, rv); ++ } + } + + return NS_OK; + } +diff --git a/mail/components/shell/nsMailGNOMEIntegration.h b/mail/components/shell/nsMailGNOMEIntegration.h +--- a/mail/components/shell/nsMailGNOMEIntegration.h ++++ b/mail/components/shell/nsMailGNOMEIntegration.h +@@ -37,16 +37,18 @@ + * ***** END LICENSE BLOCK ***** */ + + #ifndef nsMailGNOMEIntegration_h_ + #define nsMailGNOMEIntegration_h_ + + #include "nsIShellService.h" + #include "nsStringGlue.h" + ++#define BRAND_PROPERTIES "chrome://branding/locale/brand.properties" ++ + #define NS_MAILGNOMEINTEGRATION_CID \ + {0xbddef0f4, 0x5e2d, 0x4846, {0xbd, 0xec, 0x86, 0xd0, 0x78, 0x1d, 0x8d, 0xed}} + + class nsMailGNOMEIntegration : public nsIShellService + { + public: + NS_DECL_ISUPPORTS + NS_DECL_NSISHELLSERVICE +@@ -57,15 +59,16 @@ public: + protected: + virtual ~nsMailGNOMEIntegration() {}; + + PRBool KeyMatchesAppName(const char *aKeyValue) const; + PRBool checkDefault(const char* const *aProtocols, unsigned int aLength); + nsresult MakeDefault(const char* const *aProtocols, unsigned int aLength); + private: + PRBool GetAppPathFromLauncher(); ++ PRBool CheckHandlerMatchesAppName(const nsACString& handler) const; + PRPackedBool mUseLocaleFilenames; + PRPackedBool mCheckedThisSession; + nsCString mAppPath; + PRPackedBool mAppIsInPath; + }; + + #endif diff --git a/thunderbird-shared-nss-db.patch b/thunderbird-shared-nss-db.patch index 7cd6077..b7dc3b0 100644 --- a/thunderbird-shared-nss-db.patch +++ b/thunderbird-shared-nss-db.patch @@ -7,7 +7,7 @@ References: diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in -@@ -470,16 +470,20 @@ MOZ_PANGO_LIBS = @MOZ_PANGO_LIB +@@ -459,16 +459,20 @@ MOZ_PANGO_LIBS = @MOZ_PANGO_LIB XT_LIBS = @XT_LIBS@ MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@ @@ -25,19 +25,19 @@ diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@ COMPILER_DEPEND = @COMPILER_DEPEND@ MDDEPDIR := @MDDEPDIR@ - - MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@ + CC_WRAPPER = @CC_WRAPPER@ + CXX_WRAPPER = @CXX_WRAPPER@ diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in -@@ -6999,16 +6999,31 @@ AC_SUBST(QCMS_LIBS) +@@ -6796,16 +6796,31 @@ AC_SUBST(QCMS_LIBS) dnl ======================================================== - dnl OTS + dnl HarfBuzz dnl ======================================================== - MOZ_OTS_LIBS='$(DEPTH)/mozilla/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)' - AC_SUBST(MOZ_OTS_LIBS) + MOZ_HARFBUZZ_LIBS='$(DEPTH)/mozilla/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)' + AC_SUBST(MOZ_HARFBUZZ_LIBS) dnl ======================================================== +dnl Check for nss-shared-helper @@ -66,21 +66,21 @@ diff --git a/configure.in b/configure.in diff --git a/mail/app/Makefile.in b/mail/app/Makefile.in --- a/mail/app/Makefile.in +++ b/mail/app/Makefile.in -@@ -127,16 +127,17 @@ APP_XPCOM_LIBS = $(XPCOM_LIBS) +@@ -124,16 +124,17 @@ MOZILLA_INTERNAL_API = 1 + APP_XPCOM_LIBS = $(XPCOM_LIBS) endif LIBS += \ $(STATIC_COMPONENTS_LINKER_PATH) \ - $(MOZ_JS_LIBS) \ $(EXTRA_DSO_LIBS) \ $(APP_XPCOM_LIBS) \ $(NSPR_LIBS) \ + $(NSSHELPER_LIBS) \ + $(NULL) + + ifdef BUILD_STATIC_LIBS + LIBS += \ + $(MOZ_JS_LIBS) \ $(TK_LIBS) \ $(NULL) - # Add explicit X11 dependency when building against X11 toolkits - ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT))) - LIBS += $(XLDFLAGS) $(XLIBS) - endif -