diff --git a/MozillaThunderbird.changes b/MozillaThunderbird.changes index 1184ef1..cd68fa3 100644 --- a/MozillaThunderbird.changes +++ b/MozillaThunderbird.changes @@ -1,3 +1,57 @@ +------------------------------------------------------------------- +Fri Sep 25 06:25:54 UTC 2020 - Wolfgang Rosenauer + +- Mozilla Thunderbird 78.3.1 + * fix crash in nsImapProtocol::CreateNewLineFromSocket (bmo#1667120) + +------------------------------------------------------------------- +Wed Sep 23 21:04:45 UTC 2020 - Wolfgang Rosenauer + +- Mozilla Thunderbird 78.3.0 + MFSA 2020-44 (bsc#1176756) + * CVE-2020-15677 (bmo#1641487) + Download origin spoofing via redirect + * CVE-2020-15676 (bmo#1646140) + XSS when pasting attacker-controlled data into a + contenteditable element + * CVE-2020-15678 (bmo#1660211) + When recursing through layers while scrolling, an iterator + may have become invalid, resulting in a potential use-after- + free scenario + * CVE-2020-15673 (bmo#1648493, bmo#1660800) + Memory safety bugs fixed in Thunderbird 78.3 +- requires NSPR >= 4.25.1 +- removed obsolete thunderbird-bmo1664607.patch + +------------------------------------------------------------------- +Sun Sep 13 20:10:39 UTC 2020 - Wolfgang Rosenauer + +- Mozilla Thunderbird 78.2.2 + https://www.thunderbird.net/en-US/thunderbird/78.2.2/releasenotes +- added thunderbird-bmo1664607.patch required for builds w/o updater + (boo#1176384) + +------------------------------------------------------------------- +Mon Aug 31 12:08:25 UTC 2020 - Wolfgang Rosenauer + +- Mozilla Thunderbird 78.2.1 + * based on Mozilla's 78 ESR codebase + * many new and changed features + https://www.thunderbird.net/en-US/thunderbird/78.0/releasenotes/#whatsnew + * built-in OpenPGP support (enigmail neither required nor supported) +- added platform patches: + * mozilla-s390x-skia-gradient.patch + * mozilla-pipewire-0-3.patch + * mozilla-bmo1512162.patch + * mozilla-bmo1626236.patch + * mozilla-bmo998749.patch + * mozilla-sandbox-fips.patch +- removed obsolete platform patches + * mozilla-s390-bigendian.patch + * mozilla-nestegg-big-endian.patch + * mozilla-openaes-decl.patch + * mozilla-cubeb-noreturn.patch + ------------------------------------------------------------------- Sun Aug 30 11:05:01 UTC 2020 - Wolfgang Rosenauer diff --git a/MozillaThunderbird.spec b/MozillaThunderbird.spec index 1702c68..ef25c59 100644 --- a/MozillaThunderbird.spec +++ b/MozillaThunderbird.spec @@ -25,14 +25,19 @@ # orig_suffix b3 # major 69 # mainver %major.99 -%define major 68 -%define mainver %major.12.0 -%define orig_version 68.12.0 -%define orig_suffix %{nil} -%define update_channel release -%define source_prefix thunderbird-%{mainver} +%define major 78 +%define mainver %major.3.1 +%define orig_version 78.3.1 +%define orig_suffix %{nil} +%define update_channel release +%define source_prefix thunderbird-%{orig_version} -# always build with GCC as SUSE Security Team requires that +%if 0%{?suse_version} > 1500 +# PGO builds do not work in TW currently (bmo#1642410) +%define do_profiling 0 +%endif + +# upstream default is clang (to use gcc for large parts set to 0) %define clang_build 0 # PIE, full relro @@ -47,6 +52,7 @@ # general build definitions %define progname thunderbird %define pkgname MozillaThunderbird +%define srcname thunderbird %define appname Thunderbird %define progdir %{_prefix}/%_lib/%{progname} %define gnome_dir %{_prefix} @@ -55,8 +61,13 @@ %define __requires_exclude ^(libmoz.*|liblgpllibs.*|libxul.*|libldap.*|libldif.*|libprldap.*)$ %define localize 1 %define crashreporter 0 - -%define has_system_cairo 0 +%if 0%{?sle_version} > 150100 +# pipewire is too old on Leap <=15.1 +# Activate only on everything newer +%define with_pipewire0_3 1 +%else +%define with_pipewire0_3 0 +%endif Name: %{pkgname} BuildRequires: Mesa-devel @@ -64,55 +75,63 @@ BuildRequires: alsa-devel BuildRequires: autoconf213 BuildRequires: dbus-1-glib-devel BuildRequires: fdupes +BuildRequires: memory-constraints %if 0%{?suse_version} <= 1320 -BuildRequires: gcc7-c++ +BuildRequires: gcc9-c++ %else BuildRequires: gcc-c++ %endif -BuildRequires: cargo >= 1.34 -#BuildRequires: hunspell-devel +BuildRequires: cargo >= 1.41 +BuildRequires: ccache BuildRequires: libXcomposite-devel BuildRequires: libcurl-devel BuildRequires: libidl-devel -BuildRequires: libnotify-devel -BuildRequires: memory-constraints -BuildRequires: mozilla-nspr-devel >= 4.21 -BuildRequires: mozilla-nss-devel >= 3.44.4 -BuildRequires: nasm >= 2.13 -BuildRequires: nodejs10 >= 10.19.0 +BuildRequires: mozilla-nspr-devel >= 4.25.1 +BuildRequires: mozilla-nss-devel >= 3.53.1 +BuildRequires: nasm >= 2.14 +BuildRequires: nodejs10 >= 10.21.0 BuildRequires: python-devel +%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000 +BuildRequires: python-libxml2 +BuildRequires: python36 +%else BuildRequires: python2-xml BuildRequires: python3 >= 3.5 -BuildRequires: rust >= 1.34 -BuildRequires: rust-cbindgen >= 0.8.7 -BuildRequires: startup-notification-devel +%endif +BuildRequires: rust >= 1.41 +BuildRequires: rust-cbindgen >= 0.14.1 BuildRequires: unzip BuildRequires: update-desktop-files BuildRequires: xorg-x11-libXt-devel +%if 0%{?do_profiling} +BuildRequires: xvfb-run +%endif BuildRequires: xz BuildRequires: yasm BuildRequires: zip %if 0%{?suse_version} < 1550 BuildRequires: pkgconfig(gconf-2.0) >= 1.2.1 %endif +%if (0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000) +BuildRequires: clang6-devel +%else +BuildRequires: clang-devel >= 5 +%endif BuildRequires: pkgconfig(gdk-x11-2.0) BuildRequires: pkgconfig(glib-2.0) >= 2.22 BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(gtk+-2.0) >= 2.18.0 -BuildRequires: pkgconfig(gtk+-3.0) >= 3.4.0 +BuildRequires: pkgconfig(gtk+-3.0) >= 3.14.0 BuildRequires: pkgconfig(gtk+-unix-print-2.0) BuildRequires: pkgconfig(gtk+-unix-print-3.0) BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(libpulse) +%if %{with_pipewire0_3} +BuildRequires: pkgconfig(libpipewire-0.3) +%endif %if %{with mozilla_tb_valgrind} BuildRequires: pkgconfig(valgrind) %endif -%if 0%{?suse_version} > 1320 -BuildRequires: llvm-clang-devel >= 3.9.0 -%else -# this covers the workaround to compile on Leap 42 in OBS -BuildRequires: clang4-devel -%endif # libavcodec is required for H.264 support but the # openSUSE version is currently not able to play H.264 # therefore the Packman version is required @@ -136,55 +155,57 @@ License: MPL-2.0 Group: Productivity/Networking/Email/Clients URL: https://www.thunderbird.net/ %if !%{with only_print_mozconfig} -Source: http://ftp.mozilla.org/pub/%{progname}/releases/%{orig_version}%{orig_suffix}/source/%{progname}-%{orig_version}%{orig_suffix}.source.tar.xz +Source: http://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz Source1: thunderbird.desktop Source2: thunderbird-rpmlintrc Source3: mozilla.sh.in Source4: tar_stamps Source6: suse-default-prefs.js -Source7: l10n-%{version}.tar.xz +Source7: l10n-%{orig_version}%{orig_suffix}.tar.xz Source9: thunderbird.appdata.xml +Source13: spellcheck.js Source14: https://github.com/openSUSE/firefox-scripts/raw/5e54f4a/create-tar.sh -Source20: https://ftp.mozilla.org/pub/%{progname}/releases/%{orig_version}%{orig_suffix}/source/%{progname}-%{orig_version}%{orig_suffix}.source.tar.xz.asc -Source21: https://ftp.mozilla.org/pub/%{progname}/releases/%{orig_version}/KEY#/mozilla.keyring +Source20: https://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz.asc +Source21: https://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/KEY#/mozilla.keyring # Gecko/Toolkit Patch1: mozilla-nongnome-proxies.patch Patch2: mozilla-kde.patch Patch3: mozilla-ntlm-full-path.patch -Patch4: mozilla-openaes-decl.patch -Patch5: mozilla-aarch64-startup-crash.patch -Patch6: mozilla-bmo1463035.patch -Patch7: mozilla-cubeb-noreturn.patch -Patch8: mozilla-fix-aarch64-libopus.patch -Patch9: mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch -Patch10: mozilla-s390-context.patch -Patch11: mozilla-s390-bigendian.patch -Patch12: mozilla-reduce-rust-debuginfo.patch -Patch13: mozilla-ppc-altivec_static_inline.patch -Patch14: mozilla-bmo1005535.patch -Patch15: mozilla-bmo1568145.patch -Patch16: mozilla-bmo849632.patch -Patch17: mozilla-bmo1504834-part1.patch -Patch18: mozilla-bmo1504834-part2.patch -Patch19: mozilla-bmo1504834-part3.patch -Patch20: mozilla-bmo1602730.patch -Patch21: mozilla-bmo1554971.patch -Patch22: mozilla-nestegg-big-endian.patch -Patch24: mozilla-fix-top-level-asm.patch -Patch25: mozilla-bmo1504834-part4.patch +Patch4: mozilla-aarch64-startup-crash.patch +Patch5: mozilla-bmo1463035.patch +Patch6: mozilla-sandbox-fips.patch +Patch7: mozilla-fix-aarch64-libopus.patch +Patch8: mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch +Patch9: mozilla-s390-context.patch +Patch11: mozilla-reduce-rust-debuginfo.patch +Patch12: mozilla-ppc-altivec_static_inline.patch +Patch13: mozilla-bmo1005535.patch +Patch14: mozilla-bmo1568145.patch +Patch15: mozilla-bmo1504834-part1.patch +Patch16: mozilla-bmo1504834-part2.patch +Patch17: mozilla-bmo1504834-part3.patch +Patch18: mozilla-bmo1554971.patch +Patch19: mozilla-bmo1512162.patch +Patch20: mozilla-fix-top-level-asm.patch +Patch21: mozilla-bmo1504834-part4.patch +Patch22: mozilla-bmo849632.patch +Patch23: mozilla-pipewire-0-3.patch +Patch24: mozilla-bmo1602730.patch +Patch25: mozilla-bmo998749.patch +Patch26: mozilla-bmo1626236.patch +Patch27: mozilla-s390x-skia-gradient.patch %endif # only_print_mozconfig BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: coreutils fileutils textutils /bin/sh -Recommends: libcanberra0 -Recommends: libpulse0 -### build options -%define has_system_cairo 0 ### build options end Requires: mozilla-nspr >= %(rpm -q --queryformat '%%{VERSION}' mozilla-nspr) Requires: mozilla-nss >= %(rpm -q --queryformat '%%{VERSION}' mozilla-nss) +Recommends: libcanberra0 +Recommends: libpulse0 Requires(post): desktop-file-utils Requires(postun): desktop-file-utils %define libgssapi libgssapi_krb5.so.2 +ExcludeArch: armv6l armv6hl %description Thunderbird is a free, open-source, cross-platform application for @@ -207,7 +228,7 @@ of %{appname}. %package translations-other Summary: Extra translations for %{appname} Group: System/Localization -Provides: locale(%{name}:ast;be;bg;br;cak;cy;dsb;et;eu;fy_NL;ga_IE;gd;gl;he;hr;hsb;hy_AM;id;is;ka;kab;kk;lt;ms;nn_NO;rm;ro;si;sk;sl;sq;sr;tr;uk;uz;vi) +Provides: locale(%{name}:ach;af;an;ast;az;be;bg;bn;br;bs;cak;cy;dsb;en_CA;eo;es_MX;et;eu;fa;ff;fy_NL;ga_IE;gd;gl;gn;gu_IN;he;hi_IN;hr;hsb;hy_AM;ia;id;is;ka;kab;kk;km;kn;lij;lt;lv;mk;mr;ms;my;ne_NP;nn_NO;oc;pa_IN;rm;ro;si;sk;sl;son;sq;sr;ta;te;th;tr;uk;ur;uz;vi;xh) Requires: %{name} = %{version} Obsoletes: %{name}-translations < %{version}-%{release} @@ -237,9 +258,10 @@ if (( $(stat -Lc%s "%{SOURCE7}") < MINSIZE)); then echo "Translations tarball %{SOURCE7} not generated properly." exit 1 fi -%setup -q -n %{source_prefix} -b 7 + +%setup -q -n %{srcname}-%{orig_version} -b 7 %else -%setup -q -n %{source_prefix} +%setup -q -n %{srcname}-%{orig_version} %endif %patch1 -p1 %if %{with mozilla_tb_kde4} @@ -252,10 +274,7 @@ fi %patch7 -p1 %patch8 -p1 %patch9 -p1 -%patch10 -p1 -%ifarch s390x ppc64 %patch11 -p1 -%endif %patch12 -p1 %patch13 -p1 %patch14 -p1 @@ -267,18 +286,30 @@ fi %patch20 -p1 %patch21 -p1 %patch22 -p1 +%if %{with_pipewire0_3} +%patch23 -p1 +%endif %patch24 -p1 %patch25 -p1 +%patch26 -p1 +%patch27 -p1 %endif # only_print_mozconfig %build %if !%{with only_print_mozconfig} -%define _lto_cflags %{nil} # 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" {} + + +# SLE-12 provides python36, but that package does not provide a python3 binary +%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000 +sed -i "s/python3/python36/g" configure.in +sed -i "s/python3/python36/g" mach +export PYTHON3=/usr/bin/python36 +%endif + # %if %{with mozilla_tb_kde4} kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3) @@ -291,13 +322,17 @@ fi source %{SOURCE4} -export SUSE_ASNEEDED=0 +export CARGO_HOME=${RPM_BUILD_DIR}/%{srcname}-%{orig_version}/.cargo +export MOZ_SOURCE_CHANGESET=$RELEASE_TAG +export SOURCE_REPO=$RELEASE_REPO +export source_repo=$RELEASE_REPO +export MOZ_SOURCE_REPO=$RELEASE_REPO export MOZ_BUILD_DATE=$RELEASE_TIMESTAMP export MOZILLA_OFFICIAL=1 export BUILD_OFFICIAL=1 export MOZ_TELEMETRY_REPORTING=1 %if 0%{?suse_version} <= 1320 -export CC=gcc-7 +export CC=gcc-9 %else %if 0%{?clang_build} == 0 export CC=gcc @@ -322,37 +357,42 @@ export MOZCONFIG=$RPM_BUILD_DIR/mozconfig echo "export CC=$CC" echo "export CXX=$CXX" echo "export CFLAGS=\"$CFLAGS\"" +echo "export CXXFLAGS=\"$CXXFLAGS\"" echo "export LDFLAGS=\"$LDFLAGS\"" echo "export RUSTFLAGS=\"$RUSTFLAGS\"" +echo "export CARGO_HOME=\"$CARGO_HOME\"" +echo "export PATH=\"$PATH\"" +echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" +echo "export PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" +echo "export MOZCONFIG=\"$MOZCONFIG\"" +echo "export MOZILLA_OFFICIAL=1" +echo "export BUILD_OFFICIAL=1" +echo "export MOZ_TELEMETRY_REPORTING=1" echo "" cat << EOF %else +%ifarch ppc64 ppc64le +%limit_build -m 2500 +%else %limit_build -m 2000 +%endif +# TODO: Check if this can be removed export MOZ_DEBUG_FLAGS="-pipe" cat << EOF > $MOZCONFIG %endif mk_add_options MOZILLA_OFFICIAL=1 mk_add_options BUILD_OFFICIAL=1 -mk_add_options MOZ_MILESTONE_RELEASE=1 -%if 0%{?suse_version} > 1320 -%ifarch i586 -mk_add_options MOZ_MAKE_FLAGS=-j1 -%else mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs} -%endif -%endif mk_add_options MOZ_OBJDIR=$RPM_BUILD_DIR/obj ac_add_options --prefix=%{_prefix} -ac_add_options --libdir=%{progdir} +ac_add_options --libdir=%{_libdir} ac_add_options --includedir=%{_includedir} ac_add_options --enable-application=comm/mail -ac_add_options --enable-calendar -ac_add_options --disable-tests -ac_add_options --disable-debug -ac_add_options --enable-alsa +ac_add_options --enable-release +%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000 ac_add_options --enable-default-toolkit=cairo-gtk3 -%if 0%{?suse_version} >= 1550 -ac_add_options --disable-gconf +%else +ac_add_options --enable-default-toolkit=cairo-gtk3-wayland %endif # bmo#1441155 - Disable the generation of Rust debug symbols on Linux32 %ifarch %ix86 %arm @@ -360,27 +400,27 @@ ac_add_options --disable-debug-symbols %else ac_add_options --enable-debug-symbols %endif -%if 0%{?suse_version} > 1549 +# building with elf-hack started to fail everywhere with FF73 +#%if 0%{?suse_version} > 1549 %ifnarch aarch64 ppc64 ppc64le s390x ac_add_options --disable-elf-hack %endif -%endif +#%endif ac_add_options --with-system-nspr ac_add_options --with-system-nss -ac_add_options --with-system-zlib -%if 0%{?localize} +ac_add_options --with-ccache +%if %{localize} ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n %endif +ac_add_options --with-system-zlib ac_add_options --disable-updater -#ac_add_options --with-system-png # no apng support -#ac_add_options --enable-system-hunspell -ac_add_options --enable-startup-notification +ac_add_options --disable-tests +ac_add_options --enable-alsa +ac_add_options --disable-debug ac_add_options --disable-necko-wifi ac_add_options --enable-update-channel=%{update_channel} -%if %has_system_cairo -ac_add_options --enable-system-cairo -%endif ac_add_options --with-unsigned-addon-scopes=app +ac_add_options --allow-addon-sideload ac_add_options --enable-official-branding %if ! %crashreporter ac_add_options --disable-crashreporter @@ -402,12 +442,15 @@ ac_add_options --enable-optimize="-O1" # LTO needs newer toolchain stack only (at least GCC 8.2.1 (r268506) %if 0%{?suse_version} > 1500 ac_add_options --enable-lto +%if 0%{?do_profiling} +ac_add_options MOZ_PGO=1 %endif %endif %if %{with mozilla_tb_valgrind} ac_add_options --disable-jemalloc ac_add_options --enable-valgrind %endif +%endif EOF %if !%{with only_print_mozconfig} %ifarch ppc64 s390x s390 @@ -420,7 +463,11 @@ echo "Generate big endian version of config/external/icu/data/icud58l.dat" ls -l config/external/icu/data rm -f config/external/icu/data/icudt*l.dat %endif -./mach build +ccache -s +%if 0%{?do_profiling} +xvfb-run --server-args="-screen 0 1920x1080x24" \ +%endif +./mach build -v # build additional locales %if %localize @@ -448,48 +495,32 @@ sed -r '/^(ja-JP-mac|en-US|$)/d;s/ .*$//' $RPM_BUILD_DIR/%{source_prefix}/comm/m %install cd $RPM_BUILD_DIR/obj +source %{SOURCE4} +export MOZ_SOURCE_STAMP=$RELEASE_TAG +export MOZ_SOURCE_REPO=$RELEASE_REPO make -C comm/mail/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0 # copy tree into RPM_BUILD_ROOT mkdir -p %{buildroot}%{progdir} cp -rf $RPM_BUILD_DIR/obj/dist/%{progname}/* %{buildroot}%{progdir} -%if %localize -# repack the lightning xpi with all available locales (boo#939153) (lp#545778) -_extid="{e2fda1a4-762b-4020-b5ad-a41df1933103}" -rm -rf _lightning -mkdir -p _lightning -unzip -q -d _lightning "%{buildroot}%{progdir}/distribution/extensions/${_extid}.xpi" -_langpacks=$(cd "%{buildroot}%{progdir}/extensions/" && find langpack-* -type d -prune -print|cut -d'-' -f2-|cut -d'@' -f1) -for _loc in $_langpacks ; do - _dir="%{buildroot}%{progdir}/extensions/langpack-${_loc}@thunderbird.mozilla.org" - _dir="${_dir}/distribution/extensions/${_extid}" - test -d "_lightning/chrome/calendar-${_loc}" && continue - test -d "_lightning/chrome/lightning-${_loc}" && continue - test -f "${_dir}/chrome.manifest" || continue - cp -rL "${_dir}"/chrome/{calendar,lightning}-"${_loc}" _lightning/chrome/ - cat "${_dir}/chrome.manifest" >> _lightning/chrome.manifest -done -(cd _lightning && zip -q9r ../"${_extid}.xpi" *) -cp -p "${_extid}.xpi" %{buildroot}%{progdir}/distribution/extensions/ -%endif # remove some executable permissions -find %{buildroot}%{_libdir}/%{progname} \ - -name "*.js" -o \ - -name "*.jsm" -o \ - -name "*.rdf" -o \ - -name "*.properties" -o \ - -name "*.dtd" -o \ - -name "*.txt" -o \ - -name "*.xml" -o \ - -name "*.css" \ - -exec chmod a-x {} + +find %{buildroot}%{progdir} \ + -name "*.js" -o \ + -name "*.jsm" -o \ + -name "*.rdf" -o \ + -name "*.properties" -o \ + -name "*.dtd" -o \ + -name "*.txt" -o \ + -name "*.xml" -o \ + -name "*.css" \ + -exec chmod a-x {} + # remove mkdir.done files from installed base find %{buildroot}%{progdir} -type f -name ".mkdir.done" -delete # overwrite the mozilla start-script and link it to /usr/bin mkdir --parents %{buildroot}%{_bindir}/ sed "s:%%PREFIX:%{_prefix}:g s:%%PROGDIR:%{progdir}:g -s:%%APPNAME:thunderbird:g +s:%%APPNAME:%{progname}:g s:%%PROFILE:.thunderbird:g" \ %{SOURCE3} > %{buildroot}%{progdir}/%{progname}.sh chmod 755 %{buildroot}%{progdir}/%{progname}.sh @@ -570,8 +601,6 @@ exit 0 %attr(755,root,root) %{progdir}/%{progname}.sh %dir %{progdir} %{progdir}/application.ini -%{progdir}/blocklist.xml -%{progdir}/chrome.manifest %{progdir}/dependentlibs.list %{progdir}/fonts/ %dir %{progdir}/gtk2 @@ -591,7 +620,6 @@ exit 0 %endif %dir %{progdir}/chrome/ %{progdir}/chrome/icons/ -%{progdir}/distribution/ %{progdir}/defaults/ %{progdir}/features/ %{progdir}/isp/ diff --git a/l10n-68.12.0.tar.xz b/l10n-68.12.0.tar.xz deleted file mode 100644 index 2565268..0000000 --- a/l10n-68.12.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79be90f1bf2999d090a0dc352f8262b09f291cb97885ed75ffcc9afc49b71bd8 -size 31323040 diff --git a/l10n-78.3.1.tar.xz b/l10n-78.3.1.tar.xz new file mode 100644 index 0000000..29c2a85 --- /dev/null +++ b/l10n-78.3.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46c46e19d52f44f7fbe31c91568f6fd408e3cd8ccf03fd697c143b3bc3b25824 +size 29052792 diff --git a/mozilla-bmo1005535.patch b/mozilla-bmo1005535.patch index ddfa2da..8731d8c 100644 --- a/mozilla-bmo1005535.patch +++ b/mozilla-bmo1005535.patch @@ -3,13 +3,13 @@ # Date 1558451540 -7200 # Tue May 21 17:12:20 2019 +0200 # Node ID 433beec63e6b5f409683af20a0c1ab137cc7bfad -# Parent 42c99b59a87b904063bad3193f10c51d068d2eac +# Parent 0b9b94a6526d4f1aa6e23b95c1f5f7c0bef841a7 Bug 1005535 - Get skia GPU building on big endian. -diff -r 42c99b59a87b -r 433beec63e6b gfx/skia/skia/include/private/GrColor.h ---- a/gfx/skia/skia/include/private/GrColor.h Wed Jun 05 08:48:08 2019 +0200 -+++ b/gfx/skia/skia/include/private/GrColor.h Tue May 21 17:12:20 2019 +0200 -@@ -63,7 +63,7 @@ +diff -r 0b9b94a6526d gfx/skia/skia/src/gpu/GrColor.h +--- a/gfx/skia/skia/src/gpu/GrColor.h Tue May 21 17:26:58 2019 +0200 ++++ b/gfx/skia/skia/src/gpu/GrColor.h Wed Jan 08 12:14:52 2020 +0100 +@@ -64,7 +64,7 @@ * Since premultiplied means that alpha >= color, we construct a color with * each component==255 and alpha == 0 to be "illegal" */ diff --git a/mozilla-bmo1463035.patch b/mozilla-bmo1463035.patch index ad785f3..4911c10 100644 --- a/mozilla-bmo1463035.patch +++ b/mozilla-bmo1463035.patch @@ -1,9 +1,9 @@ - # HG changeset patch # User Mike Hommey # Date 1526871862 -32400 -# Node ID 94f21505ff13cd089f7129cd24927cf8b31a0f43 -# Parent fc741a5ea37dbe145e0ca5f85e5dfb100f3c9091 +# Mon May 21 12:04:22 2018 +0900 +# Node ID 74a0c200d7f748a3fe46bb22a38625b074da8e26 +# Parent 0bf4a038a7129aa6bfd7bb27e7455ab649344ac5 Bug 1463035 - Remove MOZ_SIGNAL_TRAMPOLINE. r?darchons For some reason, GNU as is not happy with the assembly generated after @@ -12,39 +12,10 @@ bug 1238661 anymore on Debian armel. OTOH, as mentioned in bug 1238661 comment 4, we actually don't need this workaround anymore, so let's just kill it. -diff --git a/mfbt/moz.build b/mfbt/moz.build ---- a/mfbt/moz.build -+++ b/mfbt/moz.build -@@ -122,20 +122,16 @@ EXPORTS["double-conversion"] = [ - LOCAL_INCLUDES += [ - '/mfbt/double-conversion', - ] - - if CONFIG['OS_ARCH'] == 'WINNT': - EXPORTS.mozilla += [ - 'WindowsVersion.h', - ] --elif CONFIG['OS_ARCH'] == 'Linux': -- EXPORTS.mozilla += [ -- 'LinuxSignal.h', -- ] - - UNIFIED_SOURCES += [ - 'Assertions.cpp', - 'ChaosMode.cpp', - 'double-conversion/double-conversion/bignum-dtoa.cc', - 'double-conversion/double-conversion/bignum.cc', - 'double-conversion/double-conversion/cached-powers.cc', - 'double-conversion/double-conversion/diy-fp.cc', -diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/core/platform-linux-android.cpp ---- a/tools/profiler/core/platform-linux-android.cpp -+++ b/tools/profiler/core/platform-linux-android.cpp -@@ -55,17 +55,16 @@ - #ifdef __GLIBC__ - # include // backtrace, backtrace_symbols - #endif // def __GLIBC__ - #include // index - #include +diff -r 0bf4a038a712 -r 74a0c200d7f7 mozglue/baseprofiler/core/platform-linux-android.cpp +--- a/mozglue/baseprofiler/core/platform-linux-android.cpp Tue May 21 14:49:58 2019 +0200 ++++ b/mozglue/baseprofiler/core/platform-linux-android.cpp Mon May 21 12:04:22 2018 +0900 +@@ -60,7 +60,6 @@ #include #include "prenv.h" @@ -52,17 +23,7 @@ diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/cor #include "mozilla/PodOperations.h" #include "mozilla/DebugOnly.h" - #include - #include - - using namespace mozilla; - -@@ -248,17 +247,17 @@ Sampler::Sampler(PSLockRef aLock) - - // NOTE: We don't initialize LUL here, instead initializing it in - // SamplerThread's constructor. This is because with the - // profiler_suspend_and_sample_thread entry point, we want to be able to - // sample without waiting for LUL to be initialized. +@@ -271,7 +270,7 @@ // Request profiling signals. struct sigaction sa; @@ -71,8 +32,15 @@ diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/cor sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART | SA_SIGINFO; if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) { - MOZ_CRASH("Error installing SIGPROF handler in the profiler"); - } - } +diff -r 0bf4a038a712 -r 74a0c200d7f7 tools/profiler/core/platform-linux-android.cpp +--- a/tools/profiler/core/platform-linux-android.cpp Tue May 21 14:49:58 2019 +0200 ++++ b/tools/profiler/core/platform-linux-android.cpp Mon May 21 12:04:22 2018 +0900 +@@ -263,7 +263,7 @@ - void Sampler::Disable(PSLockRef aLock) { + // Request profiling signals. + struct sigaction sa; +- sa.sa_sigaction = MOZ_SIGNAL_TRAMPOLINE(SigprofHandler); ++ sa.sa_sigaction = SigprofHandler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART | SA_SIGINFO; + if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) { diff --git a/mozilla-bmo1504834-part1.patch b/mozilla-bmo1504834-part1.patch index 7990ff5..1faba92 100644 --- a/mozilla-bmo1504834-part1.patch +++ b/mozilla-bmo1504834-part1.patch @@ -1,11 +1,16 @@ # HG changeset patch -# Parent 051b75a600dfbf7503c3485cebfd34d4eb29be96 +# Parent 9db312f823881c04c5c16a7623df08cf6aef371d Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1504834 -diff -r 051b75a600df gfx/2d/DrawTargetSkia.cpp ---- a/gfx/2d/DrawTargetSkia.cpp Fri Jul 05 12:42:44 2019 +0200 -+++ b/gfx/2d/DrawTargetSkia.cpp Mon Jul 08 10:59:30 2019 +0200 -@@ -138,8 +138,7 @@ +diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp +--- a/gfx/2d/DrawTargetSkia.cpp ++++ b/gfx/2d/DrawTargetSkia.cpp +@@ -131,18 +131,17 @@ static IntRect CalculateSurfaceBounds(co + Rect sampledBounds = inverse.TransformBounds(*aBounds); + if (!sampledBounds.ToIntRect(&bounds)) { + return surfaceBounds; + } + return surfaceBounds.Intersect(bounds); } @@ -15,38 +20,68 @@ diff -r 051b75a600df gfx/2d/DrawTargetSkia.cpp static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, const int32_t aStride, SurfaceFormat aFormat) { -diff -r 051b75a600df gfx/2d/Types.h ---- a/gfx/2d/Types.h Fri Jul 05 12:42:44 2019 +0200 -+++ b/gfx/2d/Types.h Mon Jul 08 10:59:30 2019 +0200 -@@ -85,15 +85,8 @@ + if (aFormat != SurfaceFormat::B8G8R8X8 || aSize.IsEmpty()) { + return true; + } + // We should've initialized the data to be opaque already + // On debug builds, verify that this is actually true. +diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h +--- a/gfx/2d/Types.h ++++ b/gfx/2d/Types.h +@@ -82,25 +82,18 @@ enum class SurfaceFormat : int8_t { + Depth, + + // This represents the unknown format. + UNKNOWN, + // The following values are endian-independent synonyms. The _UINT32 suffix // indicates that the name reflects the layout when viewed as a uint32_t // value. --#if MOZ_LITTLE_ENDIAN +-#if MOZ_LITTLE_ENDIAN() A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB - X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB --#elif MOZ_BIG_ENDIAN + X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB +-#elif MOZ_BIG_ENDIAN() - A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB -- X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB +- X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB -#else -# error "bad endianness" -#endif - }; - static inline int BytesPerPixel(SurfaceFormat aFormat) { -diff -r 051b75a600df gfx/skia/skia/third_party/skcms/skcms.cc ---- a/gfx/skia/skia/third_party/skcms/skcms.cc Fri Jul 05 12:42:44 2019 +0200 -+++ b/gfx/skia/skia/third_party/skcms/skcms.cc Mon Jul 08 10:59:30 2019 +0200 -@@ -17,6 +17,8 @@ - #include - #elif defined(__SSE__) - #include + // The following values are OS and endian-independent synonyms. + // + // TODO(aosmond): When everything blocking bug 1581828 has been resolved, we + // can make this use R8B8G8A8 and R8B8G8X8 for non-Windows platforms. + OS_RGBA = A8R8G8B8_UINT32, + OS_RGBX = X8R8G8B8_UINT32 + }; +diff --git a/gfx/skia/skia/third_party/skcms/skcms.cc b/gfx/skia/skia/third_party/skcms/skcms.cc +--- a/gfx/skia/skia/third_party/skcms/skcms.cc ++++ b/gfx/skia/skia/third_party/skcms/skcms.cc +@@ -25,16 +25,18 @@ + // it'd be a lot slower. But we want all those headers included so we + // can use their features after runtime checks later. + #include + #include + #include + #include + #include + #endif +#else + #define SKCMS_PORTABLE #endif // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others. -@@ -124,20 +126,28 @@ + // We have better testing on 64-bit machines, so force 32-bit machines to behave like 64-bit. + // + // Please do not use sizeof() directly, and size_t only when required. + // (We have no way of enforcing these requests...) + #define SAFE_SIZEOF(x) ((uint64_t)sizeof(x)) +@@ -275,30 +277,38 @@ enum { + skcms_Signature_sf32 = 0x73663332, + // XYZ is also a PCS signature, so it's defined in skcms.h + // skcms_Signature_XYZ = 0x58595A20, + }; + static uint16_t read_big_u16(const uint8_t* ptr) { uint16_t be; memcpy(&be, ptr, sizeof(be)); @@ -79,3 +114,8 @@ diff -r 051b75a600df gfx/skia/skia/third_party/skcms/skcms.cc #endif } + static int32_t read_big_i32(const uint8_t* ptr) { + return (int32_t)read_big_u32(ptr); + } + + static float read_big_fixed(const uint8_t* ptr) { diff --git a/mozilla-bmo1504834-part2.patch b/mozilla-bmo1504834-part2.patch index aa6595a..9fe1b56 100644 --- a/mozilla-bmo1504834-part2.patch +++ b/mozilla-bmo1504834-part2.patch @@ -1,13 +1,13 @@ # HG changeset patch -# Parent 36563351309ddbc6c29559ba50a41d005f925abb +# Parent 0e579dcbf7328dda4512cbdafc9b42acec4935ea Skia does not support big endian. The places to fix are too numerous and upstream (skia, not Mozilla) has no interest in maintaining big endian. So here we try to swizzle the input for skia, so that skia always works on LE, and when it comes out again, we transform back to BE. -diff -r 36563351309d gfx/2d/ConvolutionFilter.cpp ---- a/gfx/2d/ConvolutionFilter.cpp Mon Sep 09 17:59:28 2019 +0200 -+++ b/gfx/2d/ConvolutionFilter.cpp Tue Sep 10 08:25:13 2019 +0200 +diff -r 0e579dcbf732 gfx/2d/ConvolutionFilter.cpp +--- a/gfx/2d/ConvolutionFilter.cpp Wed Jan 08 12:17:44 2020 +0100 ++++ b/gfx/2d/ConvolutionFilter.cpp Wed Jan 08 12:17:49 2020 +0100 @@ -35,9 +35,38 @@ return true; } @@ -23,7 +23,7 @@ diff -r 36563351309d gfx/2d/ConvolutionFilter.cpp + void ConvolutionFilter::ConvolveHorizontally(const uint8_t* aSrc, uint8_t* aDst, bool aHasAlpha) { -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + int outputSize = mFilter->numValues(); + + // Input size isn't handed in, so we have to calculate it quickly @@ -40,7 +40,7 @@ diff -r 36563351309d gfx/2d/ConvolutionFilter.cpp + SkOpts::convolve_horizontally(aSrc, *mFilter, aDst, aHasAlpha); + -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + ByteSwapArray((uint8_t*)aSrc, inputSize); + ByteSwapArray(aDst, outputSize); +#endif @@ -52,7 +52,7 @@ diff -r 36563351309d gfx/2d/ConvolutionFilter.cpp auto filterValues = mFilter->FilterForValue(aRowIndex, &filterOffset, &filterLength); + -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + for (int filterY = 0; filterY < filterLength; filterY++) { + // Skia only knows LE, so we have to swizzle the input + ByteSwapArray(aSrc[filterY], aRowSize); @@ -62,7 +62,7 @@ diff -r 36563351309d gfx/2d/ConvolutionFilter.cpp SkOpts::convolve_vertically(filterValues, filterLength, aSrc, aRowSize, aDst, aHasAlpha); + -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + // After skia is finished, we swizzle back to BE, in case + // the input is used again somewhere else + for (int filterY = 0; filterY < filterLength; filterY++) { @@ -74,9 +74,9 @@ diff -r 36563351309d gfx/2d/ConvolutionFilter.cpp } /* ConvolutionFilter::ComputeResizeFactor is derived from Skia's -diff -r 36563351309d gfx/skia/skia/include/core/SkPreConfig.h ---- a/gfx/skia/skia/include/core/SkPreConfig.h Mon Sep 09 17:59:28 2019 +0200 -+++ b/gfx/skia/skia/include/core/SkPreConfig.h Tue Sep 10 08:25:13 2019 +0200 +diff -r 0e579dcbf732 gfx/skia/skia/include/core/SkPreConfig.h +--- a/gfx/skia/skia/include/core/SkPreConfig.h Wed Jan 08 12:17:44 2020 +0100 ++++ b/gfx/skia/skia/include/core/SkPreConfig.h Wed Jan 08 12:17:49 2020 +0100 @@ -73,7 +73,7 @@ defined(__ppc__) || defined(__hppa) || \ defined(__PPC__) || defined(__PPC64__) || \ diff --git a/mozilla-bmo1504834-part4.patch b/mozilla-bmo1504834-part4.patch index be11964..6bc8c2b 100644 --- a/mozilla-bmo1504834-part4.patch +++ b/mozilla-bmo1504834-part4.patch @@ -17,7 +17,7 @@ diff -r 46ea866ca3ac -r 6ef20eee3f8f gfx/2d/DrawTargetSkia.cpp SkCanvas::kPreserveLCDText_SaveLayerFlag | (aCopyBackground ? SkCanvas::kInitWithPrevious_SaveLayerFlag : 0)); -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + // Pushing a layer where an aMask is defined produces wrong output. + // We _should_ endian swap the data, but I couldn't find a workable way to do so + // Therefore I deactivate those layers in the meantime. diff --git a/mozilla-bmo1512162.patch b/mozilla-bmo1512162.patch new file mode 100644 index 0000000..c5d18a7 --- /dev/null +++ b/mozilla-bmo1512162.patch @@ -0,0 +1,34 @@ +# HG changeset patch +# Parent e5858dc7ab007042436496f7cfb9a5abf10f5082 +This fixes a broken build for gcc < 9 on ppc64le. +This patch can be removed for newer gcc-versions. + +diff -r e5858dc7ab00 -r 5d3469aabe61 js/xpconnect/src/XPCWrappedNative.cpp +--- a/js/xpconnect/src/XPCWrappedNative.cpp Thu Nov 29 10:07:29 2018 +0100 ++++ b/js/xpconnect/src/XPCWrappedNative.cpp Tue Sep 10 12:42:13 2019 +0200 +@@ -1092,7 +1092,11 @@ + MOZ_ALWAYS_INLINE bool GetOutParamSource(uint8_t paramIndex, + MutableHandleValue srcp) const; + +- MOZ_ALWAYS_INLINE bool GatherAndConvertResults(); ++#if !(__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN) ++// Work around a compiler bug on ppc64le (bug 1512162). ++ MOZ_ALWAYS_INLINE ++#endif ++ bool GatherAndConvertResults(); + + MOZ_ALWAYS_INLINE bool QueryInterfaceFastPath(); + +@@ -1139,7 +1143,11 @@ + + ~CallMethodHelper(); + +- MOZ_ALWAYS_INLINE bool Call(); ++#if !(__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN) ++// Work around a compiler bug on ppc64le (bug 1512162). ++ MOZ_ALWAYS_INLINE ++#endif ++ bool Call(); + + // Trace implementation so we can put our CallMethodHelper in a Rooted. + void trace(JSTracer* aTrc); diff --git a/mozilla-bmo1602730.patch b/mozilla-bmo1602730.patch index b4eacd1..810047f 100644 --- a/mozilla-bmo1602730.patch +++ b/mozilla-bmo1602730.patch @@ -1,28 +1,25 @@ -diff -r 6ef20eee3f8f gfx/layers/basic/BasicCompositor.cpp ---- a/gfx/layers/basic/BasicCompositor.cpp Thu Oct 31 09:11:56 2019 +0100 -+++ b/gfx/layers/basic/BasicCompositor.cpp Wed Dec 11 16:16:09 2019 +0100 -@@ -693,9 +693,13 @@ - - RefPtr sourceMask; - Matrix maskTransform; -+ // Setting an alpha-mask here breaks the URL-bar on big endian (s390x) -+ // if the typed URL is too long for the textbox (automatic scrolling needed) -+#if MOZ_LITTLE_ENDIAN - if (aTransform.Is2D()) { - SetupMask(aEffectChain, dest, offset, sourceMask, maskTransform); - } -+#endif - - CompositionOp blendMode = CompositionOp::OP_OVER; - if (Effect* effect = -diff -r 6ef20eee3f8f gfx/layers/composite/CompositableHost.cpp ---- a/gfx/layers/composite/CompositableHost.cpp Thu Oct 31 09:11:56 2019 +0100 -+++ b/gfx/layers/composite/CompositableHost.cpp Wed Dec 11 16:16:09 2019 +0100 -@@ -91,6 +91,7 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1582805890 -3600 +# Thu Feb 27 13:18:10 2020 +0100 +# Node ID 457cbe5705f2a3759d3da36a05c0ed66ec61ea12 +# Parent 7440f4b6bab85068ca2f84e9c48e0706d04330e8 +imported patch mozilla-bmo1602730-FF73.patch + +diff -r 7440f4b6bab8 gfx/layers/composite/CompositableHost.cpp +--- a/gfx/layers/composite/CompositableHost.cpp Thu Feb 27 13:17:56 2020 +0100 ++++ b/gfx/layers/composite/CompositableHost.cpp Wed Jun 17 15:33:32 2020 +0200 +@@ -92,9 +92,13 @@ } MOZ_ASSERT(source); -+ // Alternatively: Comment out these lines where the alpha-mask is set ++ // Setting an alpha-mask here breaks the URL-bar on big endian (s390x) ++ // if the typed URL is too long for the textbox (automatic scrolling needed) ++#if MOZ_LITTLE_ENDIAN() RefPtr effect = new EffectMask(source, source->GetSize(), aTransform); aEffects.mSecondaryEffects[EffectTypes::MASK] = effect; ++#endif + return true; + } + diff --git a/mozilla-bmo1626236.patch b/mozilla-bmo1626236.patch new file mode 100644 index 0000000..9615c04 --- /dev/null +++ b/mozilla-bmo1626236.patch @@ -0,0 +1,85 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1582805876 -3600 +# Thu Feb 27 13:17:56 2020 +0100 +# Node ID cc3d09abea31068e57f1ab918782f9f86fc6a158 +# Parent 9cd90914846f667f18babc491a74c164ae5d6e9f +imported patch decoder_workaround.patch + +diff -r 9cd90914846f image/decoders/nsGIFDecoder2.cpp +--- a/image/decoders/nsGIFDecoder2.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsGIFDecoder2.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -422,6 +422,9 @@ + MOZ_ASSERT(mSwizzleFn); + uint8_t* data = reinterpret_cast(aColormap); + mSwizzleFn(data, data, aColors); ++#if MOZ_BIG_ENDIAN() ++ SwizzleRow(SurfaceFormat::A8R8G8B8, SurfaceFormat::B8G8R8A8)(data, data, aColors); ++#endif + } + + LexerResult nsGIFDecoder2::DoDecode(SourceBufferIterator& aIterator, +diff -r 9cd90914846f image/decoders/nsJPEGDecoder.cpp +--- a/image/decoders/nsJPEGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsJPEGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -263,6 +263,9 @@ + case JCS_YCbCr: + // By default, we will output directly to BGRA. If we need to apply + // special color transforms, this may change. ++#if MOZ_BIG_ENDIAN() ++ mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB; ++#else + switch (SurfaceFormat::OS_RGBX) { + case SurfaceFormat::B8G8R8X8: + mInfo.out_color_space = JCS_EXT_BGRX; +@@ -277,6 +280,7 @@ + mState = JPEG_ERROR; + return Transition::TerminateFailure(); + } ++#endif + break; + case JCS_CMYK: + case JCS_YCCK: +diff -r 9cd90914846f image/decoders/nsPNGDecoder.cpp +--- a/image/decoders/nsPNGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsPNGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -361,7 +361,7 @@ + IResumable* aOnResume) { + MOZ_ASSERT(!HasError(), "Shouldn't call DoDecode after error!"); + +- return mLexer.Lex(aIterator, aOnResume, ++ LexerResult res = mLexer.Lex(aIterator, aOnResume, + [=](State aState, const char* aData, size_t aLength) { + switch (aState) { + case State::PNG_DATA: +@@ -371,6 +371,14 @@ + } + MOZ_CRASH("Unknown State"); + }); ++ ++#if MOZ_BIG_ENDIAN() ++ if(res.is() && res.as() == TerminalState::SUCCESS) { ++ NativeEndian::swapToLittleEndianInPlace((uint32_t*)(mImageData), mImageDataLength / 4); ++ } ++#endif ++ ++ return res; + } + + LexerTransition nsPNGDecoder::ReadPNGData( +diff -r 9cd90914846f image/decoders/nsWebPDecoder.cpp +--- a/image/decoders/nsWebPDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsWebPDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -237,7 +237,12 @@ + // WebP doesn't guarantee that the alpha generated matches the hint in the + // header, so we always need to claim the input is BGRA. If the output is + // BGRX, swizzling will mask off the alpha channel. ++#if MOZ_BIG_ENDIAN() ++ mBuffer.colorspace = MODE_ARGB; ++ SurfaceFormat inFormat = mFormat; ++#else + SurfaceFormat inFormat = SurfaceFormat::OS_RGBA; ++#endif + + SurfacePipeFlags pipeFlags = SurfacePipeFlags(); + if (mFormat == SurfaceFormat::OS_RGBA && diff --git a/mozilla-bmo849632.patch b/mozilla-bmo849632.patch index f6dc2c7..76380b5 100644 --- a/mozilla-bmo849632.patch +++ b/mozilla-bmo849632.patch @@ -10,7 +10,7 @@ diff -r 6b017d3e9733 gfx/gl/GLContext.h BEFORE_GL_CALL; mSymbols.fReadPixels(x, y, width, height, format, type, pixels); OnSyncCall(); -+#if MOZ_BIG_ENDIAN ++#if MOZ_BIG_ENDIAN() + uint8_t* itr = (uint8_t*)pixels; + for (GLsizei i = 0; i < width * height; i++) { + NativeEndian::swapToLittleEndianInPlace((uint32_t*)itr, 1); diff --git a/mozilla-bmo998749.patch b/mozilla-bmo998749.patch new file mode 100644 index 0000000..91a6168 --- /dev/null +++ b/mozilla-bmo998749.patch @@ -0,0 +1,29 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1583738770 -3600 +# Mon Mar 09 08:26:10 2020 +0100 +# Node ID 34676feac1a542e409e22acf5b98735f8313b1ce +# Parent 506857dace0a08d1c9685e3ac264646590b3e27f +[mq]: mozilla-bmo998749.patch + +diff -r 506857dace0a -r 34676feac1a5 gfx/2d/FilterProcessing.h +--- a/gfx/2d/FilterProcessing.h Fri Feb 28 12:31:51 2020 +0100 ++++ b/gfx/2d/FilterProcessing.h Mon Mar 09 08:26:10 2020 +0100 +@@ -13,10 +13,17 @@ + namespace mozilla { + namespace gfx { + ++#if MOZ_BIG_ENDIAN() ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 3; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 2; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 1; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 0; ++#else + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 0; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 1; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 2; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 3; ++#endif + + class FilterProcessing { + public: diff --git a/mozilla-cubeb-noreturn.patch b/mozilla-cubeb-noreturn.patch deleted file mode 100644 index 7c02cd7..0000000 --- a/mozilla-cubeb-noreturn.patch +++ /dev/null @@ -1,18 +0,0 @@ -# HG changeset patch -# User Wolfgang Rosenauer -# Parent a9d61a2614b01b1e0ca37d00a6b11b2571868f86 - -diff --git a/media/libcubeb/src/cubeb_utils.cpp b/media/libcubeb/src/cubeb_utils.cpp ---- a/media/libcubeb/src/cubeb_utils.cpp -+++ b/media/libcubeb/src/cubeb_utils.cpp -@@ -15,9 +15,10 @@ size_t cubeb_sample_size(cubeb_sample_fo - return sizeof(int16_t); - case CUBEB_SAMPLE_FLOAT32LE: - case CUBEB_SAMPLE_FLOAT32BE: - return sizeof(float); - default: - // should never happen as all cases are handled above. - assert(false); - } -+ return 0; - } diff --git a/mozilla-kde.patch b/mozilla-kde.patch index bbbcb01..4223410 100644 --- a/mozilla-kde.patch +++ b/mozilla-kde.patch @@ -3,7 +3,7 @@ # Date 1559294891 -7200 # Fri May 31 11:28:11 2019 +0200 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112 -# Parent 93495ad6fa0fe292eadcbfef14e0e27273528497 +# Parent aa58e8c70d1448a08407c6c191ea8b76d61e8bf6 Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak @@ -13,8 +13,7 @@ Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp -@@ -81,16 +81,17 @@ - #include "nsXPCOMCID.h" +@@ -83,16 +83,17 @@ #include "nsXPCOM.h" #include "nsXULAppAPI.h" #include "nsZipArchive.h" @@ -22,16 +21,17 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp #include "PLDHashTable.h" #include "plstr.h" #include "prlink.h" + #include "xpcpublic.h" +#include "nsKDEUtils.h" + #ifdef DEBUG + # include + #endif + #ifdef MOZ_MEMORY # include "mozmemory.h" #endif - - #ifdef XP_WIN - # include "windows.h" - #endif -@@ -4507,25 +4508,37 @@ static nsresult pref_ReadDefaultPrefs(co +@@ -4566,25 +4567,37 @@ nsresult Preferences::InitInitialObjects // application pref files for backwards compatibility. static const char* specialFiles[] = { #if defined(XP_MACOSX) @@ -69,7 +69,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp // Load jar:$app/omni.jar!/defaults/preferences/*.js // or jar:$gre/omni.jar!/defaults/preferences/*.js. -@@ -4573,17 +4586,17 @@ static nsresult pref_ReadDefaultPrefs(co +@@ -4630,17 +4643,17 @@ nsresult Preferences::InitInitialObjects } nsCOMPtr path = do_QueryInterface(elem); @@ -87,13 +87,13 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp SetupTelemetryPref(); } - NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID, nullptr, + if (aIsStartup) { diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build --- a/modules/libpref/moz.build +++ b/modules/libpref/moz.build -@@ -31,16 +31,20 @@ EXPORTS.mozilla += [ - 'StaticPrefs.h', +@@ -114,16 +114,20 @@ EXPORTS.mozilla += [ ] + EXPORTS.mozilla += sorted(['!' + g for g in gen_h]) UNIFIED_SOURCES += [ 'Preferences.cpp', @@ -104,18 +104,18 @@ diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build + '/toolkit/xre' +] + - XPCOM_MANIFESTS += [ - 'components.conf', - ] + gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs) - include('/ipc/chromium/chromium-config.mozbuild') + GENERATED_FILES += [gen_all_tuple] - FINAL_LIBRARY = 'xul' + static_pref_list = GENERATED_FILES[gen_all_tuple] + static_pref_list.script = 'init/generate_static_pref_list.py:emit_code' + static_pref_list.inputs = ['init/StaticPrefList.yaml'] diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py --- a/python/mozbuild/mozpack/chrome/flags.py +++ b/python/mozbuild/mozpack/chrome/flags.py -@@ -223,16 +223,17 @@ class Flags(OrderedDict): +@@ -227,16 +227,17 @@ class Flags(OrderedDict): 'contentaccessible': Flag, 'os': StringFlag, 'osversion': VersionFlag, @@ -136,7 +136,7 @@ diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/c diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py --- a/python/mozbuild/mozpack/chrome/manifest.py +++ b/python/mozbuild/mozpack/chrome/manifest.py -@@ -39,16 +39,17 @@ class ManifestEntry(object): +@@ -37,16 +37,17 @@ class ManifestEntry(object): 'platformversion', 'os', 'osversion', @@ -157,7 +157,7 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpac diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build --- a/toolkit/components/downloads/moz.build +++ b/toolkit/components/downloads/moz.build -@@ -41,10 +41,14 @@ XPCOM_MANIFESTS += [ +@@ -46,10 +46,14 @@ XPCOM_MANIFESTS += [ if CONFIG['MOZ_PLACES']: EXTRA_JS_MODULES += [ @@ -172,536 +172,10 @@ diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloa + with Files('**'): BUG_COMPONENT = ('Toolkit', 'Downloads API') -diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn ---- a/toolkit/content/jar.mn -+++ b/toolkit/content/jar.mn -@@ -63,16 +63,18 @@ toolkit.jar: - content/global/widgets.css - content/global/bindings/autocomplete.xml (widgets/autocomplete.xml) - content/global/bindings/button.xml (widgets/button.xml) - content/global/bindings/calendar.js (widgets/calendar.js) - content/global/bindings/datekeeper.js (widgets/datekeeper.js) - content/global/bindings/datepicker.js (widgets/datepicker.js) - content/global/bindings/datetimebox.css (widgets/datetimebox.css) - * content/global/bindings/dialog.xml (widgets/dialog.xml) -+* content/global/bindings/dialog-kde.xml (widgets/dialog-kde.xml) -+% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde - content/global/bindings/general.xml (widgets/general.xml) - content/global/bindings/popup.xml (widgets/popup.xml) - content/global/bindings/richlistbox.xml (widgets/richlistbox.xml) - content/global/bindings/scrollbox.xml (widgets/scrollbox.xml) - content/global/bindings/spinner.js (widgets/spinner.js) - content/global/bindings/tabbox.xml (widgets/tabbox.xml) - * content/global/bindings/textbox.xml (widgets/textbox.xml) - content/global/bindings/timekeeper.js (widgets/timekeeper.js) -diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml -new file mode 100644 ---- /dev/null -+++ b/toolkit/content/widgets/dialog-kde.xml -@@ -0,0 +1,499 @@ -+ -+ -+ -+ -+ %globalKeysDTD; -+]> -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+#else -+ keycode="&openHelp.commandkey;"/> -+#endif -+ -+ -+ -+ -+ -+ null -+ (function(event) { -+ if (!document.documentElement.cancelDialog()) -+ event.preventDefault(); -+ }) -+ -+ -+ [] -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ (screen.availLeft + screen.availWidth)) -+ newX = (screen.availLeft + screen.availWidth) - window.outerWidth - 20; -+ -+ if (newY < screen.availTop) -+ newY = screen.availTop + 20; -+ if ((newY + window.outerHeight) > (screen.availTop + screen.availHeight)) -+ newY = (screen.availTop + screen.availHeight) - window.outerHeight - 60; -+ -+ window.moveTo( newX, newY ); -+ ]]> -+ -+ -+ -+ -+ -+ 0 ? xOffset : 0; -+ yOffset = yOffset > 0 ? yOffset : 0; -+ window.moveTo(xOffset, yOffset); -+ ]]> -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ { -+ window.sizeToContent(); -+ }); -+ } -+ ]]> -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ // see bug 63370 for details -+ this._mStrBundle = Cc["@mozilla.org/intl/stringbundle;1"] -+ .getService(Ci.nsIStringBundleService) -+ .createBundle("chrome://global/locale/dialog.properties"); -+ } -+ return this._mStrBundle; -+ ]]> -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ if (!event.defaultPrevented) -+ this.cancelDialog(); -+ -+#ifdef XP_MACOSX -+ -+#else -+ -+ var btn = this.getButton(this.defaultButton); -+ if (btn) -+ btn.setAttribute("default", event.originalTarget == btn || -+ !(event.originalTarget.localName == "button" || -+ event.originalTarget.localName == "toolbarbutton")); -+ -+#endif -+ -+ -+ -+ -+ diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm --- a/toolkit/mozapps/downloads/HelperAppDlg.jsm +++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm -@@ -1204,36 +1204,66 @@ nsUnknownContentTypeDialog.prototype = { +@@ -1203,36 +1203,66 @@ nsUnknownContentTypeDialog.prototype = { params.handlerApp && params.handlerApp.executable && params.handlerApp.executable.isFile() @@ -791,7 +265,7 @@ diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downlo diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp -@@ -14,16 +14,17 @@ +@@ -13,16 +13,17 @@ #include "nsPrintfCString.h" #include "nsNetCID.h" #include "nsNetUtil.h" @@ -809,7 +283,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy NS_DECL_ISUPPORTS NS_DECL_NSISYSTEMPROXYSETTINGS -@@ -37,16 +38,18 @@ class nsUnixSystemProxySettings final : +@@ -36,16 +37,18 @@ class nsUnixSystemProxySettings final : nsCOMPtr mProxySettings; nsInterfaceHashtable mSchemeProxySettings; @@ -828,7 +302,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { // dbus prevents us from being threadsafe, but this routine should not block // anyhow -@@ -382,21 +385,50 @@ nsresult nsUnixSystemProxySettings::GetP +@@ -384,21 +387,50 @@ nsresult nsUnixSystemProxySettings::GetP return NS_OK; } @@ -882,7 +356,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build -@@ -83,17 +83,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co +@@ -88,17 +88,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co '../components/printingui', ] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': @@ -890,7 +364,7 @@ diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build 'nsNativeAppSupportDefault.cpp', 'UIKitDirProvider.mm', ] - elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: + elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': + EXPORTS += ['nsKDEUtils.h'] UNIFIED_SOURCES += [ + 'nsKDEUtils.cpp', @@ -1307,7 +781,7 @@ new file mode 100644 diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp --- a/uriloader/exthandler/HandlerServiceParent.cpp +++ b/uriloader/exthandler/HandlerServiceParent.cpp -@@ -1,17 +1,17 @@ +@@ -7,17 +7,17 @@ #include "mozilla/ipc/ProtocolUtils.h" #include "mozilla/Logging.h" #include "HandlerServiceParent.h" @@ -1326,7 +800,7 @@ diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandle using mozilla::dom::RemoteHandlerApp; namespace { -@@ -282,17 +282,17 @@ mozilla::ipc::IPCResult HandlerServicePa +@@ -299,17 +299,17 @@ mozilla::ipc::IPCResult HandlerServicePa mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS( const nsCString& aProtocolScheme, bool* aHandlerExists) { if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) { @@ -1345,7 +819,7 @@ diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandle /* * Check if a handler exists for the provided protocol. Check the datastore -@@ -311,17 +311,17 @@ mozilla::ipc::IPCResult HandlerServicePa +@@ -328,17 +328,17 @@ mozilla::ipc::IPCResult HandlerServicePa nsCOMPtr protoSvc = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv); if (NS_WARN_IF(NS_FAILED(rv))) { @@ -1367,14 +841,14 @@ diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandle diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build --- a/uriloader/exthandler/moz.build +++ b/uriloader/exthandler/moz.build -@@ -83,17 +83,19 @@ else: +@@ -85,17 +85,19 @@ else: SOURCES += [ osdir + '/nsOSHelperAppService.cpp', ] if CONFIG['CC_TYPE'] in ('clang', 'gcc'): CXXFLAGS += ['-Wno-error=shadow'] - if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': UNIFIED_SOURCES += [ + 'unix/nsCommonRegistry.cpp', 'unix/nsGNOMERegistry.cpp', @@ -1387,7 +861,7 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build 'android/nsExternalURLHandlerService.cpp', 'android/nsMIMEInfoAndroid.cpp', ] -@@ -133,16 +135,17 @@ include('/ipc/chromium/chromium-config.m +@@ -135,16 +137,17 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' LOCAL_INCLUDES += [ @@ -1403,7 +877,7 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build CXXFLAGS += CONFIG['TK_CFLAGS'] CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS'] - if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3': + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp new file mode 100644 @@ -1500,7 +974,7 @@ diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/ new file mode 100644 --- /dev/null +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp -@@ -0,0 +1,87 @@ +@@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1511,7 +985,6 @@ new file mode 100644 +#include "prmem.h" +#include "nsString.h" +#include "nsMIMEInfoUnix.h" -+#include "nsAutoPtr.h" +#include "nsKDEUtils.h" + +/* static */ bool @@ -1630,7 +1103,7 @@ new file mode 100644 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp -@@ -1,47 +1,50 @@ +@@ -1,46 +1,49 @@ /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public @@ -1643,7 +1116,6 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler #include "nsIGIOService.h" #include "nsNetCID.h" #include "nsIIOService.h" - #include "nsAutoPtr.h" #ifdef MOZ_ENABLE_DBUS # include "nsDBusHandlerApp.h" #endif @@ -1686,7 +1158,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler if (*_retval) return NS_OK; return NS_OK; -@@ -51,16 +54,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi +@@ -50,16 +53,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi // if mDefaultApplication is set, it means the application has been set from // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to // give the GNOME answer. @@ -1739,10 +1211,10 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth #include "nsString.h" #include "nsReadableUtils.h" #include "nsUnicharUtils.h" - #include "nsIURL.h" #include "nsIFileStreams.h" #include "nsILineInputStream.h" -@@ -1025,17 +1025,17 @@ nsresult nsOSHelperAppService::GetHandle + #include "nsIFile.h" +@@ -1022,17 +1022,17 @@ nsresult nsOSHelperAppService::GetHandle nsresult nsOSHelperAppService::OSProtocolHandlerExists( const char* aProtocolScheme, bool* aHandlerExists) { @@ -1761,7 +1233,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth nsCOMPtr handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv); if (NS_SUCCEEDED(rv) && handlerSvc) { -@@ -1045,17 +1045,17 @@ nsresult nsOSHelperAppService::OSProtoco +@@ -1042,17 +1042,17 @@ nsresult nsOSHelperAppService::OSProtoco } return rv; @@ -1778,9 +1250,9 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth #endif } - nsresult nsOSHelperAppService::GetFileTokenForPath( - const char16_t* platformAppPath, nsIFile** aFile) { -@@ -1136,17 +1136,17 @@ already_AddRefed nsOSHel + NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol( + const nsACString& aScheme, bool* _retval) { +@@ -1139,17 +1139,17 @@ already_AddRefed nsOSHel nsresult rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, true); @@ -1799,7 +1271,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, false); -@@ -1248,17 +1248,17 @@ already_AddRefed nsOSHel +@@ -1251,17 +1251,17 @@ already_AddRefed nsOSHel // Now look up our extensions nsAutoString extensions, mime_types_description; @@ -1821,7 +1293,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -124,16 +124,17 @@ include('/ipc/chromium/chromium-config.m +@@ -131,16 +131,17 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' @@ -1842,33 +1314,34 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp -@@ -4,32 +4,34 @@ +@@ -1,15 +1,16 @@ + /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - #include "mozilla/Types.h" + #include + #include ++#include #include #include #include - #include -+#include - + #include "mozilla/Types.h" #include "nsGtkUtils.h" #include "nsIFileURL.h" - #include "nsIURI.h" - #include "nsIWidget.h" - #include "nsIFile.h" - #include "nsIStringBundle.h" - - #include "nsArrayEnumerator.h" + #include "nsIGIOService.h" +@@ -22,16 +23,18 @@ #include "nsMemory.h" #include "nsEnumeratorUtils.h" #include "nsNetUtil.h" #include "nsReadableUtils.h" - #include "mozcontainer.h" + #include "MozContainer.h" + #include "gfxPlatformGtk.h" #include "nsFilePicker.h" +#include "nsKDEUtils.h" ++#include "nsURLHelper.h" using namespace mozilla; @@ -1877,7 +1350,7 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp #define MAX_PREVIEW_SOURCE_SIZE 4096 nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; -@@ -227,17 +229,19 @@ nsFilePicker::AppendFilters(int32_t aFil +@@ -231,17 +234,19 @@ nsFilePicker::AppendFilters(int32_t aFil mAllowURLs = !!(aFilterMask & filterAllowURLs); return nsBaseFilePicker::AppendFilters(aFilterMask); } @@ -1898,7 +1371,7 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp mFilters.AppendElement(filter); mFilterNames.AppendElement(name); -@@ -337,16 +341,39 @@ nsresult nsFilePicker::Show(int16_t* aRe +@@ -341,16 +346,39 @@ nsresult nsFilePicker::Show(int16_t* aRe return NS_OK; } @@ -1930,15 +1403,15 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp + return NS_OK; + } + - nsCString title; - title.Adopt(ToNewUTF8String(mTitle)); + NS_ConvertUTF16toUTF8 title(mTitle); GtkWindow* parent_widget = GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); GtkFileChooserAction action = GetGtkFileChooserAction(mMode); -@@ -572,16 +599,240 @@ void nsFilePicker::Done(void* file_choos + const gchar* accept_button; +@@ -570,16 +598,244 @@ void nsFilePicker::Done(void* file_choos mCallback->Done(result); mCallback = nullptr; } else { @@ -2104,8 +1577,12 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp + mFileURL = output[ 0 ]; + else // GetFile() actually requires it to be url even for local files :-/ + { -+ mFileURL = nsCString( "file://" ); -+ mFileURL.Append( output[ 0 ] ); ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile( output[ 0 ], ++ PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) ++ rv = net_GetURLSpecFromActualFile(localfile, mFileURL); + } + } + // Remember last used directory. @@ -2208,7 +1685,7 @@ diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp --- a/xpcom/components/ManifestParser.cpp +++ b/xpcom/components/ManifestParser.cpp -@@ -33,16 +33,17 @@ +@@ -34,16 +34,17 @@ #include "nsTextFormatter.h" #include "nsVersionComparator.h" #include "nsXPCOMCIDInternal.h" @@ -2226,7 +1703,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars int argc; bool ischrome; -@@ -393,16 +394,17 @@ void ParseManifest(NSLocationType aType, +@@ -394,16 +395,17 @@ void ParseManifest(NSLocationType aType, NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled"); NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired"); NS_NAMED_LITERAL_STRING(kApplication, "application"); @@ -2244,7 +1721,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars NS_NAMED_LITERAL_STRING(kMain, "main"); NS_NAMED_LITERAL_STRING(kContent, "content"); -@@ -448,39 +450,44 @@ void ParseManifest(NSLocationType aType, +@@ -449,39 +451,44 @@ void ParseManifest(NSLocationType aType, CopyUTF8toUTF16(s, abi); abi.Insert(char16_t('_'), 0); abi.Insert(osTarget, 0); @@ -2265,8 +1742,8 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars + desktop = NS_LITERAL_STRING("win"); # pragma warning(pop) #elif defined(MOZ_WIDGET_COCOA) - SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor(); - SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor(); + SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor(); + SInt32 minorVersion = nsCocoaFeatures::macOSVersionMinor(); nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion); + desktop = NS_LITERAL_STRING("macosx"); #elif defined(MOZ_WIDGET_GTK) @@ -2289,7 +1766,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars process = kMain; } -@@ -567,25 +574,27 @@ void ParseManifest(NSLocationType aType, +@@ -568,25 +575,27 @@ void ParseManifest(NSLocationType aType, TriState stOsVersion = eUnspecified; TriState stOs = eUnspecified; TriState stABI = eUnspecified; @@ -2317,7 +1794,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars continue; } -@@ -622,17 +631,17 @@ void ParseManifest(NSLocationType aType, +@@ -623,17 +632,17 @@ void ParseManifest(NSLocationType aType, } LogMessageWithContext( @@ -2339,7 +1816,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build --- a/xpcom/components/moz.build +++ b/xpcom/components/moz.build -@@ -66,16 +66,17 @@ LOCAL_INCLUDES += [ +@@ -62,16 +62,17 @@ LOCAL_INCLUDES += [ '!..', '../base', '../build', @@ -2351,16 +1828,16 @@ diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build + '/toolkit/xre', ] - if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': CXXFLAGS += CONFIG['TK_CFLAGS'] + if CONFIG['MOZ_ENABLE_DBUS']: + CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS'] - if CONFIG['MOZ_LAYOUT_DEBUGGER']: - DEFINES['MOZ_LAYOUT_DEBUGGER'] = True - + include('/ipc/chromium/chromium-config.mozbuild') diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp -@@ -47,16 +47,17 @@ +@@ -46,16 +46,17 @@ #include "prproces.h" #include "nsIDirectoryEnumerator.h" #include "nsSimpleEnumerator.h" @@ -2378,7 +1855,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp # include "prmem.h" # include "plbase64.h" -@@ -1902,62 +1903,77 @@ nsLocalFile::SetPersistentDescriptor(con +@@ -1898,62 +1899,77 @@ nsLocalFile::SetPersistentDescriptor(con NS_IMETHODIMP nsLocalFile::Reveal() { diff --git a/mozilla-nestegg-big-endian.patch b/mozilla-nestegg-big-endian.patch deleted file mode 100644 index 484388e..0000000 --- a/mozilla-nestegg-big-endian.patch +++ /dev/null @@ -1,38 +0,0 @@ -# HG changeset patch -# Parent 381102061fccdec40efda75c7423a766f68201ba -Bug-behavior: Youtube-videos using VP9 and opus as audio-codec started loading but did not play -Reason: While parsing the audio-stream, the sampling frequency (short rate) was wrongly parsed by - nestegg, returning 0 all the time. This led to the audio-track reporting that it neither had - valid video nor audio. Which led to an endless-loop in the video state machine. -Solution: Correct parsing of rate in nestegg, which is a float and cuts of bytes. -Link: https://github.com/kinetiknz/nestegg/issues/64 - -diff -r 381102061fcc -r 8da4be020b1e media/libnestegg/src/nestegg.c ---- a/media/libnestegg/src/nestegg.c Tue Aug 13 07:51:27 2019 +0200 -+++ b/media/libnestegg/src/nestegg.c Tue Aug 20 07:59:54 2019 +0200 -@@ -768,7 +768,15 @@ - { - union { - uint64_t u; -- float f; -+ struct { -+#if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__ -+ uint32_t _pad; -+ float f; -+#else -+ float f; -+ uint32_t _pad; -+#endif -+ } f; - double d; - } value; - int r; -@@ -780,7 +788,7 @@ - if (r != 1) - return r; - if (length == 4) -- *val = value.f; -+ *val = value.f.f; - else - *val = value.d; - return 1; diff --git a/mozilla-openaes-decl.patch b/mozilla-openaes-decl.patch deleted file mode 100644 index c341812..0000000 --- a/mozilla-openaes-decl.patch +++ /dev/null @@ -1,26 +0,0 @@ -# HG changeset patch -# Parent 33024abb3c58dab7239e32388df58e14f99defd5 -# User Wolfgang Rosenauer -# Parent 0cfd693fdbbb0635787f1aeacee2dda43b01c495 - -diff --git a/media/gmp-clearkey/0.1/openaes/oaes_lib.c b/media/gmp-clearkey/0.1/openaes/oaes_lib.c ---- a/media/gmp-clearkey/0.1/openaes/oaes_lib.c -+++ b/media/gmp-clearkey/0.1/openaes/oaes_lib.c -@@ -24,16 +24,17 @@ - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * --------------------------------------------------------------------------- - */ - - #include -+#include - #include - #include - #include - - #include "mozilla/Sprintf.h" - - #ifdef WIN32 - #include diff --git a/mozilla-pipewire-0-3.patch b/mozilla-pipewire-0-3.patch new file mode 100644 index 0000000..4b9eb84 --- /dev/null +++ b/mozilla-pipewire-0-3.patch @@ -0,0 +1,846 @@ +diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild +index 2081d0c683a4..641133bf1ea4 100644 +--- a/config/system-headers.mozbuild ++++ b/config/system-headers.mozbuild +@@ -314,6 +314,7 @@ system_headers = [ + 'Gestalt.h', + 'getopt.h', + 'gio/gio.h', ++ 'gio/gunixfdlist.h', + 'glibconfig.h', + 'glib.h', + 'glib-object.h', +@@ -607,6 +608,7 @@ system_headers = [ + 'Pgenerr.h', + 'PGenErr.h', + 'Ph.h', ++ 'pipewire/pipewire.h', + 'pixman.h', + 'pk11func.h', + 'pk11pqg.h', +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn +index ba885217b3ba..201d3b755221 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn +@@ -158,7 +158,7 @@ if (rtc_include_tests) { + if (is_linux) { + if (rtc_use_pipewire) { + pkg_config("pipewire") { +- packages = [ "libpipewire-0.2" ] ++ packages = [ "libpipewire-0.3" ] + + defines = [ "WEBRTC_USE_PIPEWIRE" ] + } +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +index 90b40431c7e4..d844aa79d591 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +@@ -194,6 +194,30 @@ if CONFIG["OS_TARGET"] == "Linux": + "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc" + ] + ++# PipeWire specific files ++if CONFIG["OS_TARGET"] == "Linux": ++ ++ DEFINES["WEBRTC_USE_PIPEWIRE"] = "1" ++ ++ OS_LIBS += [ ++ "rt", ++ "pipewire-0.3", ++ "glib-2.0", ++ "gio-2.0", ++ "gobject-2.0" ++ ] ++ ++ CXXFLAGS += CONFIG['TK_CFLAGS'] ++ CXXFLAGS += [ "-I/usr/include/pipewire-0.3" ] ++ CXXFLAGS += [ "-I/usr/include/spa-0.2" ] ++ ++ UNIFIED_SOURCES += [ ++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", ++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" ++ ] ++ ++ + if CONFIG["OS_TARGET"] == "NetBSD": + + DEFINES["USE_X11"] = "1" +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h +index 1eb8ead26efa..316468eed1fc 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h +@@ -141,7 +141,7 @@ class DesktopCaptureOptions { + bool disable_effects_ = true; + bool detect_updated_region_ = false; + #if defined(WEBRTC_USE_PIPEWIRE) +- bool allow_pipewire_ = false; ++ bool allow_pipewire_ = true; + #endif + }; + +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +index 379341c833de..76349f1fbd4d 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +@@ -15,8 +15,11 @@ + + #include + #include +-#include +-#include ++ ++#include ++#include ++#include ++#include + + #include + #include +@@ -36,31 +39,36 @@ const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; + const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; + const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; + +-// static +-void BaseCapturerPipeWire::OnStateChanged(void* data, +- pw_remote_state old_state, +- pw_remote_state state, +- const char* error_message) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); + +- switch (state) { +- case PW_REMOTE_STATE_ERROR: +- RTC_LOG(LS_ERROR) << "PipeWire remote state error: " << error_message; +- break; +- case PW_REMOTE_STATE_CONNECTED: +- RTC_LOG(LS_INFO) << "PipeWire remote state: connected."; +- that->CreateReceivingStream(); +- break; +- case PW_REMOTE_STATE_CONNECTING: +- RTC_LOG(LS_INFO) << "PipeWire remote state: connecting."; ++// static ++void BaseCapturerPipeWire::SyncDmaBuf(int fd, uint64_t start_or_end) { ++ struct dma_buf_sync sync = { 0 }; ++ ++ sync.flags = start_or_end | DMA_BUF_SYNC_READ; ++ ++ while(true) { ++ int ret; ++ ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync); ++ if (ret == -1 && errno == EINTR) { ++ continue; ++ } else if (ret == -1) { ++ RTC_LOG(LS_ERROR) << "Failed to synchronize DMA buffer: " << g_strerror(errno); + break; +- case PW_REMOTE_STATE_UNCONNECTED: +- RTC_LOG(LS_INFO) << "PipeWire remote state: unconnected."; ++ } else { + break; ++ } + } + } + ++// static ++void BaseCapturerPipeWire::OnCoreError(void *data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char *message) { ++ RTC_LOG(LS_ERROR) << "core error: " << message; ++} ++ + // static + void BaseCapturerPipeWire::OnStreamStateChanged(void* data, + pw_stream_state old_state, +@@ -73,76 +81,54 @@ void BaseCapturerPipeWire::OnStreamStateChanged(void* data, + case PW_STREAM_STATE_ERROR: + RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; + break; +- case PW_STREAM_STATE_CONFIGURE: +- pw_stream_set_active(that->pw_stream_, true); +- break; +- case PW_STREAM_STATE_UNCONNECTED: +- case PW_STREAM_STATE_CONNECTING: +- case PW_STREAM_STATE_READY: + case PW_STREAM_STATE_PAUSED: + case PW_STREAM_STATE_STREAMING: ++ case PW_STREAM_STATE_UNCONNECTED: ++ case PW_STREAM_STATE_CONNECTING: + break; + } + } + + // static +-void BaseCapturerPipeWire::OnStreamFormatChanged(void* data, +- const struct spa_pod* format) { ++void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, ++ const struct spa_pod *format) { + BaseCapturerPipeWire* that = static_cast(data); + RTC_DCHECK(that); + +- RTC_LOG(LS_INFO) << "PipeWire stream format changed."; ++ RTC_LOG(LS_INFO) << "PipeWire stream param changed."; + +- if (!format) { +- pw_stream_finish_format(that->pw_stream_, /*res=*/0, /*params=*/nullptr, +- /*n_params=*/0); ++ if (!format || id != SPA_PARAM_Format) { + return; + } + +- that->spa_video_format_ = new spa_video_info_raw(); +- spa_format_video_raw_parse(format, that->spa_video_format_, +- &that->pw_type_->format_video); ++ spa_format_video_raw_parse(format, &that->spa_video_format_); + +- auto width = that->spa_video_format_->size.width; +- auto height = that->spa_video_format_->size.height; ++ auto width = that->spa_video_format_.size.width; ++ auto height = that->spa_video_format_.size.height; + auto stride = SPA_ROUND_UP_N(width * kBytesPerPixel, 4); + auto size = height * stride; + ++ that->desktop_size_ = DesktopSize(width, height); ++ + uint8_t buffer[1024] = {}; + auto builder = spa_pod_builder{buffer, sizeof(buffer)}; + + // Setup buffers and meta header for new format. +- const struct spa_pod* params[2]; +- params[0] = reinterpret_cast(spa_pod_builder_object( +- &builder, +- // id to enumerate buffer requirements +- that->pw_core_type_->param.idBuffers, +- that->pw_core_type_->param_buffers.Buffers, +- // Size: specified as integer (i) and set to specified size +- ":", that->pw_core_type_->param_buffers.size, "i", size, +- // Stride: specified as integer (i) and set to specified stride +- ":", that->pw_core_type_->param_buffers.stride, "i", stride, +- // Buffers: specifies how many buffers we want to deal with, set as +- // integer (i) where preferred number is 8, then allowed number is defined +- // as range (r) from min and max values and it is undecided (u) to allow +- // negotiation +- ":", that->pw_core_type_->param_buffers.buffers, "iru", 8, +- SPA_POD_PROP_MIN_MAX(1, 32), +- // Align: memory alignment of the buffer, set as integer (i) to specified +- // value +- ":", that->pw_core_type_->param_buffers.align, "i", 16)); +- params[1] = reinterpret_cast(spa_pod_builder_object( +- &builder, +- // id to enumerate supported metadata +- that->pw_core_type_->param.idMeta, that->pw_core_type_->param_meta.Meta, +- // Type: specified as id or enum (I) +- ":", that->pw_core_type_->param_meta.type, "I", +- that->pw_core_type_->meta.Header, +- // Size: size of the metadata, specified as integer (i) +- ":", that->pw_core_type_->param_meta.size, "i", +- sizeof(struct spa_meta_header))); +- +- pw_stream_finish_format(that->pw_stream_, /*res=*/0, params, /*n_params=*/2); ++ const struct spa_pod* params[3]; ++ params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ++ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size), ++ SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride), ++ SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(8, 1, 32))); ++ params[1] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ++ SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), ++ SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)))); ++ params[2] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ++ SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop), ++ SPA_PARAM_META_size, SPA_POD_Int (sizeof(struct spa_meta_region)))); ++ pw_stream_update_params(that->pw_stream_, params, 3); + } + + // static +@@ -150,15 +136,25 @@ void BaseCapturerPipeWire::OnStreamProcess(void* data) { + BaseCapturerPipeWire* that = static_cast(data); + RTC_DCHECK(that); + +- pw_buffer* buf = nullptr; ++ struct pw_buffer *next_buffer; ++ struct pw_buffer *buffer = nullptr; ++ ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); ++ while (next_buffer) { ++ buffer = next_buffer; ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); + +- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) { ++ if (next_buffer) ++ pw_stream_queue_buffer (that->pw_stream_, buffer); ++ } ++ ++ if (!buffer) { + return; + } + +- that->HandleBuffer(buf); ++ that->HandleBuffer(buffer); + +- pw_stream_queue_buffer(that->pw_stream_, buf); ++ pw_stream_queue_buffer(that->pw_stream_, buffer); + } + + BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) +@@ -169,38 +165,22 @@ BaseCapturerPipeWire::~BaseCapturerPipeWire() { + pw_thread_loop_stop(pw_main_loop_); + } + +- if (pw_type_) { +- delete pw_type_; +- } +- +- if (spa_video_format_) { +- delete spa_video_format_; +- } +- + if (pw_stream_) { + pw_stream_destroy(pw_stream_); + } + +- if (pw_remote_) { +- pw_remote_destroy(pw_remote_); ++ if (pw_core_) { ++ pw_core_disconnect(pw_core_); + } + +- if (pw_core_) { +- pw_core_destroy(pw_core_); ++ if (pw_context_) { ++ pw_context_destroy(pw_context_); + } + + if (pw_main_loop_) { + pw_thread_loop_destroy(pw_main_loop_); + } + +- if (pw_loop_) { +- pw_loop_destroy(pw_loop_); +- } +- +- if (current_frame_) { +- free(current_frame_); +- } +- + if (start_request_signal_id_) { + g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); + } +@@ -250,27 +230,35 @@ void BaseCapturerPipeWire::InitPortal() { + void BaseCapturerPipeWire::InitPipeWire() { + pw_init(/*argc=*/nullptr, /*argc=*/nullptr); + +- pw_loop_ = pw_loop_new(/*properties=*/nullptr); +- pw_main_loop_ = pw_thread_loop_new(pw_loop_, "pipewire-main-loop"); +- +- pw_core_ = pw_core_new(pw_loop_, /*properties=*/nullptr); +- pw_core_type_ = pw_core_get_type(pw_core_); +- pw_remote_ = pw_remote_new(pw_core_, nullptr, /*user_data_size=*/0); ++ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); ++ pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); ++ if (!pw_context_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; ++ return; ++ } + +- InitPipeWireTypes(); ++ pw_core_ = pw_context_connect(pw_context_, nullptr, 0); ++ if (!pw_core_) { ++ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; ++ return; ++ } + + // Initialize event handlers, remote end and stream-related. +- pw_remote_events_.version = PW_VERSION_REMOTE_EVENTS; +- pw_remote_events_.state_changed = &OnStateChanged; ++ pw_core_events_.version = PW_VERSION_CORE_EVENTS; ++ pw_core_events_.error = &OnCoreError; + + pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; + pw_stream_events_.state_changed = &OnStreamStateChanged; +- pw_stream_events_.format_changed = &OnStreamFormatChanged; ++ pw_stream_events_.param_changed = &OnStreamParamChanged; + pw_stream_events_.process = &OnStreamProcess; + +- pw_remote_add_listener(pw_remote_, &spa_remote_listener_, &pw_remote_events_, +- this); +- pw_remote_connect_fd(pw_remote_, pw_fd_); ++ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); ++ ++ pw_stream_ = CreateReceivingStream(); ++ if (!pw_stream_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; ++ return; ++ } + + if (pw_thread_loop_start(pw_main_loop_) < 0) { + RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; +@@ -278,81 +266,132 @@ void BaseCapturerPipeWire::InitPipeWire() { + } + } + +-void BaseCapturerPipeWire::InitPipeWireTypes() { +- spa_type_map* map = pw_core_type_->map; +- pw_type_ = new PipeWireType(); +- +- spa_type_media_type_map(map, &pw_type_->media_type); +- spa_type_media_subtype_map(map, &pw_type_->media_subtype); +- spa_type_format_video_map(map, &pw_type_->format_video); +- spa_type_video_format_map(map, &pw_type_->video_format); +-} +- +-void BaseCapturerPipeWire::CreateReceivingStream() { ++pw_stream* BaseCapturerPipeWire::CreateReceivingStream() { + spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1}; +- spa_rectangle pwScreenBounds = +- spa_rectangle{static_cast(desktop_size_.width()), +- static_cast(desktop_size_.height())}; ++ spa_rectangle pwMaxScreenBounds = spa_rectangle{INT32_MAX, INT32_MAX}; + +- spa_fraction pwFrameRateMin = spa_fraction{0, 1}; +- spa_fraction pwFrameRateMax = spa_fraction{60, 1}; ++ auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr); + +- pw_properties* reuseProps = pw_properties_new("pipewire.client.reuse", "1", +- /*end of varargs*/ nullptr); +- pw_stream_ = pw_stream_new(pw_remote_, "webrtc-consume-stream", reuseProps); ++ if (!stream) { ++ RTC_LOG(LS_ERROR) << "Could not create receiving stream."; ++ return nullptr; ++ } + + uint8_t buffer[1024] = {}; +- const spa_pod* params[1]; +- spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; +- params[0] = reinterpret_cast(spa_pod_builder_object( +- &builder, +- // id to enumerate formats +- pw_core_type_->param.idEnumFormat, pw_core_type_->spa_format, "I", +- pw_type_->media_type.video, "I", pw_type_->media_subtype.raw, +- // Video format: specified as id or enum (I), preferred format is BGRx, +- // then allowed formats are enumerated (e) and the format is undecided (u) +- // to allow negotiation +- ":", pw_type_->format_video.format, "Ieu", pw_type_->video_format.BGRx, +- SPA_POD_PROP_ENUM(2, pw_type_->video_format.RGBx, +- pw_type_->video_format.BGRx), +- // Video size: specified as rectangle (R), preferred size is specified as +- // first parameter, then allowed size is defined as range (r) from min and +- // max values and the format is undecided (u) to allow negotiation +- ":", pw_type_->format_video.size, "Rru", &pwScreenBounds, 2, +- &pwMinScreenBounds, &pwScreenBounds, +- // Frame rate: specified as fraction (F) and set to minimum frame rate +- // value +- ":", pw_type_->format_video.framerate, "F", &pwFrameRateMin, +- // Max frame rate: specified as fraction (F), preferred frame rate is set +- // to maximum value, then allowed frame rate is defined as range (r) from +- // min and max values and it is undecided (u) to allow negotiation +- ":", pw_type_->format_video.max_framerate, "Fru", &pwFrameRateMax, 2, +- &pwFrameRateMin, &pwFrameRateMax)); +- +- pw_stream_add_listener(pw_stream_, &spa_stream_listener_, &pw_stream_events_, +- this); ++ const spa_pod* params[2]; ++ spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer)); ++ ++ params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, ++ SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video), ++ SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), ++ SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(5, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA, ++ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA), ++ SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMinScreenBounds, ++ &pwMinScreenBounds, ++ &pwMaxScreenBounds), ++ 0)); ++ pw_stream_add_listener(stream, &spa_stream_listener_, &pw_stream_events_, this); ++ + pw_stream_flags flags = static_cast( +- PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE | +- PW_STREAM_FLAG_MAP_BUFFERS); +- if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, /*port_path=*/nullptr, +- flags, params, +- /*n_params=*/1) != 0) { ++ PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE); ++ ++ if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) { + RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; + portal_init_failed_ = true; +- return; + } ++ ++ return stream; + } + + void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { ++ struct spa_meta_region* video_crop; + spa_buffer* spaBuffer = buffer->buffer; +- void* src = nullptr; ++ uint8_t *map = nullptr; ++ uint8_t* src = nullptr; ++ uint8_t* dst = nullptr; ++ ++ if (spaBuffer->datas[0].chunk->size == 0) { ++ map = nullptr; ++ src = nullptr; ++ } else if (spaBuffer->datas[0].type == SPA_DATA_MemFd) { ++ map = static_cast(mmap( ++ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0)); ++ ++ if (map == MAP_FAILED) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return; ++ } ++ ++ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); ++ } else if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { ++ int fd; ++ fd = spaBuffer->datas[0].fd; + +- if (!(src = spaBuffer->datas[0].data)) { ++ map = static_cast(mmap( ++ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, fd, 0)); ++ ++ if (map == MAP_FAILED) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return; ++ } ++ ++ SyncDmaBuf(fd, DMA_BUF_SYNC_START); ++ ++ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); ++ } else if (spaBuffer->datas[0].type == SPA_DATA_MemPtr) { ++ map = nullptr; ++ src = static_cast(spaBuffer->datas[0].data); ++ } else { + return; + } + +- uint32_t maxSize = spaBuffer->datas[0].maxsize; +- int32_t srcStride = spaBuffer->datas[0].chunk->stride; ++ if (!src) { ++ return; ++ } ++ ++ DesktopSize prev_crop_size = DesktopSize(0, 0); ++ if (video_crop_size_initialized_) { ++ prev_crop_size = video_crop_size_; ++ } ++ ++ if ((video_crop = static_cast( ++ spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_crop))))) { ++ RTC_DCHECK(video_crop->region.size.width <= desktop_size_.width() && ++ video_crop->region.size.height <= desktop_size_.height()); ++ if ((video_crop->region.size.width != desktop_size_.width() || ++ video_crop->region.size.height != desktop_size_.height()) && video_crop->region.size.width && video_crop->region.size.height) { ++ video_crop_size_ = DesktopSize(video_crop->region.size.width, video_crop->region.size.height); ++ video_crop_size_initialized_ = true; ++ } else { ++ video_crop_size_initialized_ = false; ++ } ++ } else { ++ video_crop_size_initialized_ = false; ++ } ++ ++ size_t frame_size; ++ if (video_crop_size_initialized_) { ++ frame_size = ++ video_crop_size_.width() * video_crop_size_.height() * kBytesPerPixel; ++ } else { ++ frame_size = ++ desktop_size_.width() * desktop_size_.height() * kBytesPerPixel; ++ } ++ ++ if (!current_frame_ || ++ (video_crop_size_initialized_ && !video_crop_size_.equals(prev_crop_size))) { ++ current_frame_ = std::make_unique(frame_size); ++ } ++ RTC_DCHECK(current_frame_ != nullptr); ++ ++ const int32_t dstStride = video_crop_size_initialized_ ++ ? video_crop_size_.width() * kBytesPerPixel ++ : desktop_size_.width() * kBytesPerPixel; ++ const int32_t srcStride = spaBuffer->datas[0].chunk->stride; ++ + if (srcStride != (desktop_size_.width() * kBytesPerPixel)) { + RTC_LOG(LS_ERROR) << "Got buffer with stride different from screen stride: " + << srcStride +@@ -361,21 +400,40 @@ void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { + return; + } + +- if (!current_frame_) { +- current_frame_ = static_cast(malloc(maxSize)); ++ dst = current_frame_.get(); ++ ++ // Adjust source content based on crop video position ++ if (video_crop_size_initialized_ && ++ (video_crop->region.position.y + video_crop_size_.height() <= desktop_size_.height())) { ++ for (int i = 0; i < video_crop->region.position.y; ++i) { ++ src += srcStride; ++ } ++ } ++ const int xOffset = ++ video_crop_size_initialized_ && (video_crop->region.position.x + video_crop_size_.width() <= ++ desktop_size_.width()) ++ ? video_crop->region.position.x * kBytesPerPixel ++ : 0; ++ const int height = video_crop_size_initialized_ ? video_crop_size_.height() : desktop_size_.height(); ++ for (int i = 0; i < height; ++i) { ++ // Adjust source content based on crop video position if needed ++ src += xOffset; ++ std::memcpy(dst, src, dstStride); ++ // If both sides decided to go with the RGBx format we need to convert it to ++ // BGRx to match color format expected by WebRTC. ++ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || ++ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { ++ ConvertRGBxToBGRx(dst, dstStride); ++ } ++ src += srcStride - xOffset; ++ dst += dstStride; + } +- RTC_DCHECK(current_frame_ != nullptr); + +- // If both sides decided to go with the RGBx format we need to convert it to +- // BGRx to match color format expected by WebRTC. +- if (spa_video_format_->format == pw_type_->video_format.RGBx) { +- uint8_t* tempFrame = static_cast(malloc(maxSize)); +- std::memcpy(tempFrame, src, maxSize); +- ConvertRGBxToBGRx(tempFrame, maxSize); +- std::memcpy(current_frame_, tempFrame, maxSize); +- free(tempFrame); +- } else { +- std::memcpy(current_frame_, src, maxSize); ++ if (map) { ++ if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { ++ SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_END); ++ } ++ munmap(map, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset); + } + } + +@@ -725,10 +783,7 @@ void BaseCapturerPipeWire::OnStartRequestResponseSignal( + g_variant_get(variant, "(u@a{sv})", &stream_id, &options); + RTC_DCHECK(options != nullptr); + +- g_variant_lookup(options, "size", "(ii)", &width, &height); +- +- that->desktop_size_.set(width, height); +- ++ that->pw_stream_node_id_ = stream_id; + g_variant_unref(options); + g_variant_unref(variant); + } +@@ -813,10 +868,15 @@ void BaseCapturerPipeWire::CaptureFrame() { + return; + } + +- std::unique_ptr result(new BasicDesktopFrame(desktop_size_)); ++ DesktopSize frame_size = desktop_size_; ++ if (video_crop_size_initialized_) { ++ frame_size = video_crop_size_; ++ } ++ ++ std::unique_ptr result(new BasicDesktopFrame(frame_size)); + result->CopyPixelsFrom( +- current_frame_, (desktop_size_.width() * kBytesPerPixel), +- DesktopRect::MakeWH(desktop_size_.width(), desktop_size_.height())); ++ current_frame_.get(), (frame_size.width() * kBytesPerPixel), ++ DesktopRect::MakeWH(frame_size.width(), frame_size.height())); + if (!result) { + callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); + return; +@@ -837,4 +897,22 @@ bool BaseCapturerPipeWire::SelectSource(SourceId id) { + return true; + } + ++// static ++std::unique_ptr ++BaseCapturerPipeWire::CreateRawScreenCapturer( ++ const DesktopCaptureOptions& options) { ++ std::unique_ptr capturer = ++ std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); ++ return std::move(capturer);} ++ ++// static ++std::unique_ptr ++BaseCapturerPipeWire::CreateRawWindowCapturer( ++ const DesktopCaptureOptions& options) { ++ ++ std::unique_ptr capturer = ++ std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); ++ return std::move(capturer); ++} ++ + } // namespace webrtc +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +index 56b101acbaa6..de54157d1a2a 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +@@ -22,17 +22,13 @@ + + namespace webrtc { + +-class PipeWireType { +- public: +- spa_type_media_type media_type; +- spa_type_media_subtype media_subtype; +- spa_type_format_video format_video; +- spa_type_video_format video_format; +-}; +- + class BaseCapturerPipeWire : public DesktopCapturer { + public: +- enum CaptureSourceType { Screen = 1, Window }; ++ enum CaptureSourceType : uint32_t { ++ kScreen = 0b01, ++ kWindow = 0b10, ++ kAny = 0b11 ++ }; + + explicit BaseCapturerPipeWire(CaptureSourceType source_type); + ~BaseCapturerPipeWire() override; +@@ -43,28 +39,32 @@ class BaseCapturerPipeWire : public DesktopCapturer { + bool GetSourceList(SourceList* sources) override; + bool SelectSource(SourceId id) override; + ++ static std::unique_ptr CreateRawScreenCapturer( ++ const DesktopCaptureOptions& options); ++ ++ static std::unique_ptr CreateRawWindowCapturer( ++ const DesktopCaptureOptions& options); ++ + private: + // PipeWire types --> ++ pw_context* pw_context_ = nullptr; + pw_core* pw_core_ = nullptr; +- pw_type* pw_core_type_ = nullptr; + pw_stream* pw_stream_ = nullptr; +- pw_remote* pw_remote_ = nullptr; +- pw_loop* pw_loop_ = nullptr; + pw_thread_loop* pw_main_loop_ = nullptr; +- PipeWireType* pw_type_ = nullptr; + ++ spa_hook spa_core_listener_ = {}; + spa_hook spa_stream_listener_ = {}; +- spa_hook spa_remote_listener_ = {}; + ++ pw_core_events pw_core_events_ = {}; + pw_stream_events pw_stream_events_ = {}; +- pw_remote_events pw_remote_events_ = {}; + +- spa_video_info_raw* spa_video_format_ = nullptr; ++ struct spa_video_info_raw spa_video_format_; + ++ guint32 pw_stream_node_id_ = 0; + gint32 pw_fd_ = -1; + + CaptureSourceType capture_source_type_ = +- BaseCapturerPipeWire::CaptureSourceType::Screen; ++ BaseCapturerPipeWire::CaptureSourceType::kAny; + + // <-- end of PipeWire types + +@@ -78,33 +78,37 @@ class BaseCapturerPipeWire : public DesktopCapturer { + guint sources_request_signal_id_ = 0; + guint start_request_signal_id_ = 0; + ++ bool video_crop_size_initialized_ = false; ++ DesktopSize video_crop_size_;; + DesktopSize desktop_size_ = {}; + DesktopCaptureOptions options_ = {}; + +- uint8_t* current_frame_ = nullptr; ++ std::unique_ptr current_frame_; + Callback* callback_ = nullptr; + + bool portal_init_failed_ = false; + + void InitPortal(); + void InitPipeWire(); +- void InitPipeWireTypes(); + +- void CreateReceivingStream(); ++ pw_stream* CreateReceivingStream(); + void HandleBuffer(pw_buffer* buffer); + + void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); + +- static void OnStateChanged(void* data, +- pw_remote_state old_state, +- pw_remote_state state, +- const char* error); ++ static void SyncDmaBuf(int fd, uint64_t start_or_end); ++ static void OnCoreError(void *data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char *message); ++ static void OnStreamParamChanged(void *data, ++ uint32_t id, ++ const struct spa_pod *format); + static void OnStreamStateChanged(void* data, + pw_stream_state old_state, + pw_stream_state state, + const char* error_message); +- +- static void OnStreamFormatChanged(void* data, const struct spa_pod* format); + static void OnStreamProcess(void* data); + static void OnNewBuffer(void* data, uint32_t id); + +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +index 26956fc67dc8..3813d697bb38 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +@@ -15,7 +15,7 @@ + namespace webrtc { + + ScreenCapturerPipeWire::ScreenCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {} ++ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {} + ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {} + + // static +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +index 35436475cb4d..c43a1f1a0c4e 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +@@ -15,7 +15,7 @@ + namespace webrtc { + + WindowCapturerPipeWire::WindowCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {} ++ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {} + WindowCapturerPipeWire::~WindowCapturerPipeWire() {} + + // static +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc +index cf8a9dd0e0db..d27fab8d28d9 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc +@@ -26,7 +26,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return ScreenCapturerPipeWire::CreateRawScreenCapturer(options); ++ return BaseCapturerPipeWire::CreateRawScreenCapturer(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc +index 82359e50c2db..bb9724cf7cc2 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc +@@ -26,7 +26,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return WindowCapturerPipeWire::CreateRawWindowCapturer(options); ++ return BaseCapturerPipeWire::CreateRawWindowCapturer(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + diff --git a/mozilla-ppc-altivec_static_inline.patch b/mozilla-ppc-altivec_static_inline.patch index 973054e..c0d7987 100644 --- a/mozilla-ppc-altivec_static_inline.patch +++ b/mozilla-ppc-altivec_static_inline.patch @@ -3,13 +3,18 @@ # Date 1558452418 -7200 # Tue May 21 17:26:58 2019 +0200 # Node ID 6cd963b6c82ea6629aaf4050851789b78f310338 -# Parent 602e92722e765a3c238d3b96b26c0c8063b5eeb4 +# Parent 010a35335b4e45e222b9efdbda24fd1963202ecf imported patch mozilla-ppc-altivec_static_inline.patch -diff -r 602e92722e76 -r 6cd963b6c82e gfx/qcms/transform-altivec.c ---- a/gfx/qcms/transform-altivec.c Tue May 21 17:26:48 2019 +0200 -+++ b/gfx/qcms/transform-altivec.c Tue May 21 17:26:58 2019 +0200 -@@ -30,7 +30,7 @@ +diff --git a/gfx/qcms/transform-altivec.cpp b/gfx/qcms/transform-altivec.cpp +--- a/gfx/qcms/transform-altivec.cpp ++++ b/gfx/qcms/transform-altivec.cpp +@@ -25,17 +25,17 @@ + + #include "qcmsint.h" + + #define FLOATSCALE (float)(PRECACHE_OUTPUT_SIZE) + #define CLAMPMAXVAL (((float) (PRECACHE_OUTPUT_SIZE - 1)) / PRECACHE_OUTPUT_SIZE) static const ALIGN float floatScaleX4 = FLOATSCALE; static const ALIGN float clampMaxValueX4 = CLAMPMAXVAL; @@ -18,3 +23,8 @@ diff -r 602e92722e76 -r 6cd963b6c82e gfx/qcms/transform-altivec.c { vector float data = vec_lde(0, dataPtr); vector unsigned char moveToStart = vec_lvsl(0, dataPtr); + return vec_perm(data, data, moveToStart); + } + + template + static void qcms_transform_data_template_lut_altivec(const qcms_transform *transform, diff --git a/mozilla-reduce-rust-debuginfo.patch b/mozilla-reduce-rust-debuginfo.patch index 908b2b4..d00fd99 100644 --- a/mozilla-reduce-rust-debuginfo.patch +++ b/mozilla-reduce-rust-debuginfo.patch @@ -3,32 +3,52 @@ # Date 1560754926 -7200 # Mon Jun 17 09:02:06 2019 +0200 # Node ID 428161c3b9599083e1b8710eda1760f1f707ab11 -# Parent 6cd963b6c82ea6629aaf4050851789b78f310338 +# Parent fa1cf8b9cb4efdf89fe19e543fb54272b726a353 #Description: reduce the rust debuginfo level on selected architectures where # compiling with debuginfo=2 causes the OOM killer to interrupt the build on # launchpad builders. Initially this was only on 32 bit architectures, but with # firefox 63 it started happening frequently on arm64 and ppc64el too. -diff -r 6cd963b6c82e -r 428161c3b959 build/moz.configure/toolchain.configure ---- a/build/moz.configure/toolchain.configure Tue May 21 17:26:58 2019 +0200 -+++ b/build/moz.configure/toolchain.configure Mon Jun 17 09:02:06 2019 +0200 -@@ -1865,8 +1865,8 @@ +diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure +--- a/build/moz.configure/toolchain.configure ++++ b/build/moz.configure/toolchain.configure +@@ -1861,18 +1861,18 @@ imply_option('RUSTC_OPT_LEVEL', '2', whe + @depends('RUSTC_OPT_LEVEL', moz_optimize) + def rustc_opt_level(opt_level_option, moz_optimize): + if opt_level_option: + return opt_level_option[0] + else: return '1' if moz_optimize.optimize else '0' --@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols') --def rust_compile_flags(opt_level, debug_rust, debug_symbols): -+@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', host) -+def rust_compile_flags(opt_level, debug_rust, debug_symbols, host): +-@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers') +-def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers): ++@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers', host) ++def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers, host): # Cargo currently supports only two interesting profiles for building: # development and release. Those map (roughly) to --enable-debug and # --disable-debug in Gecko, respectively. -@@ -1889,6 +1889,8 @@ + # + # But we'd also like to support an additional axis of control for + # optimization level. Since Cargo only supports 2 profiles, we're in + # a bit of a bind. + # +@@ -1885,16 +1885,18 @@ def rust_compile_flags(opt_level, debug_ + + # opt-level=0 implies -C debug-assertions, which may not be desired + # unless Rust debugging is enabled. + if opt_level == '0' and not debug_rust: + debug_assertions = False if debug_symbols: debug_info = '2' -+ if host.bitness == 32 or host.cpu == 'aarch64' or host.cpu == 'ppc64': -+ debug_info = '1' ++# if host.bitness == 32 or host.cpu == 'aarch64' or host.cpu == 'ppc64': # Just reduce debug_info for all archs ++ debug_info = '1' opts = [] + if opt_level is not None: + opts.append('opt-level=%s' % opt_level) + if debug_assertions is not None: + opts.append('debug-assertions=%s' % + ('yes' if debug_assertions else 'no')) diff --git a/mozilla-s390-bigendian.patch b/mozilla-s390-bigendian.patch deleted file mode 100644 index a776bfa..0000000 --- a/mozilla-s390-bigendian.patch +++ /dev/null @@ -1,20 +0,0 @@ -# HG changeset patch -# User msirringhaus@suse.de -# Date 1558452126 -7200 -# Tue May 21 17:22:06 2019 +0200 -# Node ID a3cc550d25e3a04d906f516928cbcbe50efd585e -# Parent 433beec63e6b5f409683af20a0c1ab137cc7bfad -[mq]: mozilla-s390-bigendian.patch - -diff -r 433beec63e6b -r a3cc550d25e3 build/autoconf/icu.m4 ---- a/build/autoconf/icu.m4 Tue May 21 17:12:20 2019 +0200 -+++ b/build/autoconf/icu.m4 Tue May 21 17:22:06 2019 +0200 -@@ -78,7 +78,7 @@ - # TODO: the l is actually endian-dependent - # We could make this set as 'l' or 'b' for little or big, respectively, - # but we'd need to check in a big-endian version of the file. -- ICU_DATA_FILE="icudt${version}l.dat" -+ ICU_DATA_FILE="icudt${version}b.dat" - fi - - AC_SUBST(MOZ_ICU_VERSION) diff --git a/mozilla-s390x-skia-gradient.patch b/mozilla-s390x-skia-gradient.patch new file mode 100644 index 0000000..4b48f1e --- /dev/null +++ b/mozilla-s390x-skia-gradient.patch @@ -0,0 +1,51 @@ +# HG changeset patch +# Parent acf59ea86dd1d878b43920832093f082dcfc61c0 + +diff -r acf59ea86dd1 gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp +--- a/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp Mon Mar 09 08:26:10 2020 +0100 ++++ b/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp Fri Mar 27 13:30:28 2020 +0100 +@@ -7,7 +7,7 @@ + + #include "include/core/SkPaint.h" + #include "src/shaders/gradients/Sk4fLinearGradient.h" +- ++#include "src/core/SkEndian.h" + #include + #include + +@@ -28,6 +28,9 @@ + + while (n >= 4) { + DstTraits::store4x(c0, c1, c2, c3, dst, bias0, bias1); ++#ifdef SK_CPU_BENDIAN ++ SkEndianSwap32s(dst, 4); ++#endif + dst += 4; + + c0 = c0 + dc4; +@@ -37,12 +40,23 @@ + n -= 4; + } + if (n & 2) { +- DstTraits::store(c0, dst++, bias0); +- DstTraits::store(c1, dst++, bias1); ++ DstTraits::store(c0, dst, bias0); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif ++ ++dst; ++ DstTraits::store(c1, dst, bias1); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif ++ ++dst; + c0 = c0 + dc2; + } + if (n & 1) { + DstTraits::store(c0, dst, bias0); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif + } + } + diff --git a/mozilla-sandbox-fips.patch b/mozilla-sandbox-fips.patch new file mode 100644 index 0000000..b442676 --- /dev/null +++ b/mozilla-sandbox-fips.patch @@ -0,0 +1,16 @@ +From: meissner@suse.com +Subject: allow Firefox to access addtional process information +Reference: http://bugzilla.suse.com/show_bug.cgi?id=1167132 + +Index: firefox-74.0/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +=================================================================== +--- firefox-74.0.orig/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp ++++ firefox-74.0/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +@@ -276,6 +276,7 @@ SandboxBrokerPolicyFactory::SandboxBroke + + // Read permissions + policy->AddPath(rdonly, "/dev/urandom"); ++ policy->AddPath(rdonly, "/proc/sys/crypto/fips_enabled"); + policy->AddPath(rdonly, "/proc/cpuinfo"); + policy->AddPath(rdonly, "/proc/meminfo"); + policy->AddDir(rdonly, "/sys/devices/cpu"); diff --git a/spellcheck.js b/spellcheck.js new file mode 100644 index 0000000..01cd0ee --- /dev/null +++ b/spellcheck.js @@ -0,0 +1 @@ +pref("spellchecker.dictionary_path", "/usr/share/myspell"); diff --git a/tar_stamps b/tar_stamps index 0f20d70..3125fa7 100644 --- a/tar_stamps +++ b/tar_stamps @@ -1,10 +1,10 @@ PRODUCT="thunderbird" -CHANNEL="esr68" -VERSION="68.12.0" +CHANNEL="esr78" +VERSION="78.3.1" VERSION_SUFFIX="" -PREV_VERSION="68.11.0" +PREV_VERSION="78.3.0" PREV_VERSION_SUFFIX="" #SKIP_LOCALES="" # Uncomment to skip l10n and compare-locales-generation -RELEASE_REPO="https://hg.mozilla.org/releases/comm-esr68" -RELEASE_TAG="b41cdff70b185358d9c4c1d4a36cfad15a24f001" -RELEASE_TIMESTAMP="20200820223055" +RELEASE_REPO="https://hg.mozilla.org/releases/comm-esr78" +RELEASE_TAG="00912779d73faef4277c57fe99aa5259b11d244d" +RELEASE_TIMESTAMP="20200925001233" diff --git a/thunderbird-68.12.0.source.tar.xz b/thunderbird-68.12.0.source.tar.xz deleted file mode 100644 index d8705e4..0000000 --- a/thunderbird-68.12.0.source.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8cf582d03125df86044626072c0d924d4b7c3e984d9228d62acdf4e9918eec02 -size 331226160 diff --git a/thunderbird-68.12.0.source.tar.xz.asc b/thunderbird-68.12.0.source.tar.xz.asc deleted file mode 100644 index 80df0e7..0000000 --- a/thunderbird-68.12.0.source.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEECXsxMHeuYqAvhNpN8aZmj7t9Vy4FAl9EFJgACgkQ8aZmj7t9 -Vy4iKg/8CyGoVX+9ZUYPKgOPwwhn4+mOnCufZ7ZisMVDSjh3jRyhgQ6pmaSsnwYs -aCeMjjf+hbA9zafXzQMFUTpQn5q3XvsZQ9StwWK+2U1vFN+MVZy3mtvrKm10E2i/ -jZRiimjg87z4aa50YgBoE/UMxN6SjR11Kx++skjxNeXRsdjfq2N3b/0KMvahduLQ -gmqfdMEJjS5SC/DF7wDGMlWIEz+IO7q/V4F7bJftNe5yYwLa2hvfyXZyCvFGT1uv -1QWu5B95/63j+e8QDgHaJ9KQJitPxOIEuqIdj/vQJzIM3EzcH01hirGkG3CGoO2U -pujprKASdp9Gvd8Hsjr8JOkp49mdzTb2/HiRa34Ubju3w4LB3r9ntOTVYZmU8bat -GN84Ks3Ts+NXT6D0MZ36YSiJ64NU5N6jeSPOEXUAwTMlURmumWu1YNAJv+q5n1X+ -XoElCG7pvad3J/9Q06RCST/6sGF7NtNXtTmH9ubhmsu4cE/7eWdBEs9u0j8nRL7L -5A9m+1Pw6nG5cktTb0VQyDgc9/BmebPlCrcicV9MBbE+NNNQSR3W3iaCLrDaBLXO -NG0GQrnDjjyscI+w+elkhmkl0X5qnOfuVkzzsQgmdfgFStS0D2HL8lpBbgyPhNSr -zoaiL2PcdCul7JwX0o0OQQvw6+nrkee+aBRU+onKKAdHAdIH2no= -=lUe0 ------END PGP SIGNATURE----- diff --git a/thunderbird-78.3.1.source.tar.xz b/thunderbird-78.3.1.source.tar.xz new file mode 100644 index 0000000..35768e8 --- /dev/null +++ b/thunderbird-78.3.1.source.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ea61f59a819f5a8a4574b0735952e23b4c86387b8da24906129c45e71bf2718 +size 353920472 diff --git a/thunderbird-78.3.1.source.tar.xz.asc b/thunderbird-78.3.1.source.tar.xz.asc new file mode 100644 index 0000000..27d0deb --- /dev/null +++ b/thunderbird-78.3.1.source.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEECXsxMHeuYqAvhNpN8aZmj7t9Vy4FAl9tXX0ACgkQ8aZmj7t9 +Vy6s0g/8CmgQtLeuA18WjZtV7yXMueTEYHVaqAVAKQz99aMUuvOc59GuZhPd8AIC +uaEv8tHSMJsphaIH1zR91c2fmBQitV00qr0Dn0TgV6BGhSXFecRlRR5c1syq+6wG +h4+9AzHVv9uqmXsfuTtChYOyyKv4BQOxT+zdkh4nioYQOUsFH7WvNA0pYW6Wj17O +6/u50boaLoXvN/RceJJ6oZ/PFa61MuYNSbakugzxCEKuuH0vAGjG/jwhBXvnhFY8 +y7Rv6XbL46STARV008uqUVHzfxOSFFJmQHx27iO1iDJWAfvQ5GFTKh/3K05egIGY +Xgib6nkacCd3Fo6nzkLiNL48KoyAAseS1t+JxxsG3Ixf4OjyEhb+X5o8JWGJ1Ojk +poe916mbig9rXMBOM/txNrwGCPsNhz7gTInF9P6B5LmEacNgEOX2hr6+vBLox4Ne +vvnOJr5ucltKP4lFItMugQ9y6UG78yPsXZ6MUUbxddR6S4nZ++bOBUqkzxqPZcPH +UqOqx+cBf4YBuud0hnSqnpwRKpE4vUCCM7NRphZxo2MAa04U6NPZ/ZWkUwkPYCZ7 +h/Up0Cn/wUkP7wJGFQIBn/e2wDj9i3I+MRqyMtAdb/Cs9vL5XIxR70hjiyFdJS// +36wryx5ogReHaMp5YL5hvRsWi6fStal82ff6ttLADRZXMfEsOM0= +=XToC +-----END PGP SIGNATURE-----