www/waterfox: Update 6.0.19 → 6.5.2

Changelog:
https://github.com/BrowserWorks/Waterfox/releases/tag/6.5.2

PR:	283318
MFH:	2024Q4
This commit is contained in:
Martin Filla 2024-12-21 03:46:31 +03:00 committed by Vladimir Druzenko
parent ffdb8bbeee
commit 9d5de596a2
29 changed files with 19204 additions and 20267 deletions

View File

@ -1,7 +1,5 @@
PORTNAME= waterfox
DISTVERSIONPREFIX= G
DISTVERSION= 6.0.19
PORTREVISION= 5
DISTVERSION= 6.5.2
PORTEPOCH= 1
CATEGORIES= www
@ -13,14 +11,14 @@ LICENSE= MPL20
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= nspr>=4.32:devel/nspr \
nss>=3.95:security/nss \
nss>=3.101:security/nss \
icu>=74.2:devel/icu \
libevent>=2.1.8:devel/libevent \
harfbuzz>=8.3.0:print/harfbuzz \
harfbuzz>=8.5.0:print/harfbuzz \
graphite2>=1.3.14:graphics/graphite2 \
png>=1.6.39:graphics/png \
png>=1.6.43:graphics/png \
dav1d>=1.0.0:multimedia/dav1d \
libvpx>=1.13.0:multimedia/libvpx \
libvpx>=1.14.0:multimedia/libvpx \
${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
v4l_compat>0:multimedia/v4l_compat \
autoconf2.13:devel/autoconf2.13 \
@ -32,6 +30,7 @@ USE_GECKO= gecko
USE_GITHUB= yes
GH_ACCOUNT= BrowserWorks
GH_PROJECT= Waterfox
GH_TUPLE= BrowserWorks:l10n:3046738:l10n/waterfox/browser/locales
USE_MOZILLA= -sqlite
# work around bindgen not finding ICU, e.g.

View File

@ -1,3 +1,5 @@
TIMESTAMP = 1725694141
SHA256 (BrowserWorks-Waterfox-G6.0.19_GH0.tar.gz) = bf8eeab7720c7ca14ceab4f1efbd884a4369b428048955bd8d76b47151478a3c
SIZE (BrowserWorks-Waterfox-G6.0.19_GH0.tar.gz) = 762556046
TIMESTAMP = 1734107781
SHA256 (BrowserWorks-Waterfox-6.5.2_GH0.tar.gz) = 33c8d47d5955f4e2f1568eb1ae2780b3d6e65ffab3ec145672dd29e0dbb1f122
SIZE (BrowserWorks-Waterfox-6.5.2_GH0.tar.gz) = 824023785
SHA256 (BrowserWorks-l10n-3046738_GH0.tar.gz) = f9a16202b73558188af3157d427845153a89b3f3b3269c1e5d8ebc9e60eb9bd1
SIZE (BrowserWorks-l10n-3046738_GH0.tar.gz) = 19480746

View File

@ -2,10 +2,10 @@ https://github.com/mozilla/addons/issues/708
https://github.com/mozilla/addons-frontend/issues/4610
diff --git browser/app/profile/firefox.js browser/app/profile/firefox.js
index 621900f90fc1..401ef9074bd0 100644
index 5964d40ca3a3..ed81b06af8d5 100644
--- browser/app/profile/firefox.js
+++ browser/app/profile/firefox.js
@@ -38,7 +38,7 @@ pref("extensions.postDownloadThirdPartyPrompt", true);
@@ -39,7 +39,7 @@ pref("extensions.postDownloadThirdPartyPrompt", true);
// Preferences for AMO integration
pref("extensions.getAddons.cache.enabled", true);
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v4/addons/search/?guid=%IDS%&lang=%LOCALE%");
@ -14,7 +14,7 @@ index 621900f90fc1..401ef9074bd0 100644
pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/firefox/");
pref("extensions.getAddons.langpacks.url", "https://services.addons.mozilla.org/api/v4/addons/language-tools/?app=firefox&type=language&appversion=%VERSION%");
pref("extensions.getAddons.discovery.api_url", "https://services.addons.mozilla.org/api/v4/discovery/?lang=%LOCALE%&edition=%DISTRIBUTION%");
@@ -204,8 +204,8 @@ pref("app.update.langpack.enabled", true);
@@ -214,8 +214,8 @@ pref("app.update.langpack.enabled", true);
// .. etc ..
//
pref("extensions.update.enabled", true);
@ -26,10 +26,10 @@ index 621900f90fc1..401ef9074bd0 100644
// Themes every day
diff --git toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs
index f906f244b658..7bb2eb6697c6 100644
index e854e04b3ce2..27e8247eb886 100644
--- toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs
+++ toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs
@@ -596,7 +596,7 @@ export var AddonRepository = {
@@ -715,7 +715,7 @@ export var AddonRepository = {
addon.version = String(aEntry.current_version.version);
if (Array.isArray(aEntry.current_version.files)) {
for (let file of aEntry.current_version.files) {
@ -38,11 +38,11 @@ index f906f244b658..7bb2eb6697c6 100644
if (file.url) {
addon.sourceURI = lazy.NetUtil.newURI(file.url);
}
diff --git toolkit/mozapps/extensions/internal/XPIDatabase.jsm toolkit/mozapps/extensions/internal/XPIDatabase.jsm
index 03186dad43a4..4053fc6f2702 100644
--- toolkit/mozapps/extensions/internal/XPIDatabase.jsm
+++ toolkit/mozapps/extensions/internal/XPIDatabase.jsm
@@ -634,7 +634,7 @@ class AddonInternal {
diff --git toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
index 5d1d2c19706b..4dcba06a95f4 100644
--- toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
+++ toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs
@@ -632,7 +632,7 @@ export class AddonInternal {
// Something is causing errors in here
try {
for (let platform of this.targetPlatforms) {

View File

@ -1,12 +1,14 @@
--- browser/app/nsBrowserApp.cpp.orig 2016-09-19 16:19:28 UTC
diff --git browser/app/nsBrowserApp.cpp browser/app/nsBrowserApp.cpp
index 87c2e16..a41f1d9 100644
--- browser/app/nsBrowserApp.cpp
+++ browser/app/nsBrowserApp.cpp
@@ -324,6 +324,9 @@ int main(int argc, char* argv[], char* e
{
mozilla::TimeStamp start = mozilla::TimeStamp::Now();
@@ -337,6 +337,9 @@ int main(int argc, char* argv[], char* envp[]) {
}
#endif
+ setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
+ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
+
#ifdef HAS_DLL_BLOCKLIST
DllBlocklist_Initialize();
DllBlocklist_Initialize(gBlocklistInitFlags);
#endif

View File

@ -1,6 +1,6 @@
--- browser/installer/package-manifest.in.orig 2024-04-30 12:34:17 UTC
--- browser/installer/package-manifest.in.orig 2024-11-25 17:39:16 UTC
+++ browser/installer/package-manifest.in
@@ -227,13 +227,13 @@
@@ -215,13 +215,13 @@
@RESPATH@/chrome/toolkit.manifest
#ifdef MOZ_GTK
@RESPATH@/browser/chrome/icons/default/default16.png

View File

@ -1,10 +0,0 @@
--- modules/libpref/Preferences.cpp.orig 2023-05-11 21:42:41 UTC
+++ modules/libpref/Preferences.cpp
@@ -6126,6 +6126,7 @@ static const PrefListEntry sDynamicPrefOverrideList[]{
PREF_LIST_ENTRY("logging.config.LOG_FILE"),
PREF_LIST_ENTRY("media.audio_loopback_dev"),
PREF_LIST_ENTRY("media.decoder-doctor."),
+ PREF_LIST_ENTRY("media.cubeb.backend"),
PREF_LIST_ENTRY("media.cubeb.output_device"),
PREF_LIST_ENTRY("media.getusermedia.fake-camera-name"),
PREF_LIST_ENTRY("media.hls.server.url"),

View File

@ -1,20 +1,19 @@
commit 717bba28411c
Author: Jory A. Pratt <anarchy@gentoo.org>
Date: Thu Jun 13 11:53:00 2019 -0700
commit 25a5572d5cd137aa6d893e09a00bd39908a59a18
Author: Christoph Moench-Tegeder <cmt@burggraben.net>
Date: Tue Sep 10 22:23:32 2024 +0200
Bug 1559213 - Allow to use system av1 libs instead of bundled.
---
config/external/moz.build | 5 +++--
config/system-headers.mozbuild | 8 ++++++++
dom/media/platforms/moz.build | 5 +++++
toolkit/moz.configure | 19 ++++++++++++++++++-
4 files changed, 34 insertions(+), 3 deletions(-)
based on:
commit 717bba28411c
Author: Jory A. Pratt <anarchy@gentoo.org>
Date: Thu Jun 13 11:53:00 2019 -0700
Bug 1559213 - Allow to use system av1 libs instead of bundled.
diff --git config/external/moz.build config/external/moz.build
index ab77121..75595d9 100644
index a24b470396cf..547f5f5c9e04 100644
--- config/external/moz.build
+++ config/external/moz.build
@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
@@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
external_dirs += ["media/libvpx"]
if CONFIG["MOZ_AV1"]:
@ -26,30 +25,11 @@ index ab77121..75595d9 100644
if not CONFIG["MOZ_SYSTEM_PNG"]:
external_dirs += ["media/libpng"]
diff --git config/system-headers.mozbuild config/system-headers.mozbuild
index a1b58eb..65729f9 100644
--- config/system-headers.mozbuild
+++ config/system-headers.mozbuild
@@ -1289,6 +1289,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
'proxy.h',
]
+if CONFIG['MOZ_SYSTEM_AV1']:
+ system_headers += [
+ 'aom/aom_decoder.h',
+ 'aom/aomdx.h',
+ 'aom/aom_image.h',
+ 'dav1d/dav1d.h',
+ ]
+
if CONFIG['MOZ_SYSTEM_LIBVPX']:
system_headers += [
'vpx_mem/vpx_mem.h',
diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build
index 8509aec..eb6f129 100644
index 61536cc6e225..29cf635bbb44 100644
--- dom/media/platforms/moz.build
+++ dom/media/platforms/moz.build
@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
@@ -71,6 +71,11 @@ if CONFIG["MOZ_AV1"]:
"agnostic/AOMDecoder.cpp",
"agnostic/DAV1DDecoder.cpp",
]
@ -62,33 +42,61 @@ index 8509aec..eb6f129 100644
if CONFIG["MOZ_OMX"]:
EXPORTS += [
diff --git media/ffvpx/libavcodec/moz.build media/ffvpx/libavcodec/moz.build
index 0069865..e806fc8 100644
--- media/ffvpx/libavcodec/moz.build.orig
index 6f09049a6068..90a82a19a9d1 100644
--- media/ffvpx/libavcodec/moz.build
+++ media/ffvpx/libavcodec/moz.build
@@ -108,10 +108,14 @@
'vp9prob.c',
'vp9recon.c'
@@ -119,10 +119,16 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
'vp9recon.c',
'vpx_rac.c',
]
- USE_LIBS += [
- 'dav1d',
- 'media_libdav1d_asm',
- ]
+ if CONFIG["MOZ_SYSTEM_AV1"]:
+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS']
+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS']
+ else:
+ USE_LIBS += [
+ 'dav1d',
+ 'media_libdav1d_asm',
+ ]
if CONFIG['MOZ_WAYLAND']:
+ USE_LIBS += [
+ 'dav1d',
+ 'media_libdav1d_asm',
+ ]
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
LOCAL_INCLUDES += ['/media/mozva']
SOURCES += [
diff --git media/libopus/moz.build media/libopus/moz.build
index 943aee79ee99..4ad07e3e98af 100644
--- media/libopus/moz.build
+++ media/libopus/moz.build
@@ -58,7 +58,7 @@ if not CONFIG["MOZ_SAMPLE_TYPE_FLOAT32"]:
DEFINES["FIXED_POINT"] = 1
DEFINES["DISABLE_FLOAT_API"] = True
-if CONFIG["OS_ARCH"] == "Linux":
+if CONFIG["OS_ARCH"] in ("FreeBSD", "Linux"):
OS_LIBS += [
"m",
]
diff --git media/libvorbis/moz.build media/libvorbis/moz.build
index cd17d4f89759..816edd72a000 100644
--- media/libvorbis/moz.build
+++ media/libvorbis/moz.build
@@ -45,7 +45,7 @@ LOCAL_INCLUDES += ['lib']
if CONFIG['OS_ARCH'] == 'SunOS':
DEFINES['HAVE_ALLOCA_H'] = True
-if CONFIG["OS_ARCH"] == "Linux":
+if CONFIG["OS_ARCH"] in ("FreeBSD", "Linux"):
OS_LIBS += [
"m",
]
diff --git toolkit/moz.configure toolkit/moz.configure
index 0069865..e806fc8 100644
index 1f85d2831f2f..07294b93f850 100644
--- toolkit/moz.configure
+++ toolkit/moz.configure
@@ -523,7 +523,23 @@ def av1(value):
@@ -883,7 +883,23 @@ def av1(value):
return True
@ -113,7 +121,7 @@ index 0069865..e806fc8 100644
def dav1d_asm(target):
if target.cpu in ("aarch64", "x86", "x86_64"):
return True
@@ -539,6 +555,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
@@ -899,6 +915,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
set_define("MOZ_DAV1D_ASM", dav1d_asm)
set_config("MOZ_AV1", av1)
set_define("MOZ_AV1", av1)

View File

@ -9,10 +9,11 @@ https://bug1626236.bmoattachments.org/attachment.cgi?id=9137096
# Parent 9cd90914846f667f18babc491a74c164ae5d6e9f
imported patch decoder_workaround.patch
diff -r 9cd90914846f image/decoders/nsGIFDecoder2.cpp
--- image/decoders/nsGIFDecoder2.cpp Thu Feb 27 12:57:14 2020 +0100
+++ image/decoders/nsGIFDecoder2.cpp Fri Mar 27 13:06:18 2020 +0100
@@ -422,6 +422,9 @@
diff --git image/decoders/nsGIFDecoder2.cpp image/decoders/nsGIFDecoder2.cpp
index ebb0b7d..d52ef47 100644
--- image/decoders/nsGIFDecoder2.cpp
+++ image/decoders/nsGIFDecoder2.cpp
@@ -422,6 +422,9 @@ void nsGIFDecoder2::ConvertColormap(uint32_t* aColormap, uint32_t aColors) {
MOZ_ASSERT(mSwizzleFn);
uint8_t* data = reinterpret_cast<uint8_t*>(aColormap);
mSwizzleFn(data, data, aColors);
@ -22,10 +23,11 @@ diff -r 9cd90914846f image/decoders/nsGIFDecoder2.cpp
}
LexerResult nsGIFDecoder2::DoDecode(SourceBufferIterator& aIterator,
diff -r 9cd90914846f image/decoders/nsJPEGDecoder.cpp
--- image/decoders/nsJPEGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100
+++ image/decoders/nsJPEGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100
@@ -263,6 +263,9 @@
diff --git image/decoders/nsJPEGDecoder.cpp image/decoders/nsJPEGDecoder.cpp
index 9ea4403..d82772c 100644
--- image/decoders/nsJPEGDecoder.cpp
+++ image/decoders/nsJPEGDecoder.cpp
@@ -257,6 +257,9 @@ LexerTransition<nsJPEGDecoder::State> nsJPEGDecoder::ReadJPEGData(
case JCS_YCbCr:
// By default, we will output directly to BGRA. If we need to apply
// special color transforms, this may change.
@ -35,7 +37,7 @@ diff -r 9cd90914846f image/decoders/nsJPEGDecoder.cpp
switch (SurfaceFormat::OS_RGBX) {
case SurfaceFormat::B8G8R8X8:
mInfo.out_color_space = JCS_EXT_BGRX;
@@ -277,6 +280,7 @@
@@ -271,6 +274,7 @@ LexerTransition<nsJPEGDecoder::State> nsJPEGDecoder::ReadJPEGData(
mState = JPEG_ERROR;
return Transition::TerminateFailure();
}
@ -43,10 +45,11 @@ diff -r 9cd90914846f image/decoders/nsJPEGDecoder.cpp
break;
case JCS_CMYK:
case JCS_YCCK:
diff -r 9cd90914846f image/decoders/nsPNGDecoder.cpp
--- image/decoders/nsPNGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100
+++ image/decoders/nsPNGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100
@@ -361,7 +361,7 @@
diff --git image/decoders/nsPNGDecoder.cpp image/decoders/nsPNGDecoder.cpp
index e3e4ef4..3cc7315 100644
--- image/decoders/nsPNGDecoder.cpp
+++ image/decoders/nsPNGDecoder.cpp
@@ -356,7 +356,7 @@ LexerResult nsPNGDecoder::DoDecode(SourceBufferIterator& aIterator,
IResumable* aOnResume) {
MOZ_ASSERT(!HasError(), "Shouldn't call DoDecode after error!");
@ -55,7 +58,7 @@ diff -r 9cd90914846f image/decoders/nsPNGDecoder.cpp
[=](State aState, const char* aData, size_t aLength) {
switch (aState) {
case State::PNG_DATA:
@@ -371,6 +371,14 @@
@@ -366,6 +366,14 @@ LexerResult nsPNGDecoder::DoDecode(SourceBufferIterator& aIterator,
}
MOZ_CRASH("Unknown State");
});
@ -70,10 +73,11 @@ diff -r 9cd90914846f image/decoders/nsPNGDecoder.cpp
}
LexerTransition<nsPNGDecoder::State> nsPNGDecoder::ReadPNGData(
diff -r 9cd90914846f image/decoders/nsWebPDecoder.cpp
--- image/decoders/nsWebPDecoder.cpp Thu Feb 27 12:57:14 2020 +0100
+++ image/decoders/nsWebPDecoder.cpp Fri Mar 27 13:06:18 2020 +0100
@@ -237,7 +237,12 @@
diff --git image/decoders/nsWebPDecoder.cpp image/decoders/nsWebPDecoder.cpp
index e58ca92..2056ebb 100644
--- image/decoders/nsWebPDecoder.cpp
+++ image/decoders/nsWebPDecoder.cpp
@@ -247,7 +247,12 @@ nsresult nsWebPDecoder::CreateFrame(const OrientedIntRect& aFrameRect) {
// 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.

View File

@ -1,32 +0,0 @@
Don't pass --target when CC/CXX contains clang
diff --git third_party/rust/cc/src/lib.rs third_party/rust/cc/src/lib.rs
index 9d133a0..273e520 100644
--- third_party/rust/cc/src/lib.rs
+++ third_party/rust/cc/src/lib.rs
@@ -2667,24 +2667,7 @@ impl Tool {
}
fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self {
- // Try to detect family of the tool from its name, falling back to Gnu.
- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) {
- if fname.contains("clang-cl") {
- ToolFamily::Msvc { clang_cl: true }
- } else if fname.ends_with("cl") || fname == "cl.exe" {
- ToolFamily::Msvc { clang_cl: false }
- } else if fname.contains("clang") {
- match clang_driver {
- Some("cl") => ToolFamily::Msvc { clang_cl: true },
- _ => ToolFamily::Clang,
- }
- } else {
- ToolFamily::Gnu
- }
- } else {
- ToolFamily::Gnu
- };
-
+ let family = ToolFamily::Gnu;
Tool {
path: path,
cc_wrapper_path: None,

View File

@ -1,388 +0,0 @@
commit 3204512f58a1
Author: Greg V <greg@unrelenting.technology>
Date: Sun Dec 6 22:07:00 2020 +0000
Bug 1680982 - Use evdev instead of the Linux legacy joystick API for gamepads
Using evdev is a prerequisite for adding rumble (haptic feedback) and LED support.
- BTN_GAMEPAD semantic buttons are interpreted directly,
since all kernel drivers are supposed to use them correctly:
https://www.kernel.org/doc/html/latest/input/gamepad.html
- BTN_JOYSTICK legacy style numbered buttons use the model specific remappers
- we support even strange devices that combine both styles in one device
- the Linux gamepad module is enabled on FreeBSD and DragonFly, because
these kernels provide evdev, and libudev-devd provides enough of libudev
(evdev headers are provided by the devel/evdev-proto package)
Differential Revision: https://phabricator.services.mozilla.com/D98868
---
dom/gamepad/linux/LinuxGamepad.cpp | 262 ++++++++++++++++++++++++++++++++-----
dom/gamepad/moz.build | 2 +-
2 files changed, 229 insertions(+), 35 deletions(-)
diff --git dom/gamepad/linux/LinuxGamepad.cpp dom/gamepad/linux/LinuxGamepad.cpp
index deee47b9d267..31f0aad7ae4a 100644
--- dom/gamepad/linux/LinuxGamepad.cpp
+++ dom/gamepad/linux/LinuxGamepad.cpp
@@ -5,15 +5,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
- * LinuxGamepadService: A Linux backend for the GamepadService.
- * Derived from the kernel documentation at
- * http://www.kernel.org/doc/Documentation/input/joystick-api.txt
+ * LinuxGamepadService: An evdev backend for the GamepadService.
+ *
+ * Ref: https://www.kernel.org/doc/html/latest/input/gamepad.html
*/
#include <algorithm>
+#include <unordered_map>
#include <cstddef>
#include <glib.h>
-#include <linux/joystick.h>
+#include <linux/input.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/ioctl.h>
@@ -21,10 +22,14 @@
#include "nscore.h"
#include "mozilla/dom/GamepadHandle.h"
#include "mozilla/dom/GamepadPlatformService.h"
+#include "mozilla/dom/GamepadRemapping.h"
#include "mozilla/Tainting.h"
#include "mozilla/UniquePtr.h"
#include "udev.h"
+#define LONG_BITS (sizeof(long) * 8)
+#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
+
namespace {
using namespace mozilla::dom;
@@ -36,19 +41,29 @@ using mozilla::udev_list_entry;
using mozilla::udev_monitor;
using mozilla::UniquePtr;
-static const float kMaxAxisValue = 32767.0;
-static const char kJoystickPath[] = "/dev/input/js";
+static const char kEvdevPath[] = "/dev/input/event";
+
+static inline bool TestBit(const unsigned long* arr, int bit) {
+ return !!(arr[bit / LONG_BITS] & (1LL << (bit % LONG_BITS)));
+}
+
+static inline double ScaleAxis(const input_absinfo& info, int value) {
+ return 2.0 * (value - info.minimum) / (double)(info.maximum - info.minimum) -
+ 1.0;
+}
// TODO: should find a USB identifier for each device so we can
// provide something that persists across connect/disconnect cycles.
-typedef struct {
+struct Gamepad {
GamepadHandle handle;
- guint source_id;
- int numAxes;
- int numButtons;
- char idstring[256];
- char devpath[PATH_MAX];
-} Gamepad;
+ RefPtr<GamepadRemapper> remapper = nullptr;
+ guint source_id = UINT_MAX;
+ char idstring[256] = {0};
+ char devpath[PATH_MAX] = {0};
+ uint8_t key_map[KEY_MAX] = {0};
+ uint8_t abs_map[ABS_MAX] = {0};
+ std::unordered_map<uint16_t, input_absinfo> abs_info;
+};
class LinuxGamepadService {
public:
@@ -66,7 +81,7 @@ class LinuxGamepadService {
bool is_gamepad(struct udev_device* dev);
void ReadUdevChange();
- // handler for data from /dev/input/jsN
+ // handler for data from /dev/input/eventN
static gboolean OnGamepadData(GIOChannel* source, GIOCondition condition,
gpointer data);
@@ -114,8 +129,14 @@ void LinuxGamepadService::AddDevice(struct udev_device* dev) {
g_io_channel_set_encoding(channel, nullptr, nullptr);
g_io_channel_set_buffered(channel, FALSE);
int fd = g_io_channel_unix_get_fd(channel);
+
+ struct input_id id {};
+ if (ioctl(fd, EVIOCGID, &id) == -1) {
+ return;
+ }
+
char name[128];
- if (ioctl(fd, JSIOCGNAME(sizeof(name)), &name) == -1) {
+ if (ioctl(fd, EVIOCGNAME(sizeof(name)), &name) == -1) {
strcpy(name, "unknown");
}
const char* vendor_id =
@@ -131,20 +152,86 @@ void LinuxGamepadService::AddDevice(struct udev_device* dev) {
model_id = mUdev.udev_device_get_sysattr_value(parent, "id/product");
}
}
+ if (!vendor_id && id.vendor != 0) {
+ vendor_id = (const char*)alloca(5);
+ snprintf((char*)vendor_id, 5, "%04x", id.vendor);
+ }
+ if (!model_id && id.product != 0) {
+ model_id = (const char*)alloca(5);
+ snprintf((char*)model_id, 5, "%04x", id.product);
+ }
snprintf(gamepad->idstring, sizeof(gamepad->idstring), "%s-%s-%s",
vendor_id ? vendor_id : "unknown", model_id ? model_id : "unknown",
name);
char numAxes = 0, numButtons = 0;
- ioctl(fd, JSIOCGAXES, &numAxes);
- gamepad->numAxes = numAxes;
- ioctl(fd, JSIOCGBUTTONS, &numButtons);
- gamepad->numButtons = numButtons;
+ unsigned long key_bits[NLONGS(KEY_CNT)] = {0};
+ unsigned long abs_bits[NLONGS(ABS_CNT)] = {0};
+ ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), key_bits);
+ ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits);
+
+ /* Here, we try to support even strange cases where proper semantic
+ * BTN_GAMEPAD button are combined with arbitrary extra buttons. */
+ for (uint16_t i = BTN_JOYSTICK; i < KEY_MAX; i++) {
+ /* Do not map semantic buttons, they are handled directly */
+ if (i == BTN_GAMEPAD) {
+ i = BTN_THUMBR + 1;
+ continue;
+ }
+ if (i == BTN_DPAD_UP) {
+ i = BTN_DPAD_RIGHT + 1;
+ continue;
+ }
+ if (TestBit(key_bits, i)) {
+ gamepad->key_map[i] = numButtons++;
+ }
+ }
+ for (uint16_t i = 0; i < BTN_JOYSTICK; i++) {
+ if (TestBit(key_bits, i)) {
+ gamepad->key_map[i] = numButtons++;
+ }
+ }
+ for (uint16_t i = BTN_GAMEPAD; i <= BTN_THUMBR; i++) {
+ /* But if any semantic event exists, count them all */
+ if (TestBit(key_bits, i)) {
+ numButtons += BUTTON_INDEX_COUNT;
+ break;
+ }
+ }
+ for (uint16_t i = 0; i < ABS_MAX; ++i) {
+ if (TestBit(abs_bits, i)) {
+ gamepad->abs_info.emplace(i, input_absinfo{});
+ if (ioctl(fd, EVIOCGABS(i), &gamepad->abs_info[i]) < 0) {
+ continue;
+ }
+ if (gamepad->abs_info[i].minimum == gamepad->abs_info[i].maximum) {
+ gamepad->abs_info.erase(i);
+ continue;
+ }
+ gamepad->abs_map[i] = numAxes++;
+ }
+ }
+
+ if (numAxes == 0) {
+ NS_WARNING("Gamepad with zero axes detected?");
+ }
+ if (numButtons == 0) {
+ NS_WARNING("Gamepad with zero buttons detected?");
+ }
+
+ bool defaultRemapper = false;
+ RefPtr<GamepadRemapper> remapper =
+ GetGamepadRemapper(id.vendor, id.product, defaultRemapper);
+ MOZ_ASSERT(remapper);
+ remapper->SetAxisCount(numAxes);
+ remapper->SetButtonCount(numButtons);
gamepad->handle = service->AddGamepad(
- gamepad->idstring, mozilla::dom::GamepadMappingType::_empty,
- mozilla::dom::GamepadHand::_empty, gamepad->numButtons, gamepad->numAxes,
- 0, 0, 0); // TODO: Bug 680289, implement gamepad haptics for Linux.
+ gamepad->idstring, remapper->GetMappingType(), GamepadHand::_empty,
+ remapper->GetButtonCount(), remapper->GetAxisCount(), 0,
+ remapper->GetLightIndicatorCount(), remapper->GetTouchEventCount());
+ gamepad->remapper = remapper.forget();
+ // TODO: Bug 680289, implement gamepad haptics for Linux.
// TODO: Bug 1523355, implement gamepad lighindicator and touch for Linux.
gamepad->source_id =
@@ -257,7 +344,7 @@ bool LinuxGamepadService::is_gamepad(struct udev_device* dev) {
if (!devpath) {
return false;
}
- if (strncmp(kJoystickPath, devpath, sizeof(kJoystickPath) - 1) != 0) {
+ if (strncmp(kEvdevPath, devpath, sizeof(kEvdevPath) - 1) != 0) {
return false;
}
@@ -292,7 +379,7 @@ gboolean LinuxGamepadService::OnGamepadData(GIOChannel* source,
if (condition & G_IO_ERR || condition & G_IO_HUP) return FALSE;
while (true) {
- struct js_event event;
+ struct input_event event {};
gsize count;
GError* err = nullptr;
if (g_io_channel_read_chars(source, (gchar*)&event, sizeof(event), &count,
@@ -301,18 +388,125 @@ gboolean LinuxGamepadService::OnGamepadData(GIOChannel* source,
break;
}
- // TODO: store device state?
- if (event.type & JS_EVENT_INIT) {
- continue;
- }
-
switch (event.type) {
- case JS_EVENT_BUTTON:
- service->NewButtonEvent(gamepad->handle, event.number, !!event.value);
+ case EV_KEY:
+ switch (event.code) {
+ /* The gamepad events are meaningful, and according to
+ * https://www.kernel.org/doc/html/latest/input/gamepad.html
+ * "No other devices, that do not look/feel like a gamepad, shall
+ * report these events" */
+ case BTN_SOUTH:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_PRIMARY,
+ !!event.value);
+ break;
+ case BTN_EAST:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_SECONDARY,
+ !!event.value);
+ break;
+ case BTN_NORTH:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_QUATERNARY,
+ !!event.value);
+ break;
+ case BTN_WEST:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_TERTIARY,
+ !!event.value);
+ break;
+ case BTN_TL:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_LEFT_SHOULDER,
+ !!event.value);
+ break;
+ case BTN_TR:
+ service->NewButtonEvent(gamepad->handle,
+ BUTTON_INDEX_RIGHT_SHOULDER, !!event.value);
+ break;
+ case BTN_TL2:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_LEFT_TRIGGER,
+ !!event.value);
+ break;
+ case BTN_TR2:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_RIGHT_TRIGGER,
+ !!event.value);
+ break;
+ case BTN_SELECT:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_BACK_SELECT,
+ !!event.value);
+ break;
+ case BTN_START:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_START,
+ !!event.value);
+ break;
+ case BTN_MODE:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_META,
+ !!event.value);
+ break;
+ case BTN_THUMBL:
+ service->NewButtonEvent(
+ gamepad->handle, BUTTON_INDEX_LEFT_THUMBSTICK, !!event.value);
+ break;
+ case BTN_THUMBR:
+ service->NewButtonEvent(
+ gamepad->handle, BUTTON_INDEX_RIGHT_THUMBSTICK, !!event.value);
+ break;
+ case BTN_DPAD_UP:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_UP,
+ !!event.value);
+ break;
+ case BTN_DPAD_DOWN:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_DOWN,
+ !!event.value);
+ break;
+ case BTN_DPAD_LEFT:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_LEFT,
+ !!event.value);
+ break;
+ case BTN_DPAD_RIGHT:
+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_RIGHT,
+ !!event.value);
+ break;
+ default:
+ /* For non-gamepad events, this is the "anything goes" numbered
+ * handling that should be handled with remappers. */
+ gamepad->remapper->RemapButtonEvent(
+ gamepad->handle, gamepad->key_map[event.code], !!event.value);
+ break;
+ }
break;
- case JS_EVENT_AXIS:
- service->NewAxisMoveEvent(gamepad->handle, event.number,
- ((float)event.value) / kMaxAxisValue);
+ case EV_ABS:
+ if (!gamepad->abs_info.count(event.code)) continue;
+ switch (event.code) {
+ case ABS_HAT0X:
+ service->NewButtonEvent(
+ gamepad->handle, BUTTON_INDEX_DPAD_LEFT,
+ AxisNegativeAsButton(
+ ScaleAxis(gamepad->abs_info[event.code], event.value)));
+ service->NewButtonEvent(
+ gamepad->handle, BUTTON_INDEX_DPAD_RIGHT,
+ AxisPositiveAsButton(
+ ScaleAxis(gamepad->abs_info[event.code], event.value)));
+ break;
+ case ABS_HAT0Y:
+ service->NewButtonEvent(
+ gamepad->handle, BUTTON_INDEX_DPAD_UP,
+ AxisNegativeAsButton(
+ ScaleAxis(gamepad->abs_info[event.code], event.value)));
+ service->NewButtonEvent(
+ gamepad->handle, BUTTON_INDEX_DPAD_DOWN,
+ AxisPositiveAsButton(
+ ScaleAxis(gamepad->abs_info[event.code], event.value)));
+ break;
+ case ABS_HAT1X:
+ case ABS_HAT1Y:
+ case ABS_HAT2X:
+ case ABS_HAT2Y:
+ case ABS_HAT3X:
+ case ABS_HAT3Y:
+ break;
+ default:
+ gamepad->remapper->RemapAxisMoveEvent(
+ gamepad->handle, gamepad->abs_map[event.code],
+ ScaleAxis(gamepad->abs_info[event.code], event.value));
+ break;
+ }
break;
}
}
diff --git dom/gamepad/moz.build dom/gamepad/moz.build
index 5f55d5a95e96..544b7f927736 100644
--- dom/gamepad/moz.build
+++ dom/gamepad/moz.build
@@ -59,7 +59,7 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
UNIFIED_SOURCES += ["windows/WindowsGamepad.cpp"]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
UNIFIED_SOURCES += ["android/AndroidGamepad.cpp"]
-elif CONFIG["OS_ARCH"] == "Linux":
+elif CONFIG["OS_ARCH"] in ("Linux", "FreeBSD", "DragonFly"):
UNIFIED_SOURCES += ["linux/LinuxGamepad.cpp"]
else:
UNIFIED_SOURCES += ["fallback/FallbackGamepad.cpp"]

View File

@ -1,75 +0,0 @@
commit 54ebf78999815570c3cd4d94bf00daa7dec6061d
Author: Mike Hommey <mh+mozilla@glandium.org>
Date: Thu Jul 6 02:34:07 2023 +0000
Bug 1841919 - Fix "variable does not need to be mutable" warnings in webrender. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D182851
diff --git gfx/wr/webrender/src/compositor/sw_compositor.rs gfx/wr/webrender/src/compositor/sw_compositor.rs
index e623870c86f3..854fef6fe2b9 100644
--- gfx/wr/webrender/src/compositor/sw_compositor.rs
+++ gfx/wr/webrender/src/compositor/sw_compositor.rs
@@ -1026,7 +1026,7 @@ impl SwCompositor {
if let Some(surface) = self.surfaces.get_mut(id) {
if let Some(external_image) = surface.external_image {
assert!(!surface.tiles.is_empty());
- let mut tile = &mut surface.tiles[0];
+ let tile = &mut surface.tiles[0];
if let Some(info) = self.composite_surfaces.get(&external_image) {
tile.valid_rect = DeviceIntRect::from_size(info.size);
return;
diff --git gfx/wr/webrender/src/picture.rs gfx/wr/webrender/src/picture.rs
index bd685d48a113..72c0e1efa038 100644
--- gfx/wr/webrender/src/picture.rs
+++ gfx/wr/webrender/src/picture.rs
@@ -2888,7 +2888,7 @@ impl TileCacheInstance {
let prim_clip_chain = &prim_instance.vis.clip_chain;
// Accumulate the exact (clipped) local rect in to the parent surface
- let mut surface = &mut surfaces[prim_surface_index.0];
+ let surface = &mut surfaces[prim_surface_index.0];
surface.clipped_local_rect = surface.clipped_local_rect.union(&prim_clip_chain.pic_coverage_rect);
// If the primitive is directly drawn onto this picture cache surface, then
diff --git gfx/wr/webrender_api/src/display_item_cache.rs gfx/wr/webrender_api/src/display_item_cache.rs
index 6cd1eb3e3a44..60d41c591d36 100644
--- gfx/wr/webrender_api/src/display_item_cache.rs
+++ gfx/wr/webrender_api/src/display_item_cache.rs
@@ -58,13 +58,13 @@ pub struct DisplayItemCache {
impl DisplayItemCache {
fn add_item(&mut self, key: ItemKey, item: CachedDisplayItem) {
- let mut entry = &mut self.entries[key as usize];
+ let entry = &mut self.entries[key as usize];
entry.items.push(item);
entry.occupied = true;
}
fn clear_entry(&mut self, key: ItemKey) {
- let mut entry = &mut self.entries[key as usize];
+ let entry = &mut self.entries[key as usize];
entry.items.clear();
entry.occupied = false;
}
commit 8300555a01bdcc478ae103dcf2b469bf24e4dd41
Author: Mike Hommey <mh+mozilla@glandium.org>
Date: Thu Jul 6 04:26:41 2023 +0000
Bug 1841919 - Fix "variable does not need to be mutable" warning in wrench. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D182858
diff --git gfx/wr/wrench/src/reftest.rs gfx/wr/wrench/src/reftest.rs
index 136a4477205d..0e900224b883 100644
--- gfx/wr/wrench/src/reftest.rs
+++ gfx/wr/wrench/src/reftest.rs
@@ -514,7 +514,7 @@ impl ReftestManifest {
max_difference: options.allow_max_difference,
num_differences: options.allow_num_differences }),
1 => {
- let mut fuzzy = &mut fuzziness[0];
+ let fuzzy = &mut fuzziness[0];
fuzzy.max_difference = cmp::max(fuzzy.max_difference, options.allow_max_difference);
fuzzy.num_differences = cmp::max(fuzzy.num_differences, options.allow_num_differences);
},

View File

@ -1,34 +0,0 @@
commit 627cc80defb3fa48e82ce656536d666176b9f8d1
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Sat Jan 13 14:35:33 2024 +0000
Bug 1873379 - Ignore std::tuple harder. r=firefox-style-system-reviewers,zrhoffman
In libc++ 18 it seems to be in a nested namespace. Make sure to account
for that.
Differential Revision: https://phabricator.services.mozilla.com/D198398
diff --git layout/style/ServoBindings.toml layout/style/ServoBindings.toml
index 2aea31f8f911..2deafbfb14b6 100644
--- layout/style/ServoBindings.toml
+++ layout/style/ServoBindings.toml
@@ -366,6 +366,9 @@ opaque-types = [
"std::namespace::atomic___base", "std::atomic__My_base",
"std::atomic",
"std::atomic___base",
+ "std::tuple.*", # Causes "Cannot find type _Pred in this scope" error on mac, like rust-skia#571
+ "std::.*::tuple.*",
+
# We want everything but FontVariation and Float to be opaque but we don't
# have negative regexes.
"mozilla::gfx::(.{0,4}|.{6,12}|.{14,}|([^F][^o][^n][^t][^V][^a][^r][^i][^a][^t][^i][^o][^n])|([^F][^l][^o][^a][^t]))",
@@ -391,8 +394,6 @@ opaque-types = [
# for clang.
"mozilla::SeenPtrs",
"mozilla::SupportsWeakPtr",
- "std::tuple",
- "std::tuple_.*", # Causes "Cannot find type _Pred in this scope" error on mac, like rust-skia#571
"SupportsWeakPtr",
"mozilla::detail::WeakReference",
"mozilla::WeakPtr",

View File

@ -0,0 +1,23 @@
commit 46a89fb0319d673b3139a068e3d89aed9f44fc16
Author: Christoph Moench-Tegeder <cmt@burggraben.net>
use gdk legacy cursor interface by default
Upstream https://bugzilla.mozilla.org/show_bug.cgi?id=1876366#c16
hints that we could re-test this once we have GTK 3.24.42 (with the
now-current gtk3-3.24.41 the original problem is still reproducable,
but toggling this flag does fix it for me)
diff --git modules/libpref/init/StaticPrefList.yaml modules/libpref/init/StaticPrefList.yaml
index 835450712a12..f2249006c36d 100644
--- modules/libpref/init/StaticPrefList.yaml
+++ modules/libpref/init/StaticPrefList.yaml
@@ -16070,7 +16070,7 @@
# Whether to use gtk legacy cursor API.
- name: widget.gtk.legacy-cursors.enabled
type: bool
- value: false
+ value: true
mirror: always
# Whether to use gtk high contrast themes to disable content styling like on

View File

@ -1,11 +1,11 @@
# Allow building against system-wide graphite2/harfbuzz.
diff --git config/system-headers.mozbuild config/system-headers.mozbuild
index a1b58eb..a0a0943 100644
index 0c06f581b33b..10f125be25ab 100644
--- config/system-headers.mozbuild
+++ config/system-headers.mozbuild
@@ -1289,6 +1289,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
'proxy.h',
@@ -1307,6 +1307,19 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]:
"proxy.h",
]
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
@ -21,14 +21,14 @@ index a1b58eb..a0a0943 100644
+ 'harfbuzz/hb.h',
+ ]
+
if CONFIG['MOZ_SYSTEM_LIBVPX']:
if CONFIG["MOZ_SYSTEM_ICU"]:
system_headers += [
'vpx_mem/vpx_mem.h',
"unicode/calendar.h",
diff --git dom/base/moz.build dom/base/moz.build
index d390adf..4508f19 100644
index 14c9f9dd96fb..bd1c8f241e9b 100644
--- dom/base/moz.build
+++ dom/base/moz.build
@@ -576,6 +576,9 @@ FINAL_LIBRARY = "xul"
@@ -606,6 +606,9 @@ FINAL_LIBRARY = "xul"
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
@ -40,7 +40,7 @@ index d390adf..4508f19 100644
script="gen-usecounters.py",
diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build
new file mode 100644
index 0000000..24e8d7a
index 000000000000..24e8d7a03274
--- /dev/null
+++ gfx/graphite2/geckoextra/moz.build
@@ -0,0 +1,21 @@
@ -64,39 +64,10 @@ index 0000000..24e8d7a
+# Match bundled graphite2 configuration
+AllowCompilerWarnings()
+
+FINAL_LIBRARY = 'gkmedias'
diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh
index b91d9c1..a97e6eb 100755
--- gfx/graphite2/moz-gr-update.sh
+++ gfx/graphite2/moz-gr-update.sh
@@ -1,6 +1,7 @@
#!/bin/bash
# Script used to update the Graphite2 library in the mozilla source tree
+# and bump version for --with-system-graphite2
# This script lives in gfx/graphite2, along with the library source,
# but must be run from the top level of the mozilla-central tree.
@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla
#find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
#find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+# chase version for --with-system-graphite2
+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
+ if /GR2_VERSION_REQUIRE/" old-configure.in
+
# summarize what's been touched
echo Updated to $RELEASE.
echo Here is what changed in the gfx/graphite2 directory:
echo
-hg stat gfx/graphite2
+hg stat old-configure.in gfx/graphite2
echo
echo If gfx/graphite2/src/files.mk has changed, please make corresponding
diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla
index 3180257..4587a3b 100644
+FINAL_LIBRARY = 'xul'
diff --git gfx/harfbuzz/README-mozilla.fbsd gfx/harfbuzz/README-mozilla.fbsd
new file mode 100644
index 000000000000..2a10eb1e2b42
--- /dev/null
+++ gfx/harfbuzz/README-mozilla.fbsd
@@ -0,0 +1,4 @@
@ -105,7 +76,7 @@ index 3180257..4587a3b 100644
+with checkout version or increment latest tag by one if it's not based
+on upstream release.
diff --git gfx/moz.build gfx/moz.build
index 4d6d63d..cd57b0c 100644
index 56ea317bedfc..07dd7f66f1bc 100644
--- gfx/moz.build
+++ gfx/moz.build
@@ -10,6 +10,14 @@ with Files("**"):
@ -133,10 +104,10 @@ index 4d6d63d..cd57b0c 100644
"thebes",
"ipc",
diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
index 5e0fd17..860b80a 100755
index c161d24df853..8c7dd395b371 100755
--- gfx/skia/generate_mozbuild.py
+++ gfx/skia/generate_mozbuild.py
@@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
@@ -91,6 +91,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
'-Wno-unused-private-field',
]
@ -147,10 +118,10 @@ index 5e0fd17..860b80a 100755
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git gfx/skia/moz.build gfx/skia/moz.build
index 524bd28..615c93b 100755
index 83aa2957a938..0859316a1f09 100644
--- gfx/skia/moz.build
+++ gfx/skia/moz.build
@@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
@@ -601,6 +601,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
'-Wno-unused-private-field',
]
@ -161,10 +132,10 @@ index 524bd28..615c93b 100755
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git gfx/thebes/moz.build gfx/thebes/moz.build
index baa6f09..4f02a9e 100644
index fd1fcf236d81..958d3f699ffd 100644
--- gfx/thebes/moz.build
+++ gfx/thebes/moz.build
@@ -286,7 +286,13 @@ if CONFIG["MOZ_WAYLAND"]:
@@ -293,7 +293,13 @@ if CONFIG["MOZ_WAYLAND"]:
LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
@ -177,13 +148,13 @@ index baa6f09..4f02a9e 100644
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
if CONFIG["CC_TYPE"] == "clang":
# Suppress warnings from Skia header files.
CXXFLAGS += ["-Werror=switch"]
diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
index 301eb9a..7cece5e 100644
index 2bbd00415cae..f66bd37695d4 100644
--- intl/unicharutil/util/moz.build
+++ intl/unicharutil/util/moz.build
@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
@@ -24,6 +24,9 @@ UNIFIED_SOURCES += [
"nsUnicodeProperties.cpp",
]
@ -194,10 +165,10 @@ index 301eb9a..7cece5e 100644
GeneratedFile(
diff --git netwerk/dns/moz.build netwerk/dns/moz.build
index f769e27..315bdd4 100644
index c926d14707d1..35a3f33e2885 100644
--- netwerk/dns/moz.build
+++ netwerk/dns/moz.build
@@ -102,6 +102,9 @@ GeneratedFile(
@@ -112,6 +112,9 @@ GeneratedFile(
"etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"]
)
@ -208,10 +179,10 @@ index f769e27..315bdd4 100644
LOCAL_INCLUDES += [
"/netwerk/base",
diff --git old-configure.in old-configure.in
index d147957..d332b34 100644
index 2ca88a20a4b3..88bc9b873eff 100644
--- old-configure.in
+++ old-configure.in
@@ -1335,6 +1335,27 @@ fi
@@ -1067,6 +1067,27 @@ fi
AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
AC_SUBST(MOZ_MACBUNDLE_ID)
@ -240,10 +211,10 @@ index d147957..d332b34 100644
dnl = Child Process Name for IPC
dnl ========================================================
diff --git toolkit/library/moz.build toolkit/library/moz.build
index 2c3f869..e8a9d23 100644
index 76746f308011..f6844f4c400b 100644
--- toolkit/library/moz.build
+++ toolkit/library/moz.build
@@ -269,6 +269,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
@@ -292,6 +292,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
if CONFIG["MOZ_SYSTEM_WEBP"]:
OS_LIBS += CONFIG["MOZ_WEBP_LIBS"]
@ -257,12 +228,12 @@ index 2c3f869..e8a9d23 100644
OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"]
diff --git toolkit/moz.configure toolkit/moz.configure
index 0069865..9bb1864 100644
index a060a59f728f..f0778d1ae2d6 100644
--- toolkit/moz.configure
+++ toolkit/moz.configure
@@ -1058,6 +1058,25 @@ def geckodriver_default(enable_tests, target, cross_compile, hazard, asan, autom
return False
return True
@@ -1218,6 +1218,26 @@ def enable_cairo_ft(target, tree_freetype, freetype2_info):
set_config("MOZ_ENABLE_CAIRO_FT", True, when=enable_cairo_ft)
set_config("CAIRO_FT_CFLAGS", ft2_info.cflags, when=enable_cairo_ft)
+# Graphite2
+# ==============================================================
@ -283,6 +254,7 @@ index 0069865..9bb1864 100644
+ when="--with-system-harfbuzz")
+
+set_config("MOZ_SYSTEM_HARFBUZZ", depends_if(system_harfbuzz)(lambda _: True))
+
option(
"--enable-geckodriver",
# WebDriver (HTTP / BiDi)
# ==============================================================

View File

@ -1,23 +0,0 @@
Enable FLAC on platforms without ffvpx like powerpc*
--- dom/media/flac/FlacDecoder.cpp.orig 2021-04-15 19:44:28 UTC
+++ dom/media/flac/FlacDecoder.cpp
@@ -7,6 +7,7 @@
#include "FlacDecoder.h"
#include "MediaContainerType.h"
#include "mozilla/StaticPrefs_media.h"
+#include "PDMFactory.h"
namespace mozilla {
@@ -14,6 +15,10 @@ namespace mozilla {
bool FlacDecoder::IsEnabled() {
#ifdef MOZ_FFVPX
return StaticPrefs::media_flac_enabled();
+#elif defined(MOZ_FFMPEG)
+ RefPtr<PDMFactory> platform = new PDMFactory();
+ return StaticPrefs::media_flac_enabled() &&
+ !platform->SupportsMimeType("audio/flac"_ns).isEmpty();
#else
return false;
#endif

View File

@ -0,0 +1,27 @@
commit 0a4dfe06e072222335bff7724b64a1f479e56569
Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>
flag WEBRTC_USE_PIPEWIRE just as on Linux
diff --git dom/media/webrtc/third_party_build/webrtc.mozbuild dom/media/webrtc/third_party_build/webrtc.mozbuild
index 940420e3f8c4..08e07f77056f 100644
--- dom/media/webrtc/third_party_build/webrtc.mozbuild
+++ dom/media/webrtc/third_party_build/webrtc.mozbuild
@@ -40,6 +40,17 @@ if CONFIG["MOZ_WEBRTC"]:
DEFINES["HAVE_WINSOCK2_H"] = True
elif CONFIG["OS_TARGET"] in ("DragonFly", "FreeBSD", "NetBSD", "OpenBSD"):
DEFINES["WEBRTC_BSD"] = True
+ if (
+ CONFIG["TARGET_CPU"] == "x86"
+ or CONFIG["TARGET_CPU"] == "x86_64"
+ or CONFIG["TARGET_CPU"] == "arm"
+ or CONFIG["TARGET_CPU"] == "aarch64"
+ or (
+ CONFIG["TARGET_ENDIANNESS"] == "little"
+ and CONFIG["TARGET_CPU"].startswith("mips")
+ )
+ ):
+ DEFINES["WEBRTC_USE_PIPEWIRE"] = True
elif CONFIG["OS_TARGET"] == "Android":
DEFINES["WEBRTC_LINUX"] = True
DEFINES["WEBRTC_ANDROID"] = True

View File

@ -1,11 +1,13 @@
--- gfx/skia/skia/src/base/SkEndian.h.orig 2023-06-16 01:32:16.999830000 +0200
+++ gfx/skia/skia/src/base/SkEndian.h 2023-06-16 01:32:41.701673000 +0200
@@ -131,7 +131,7 @@
#define SkTEndian_SwapLE64(n) (n)
#else // SK_CPU_BENDIAN
#define SkEndian_SwapBE16(n) (n)
- #define SkEndian_SwapBE32(n) (n)
+ #define SkEndian_SwapBE32(n) uint32_t(n)
#define SkEndian_SwapBE64(n) (n)
#define SkEndian_SwapLE16(n) SkEndianSwap16(n)
#define SkEndian_SwapLE32(n) SkEndianSwap32(n)
diff --git gfx/skia/skia/src/base/SkEndian.h gfx/skia/skia/src/base/SkEndian.h
index d015f8bff2bf..cc390a53f30c 100644
--- gfx/skia/skia/src/base/SkEndian.h
+++ gfx/skia/skia/src/base/SkEndian.h
@@ -140,7 +140,7 @@ static inline void SkEndianSwap64s(uint64_t array[], int count) {
#define SkEndian_SwapLE64(n) SkEndianSwap64(n)
#define SkTEndian_SwapBE16(n) (n)
- #define SkTEndian_SwapBE32(n) (n)
+ #define SkTEndian_SwapBE32(n) uint32_t(n)
#define SkTEndian_SwapBE64(n) (n)
#define SkTEndian_SwapLE16(n) SkTEndianSwap16<n>::value
#define SkTEndian_SwapLE32(n) SkTEndianSwap32<n>::value

View File

@ -1,32 +0,0 @@
Regressed by https://svnweb.freebsd.org/changeset/base/324815
gfx/skia/skia/src/core/SkCpu.cpp:81:27: error: use of undeclared identifier 'getauxval'
uint32_t hwcaps = getauxval(AT_HWCAP);
^
--- gfx/skia/skia/src/core/SkCpu.cpp.orig 2020-02-07 22:13:22 UTC
+++ gfx/skia/skia/src/core/SkCpu.cpp
@@ -72,6 +72,23 @@
return features;
}
+#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
+ #include <machine/armreg.h>
+ #ifndef ID_AA64ISAR0_CRC32_VAL
+ #define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
+ #endif
+
+ static uint32_t read_cpu_features() {
+ uint32_t features = 0;
+ uint64_t id_aa64isar0;
+
+ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
+ if (ID_AA64ISAR0_CRC32_VAL(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
+ features |= SkCpu::CRC32;
+ }
+ return features;
+ }
+
#elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
#include <sys/auxv.h>

View File

@ -1,11 +1,13 @@
--- gfx/skia/skia/src/core/SkRasterPipeline.h.orig 2023-06-10 14:20:18.155477000 +0200
+++ gfx/skia/skia/src/core/SkRasterPipeline.h 2023-06-10 14:20:30.760915000 +0200
@@ -24,7 +24,7 @@
struct SkImageInfo;
diff --git gfx/skia/skia/src/core/SkRasterPipeline.h gfx/skia/skia/src/core/SkRasterPipeline.h
index 2475ea0d398d..67967483656d 100644
--- gfx/skia/skia/src/core/SkRasterPipeline.h
+++ gfx/skia/skia/src/core/SkRasterPipeline.h
@@ -27,7 +27,7 @@ struct SkImageInfo;
struct skcms_TransferFunction;
-#if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32)
+#if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32) && !defined(__powerpc__)
#if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32) && \
- !defined(SK_CPU_LOONGARCH)
+ !defined(SK_CPU_LOONGARCH) && !defined(__powerpc__)
#define SK_HAS_MUSTTAIL 1
#else
#define SK_HAS_MUSTTAIL 0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,84 @@
commit 70c3be521da1296f7ba47bd07b67927e43634d1b
Author: Christoph Moench-Tegeder <cmt@burggraben.net>
disable SSE and friends in builds for legacy architectures
diff --git gfx/thebes/moz.build gfx/thebes/moz.build
index 71903756ea19..3591cc0f38e8 100644
--- gfx/thebes/moz.build
+++ gfx/thebes/moz.build
@@ -174,7 +174,7 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
]
# Are we targeting x86 or x64? If so, build gfxAlphaRecoverySSE2.cpp.
-if CONFIG["INTEL_ARCHITECTURE"]:
+if CONFIG["INTEL_ARCHITECTURE"] and CONFIG['TARGET_CPU'] == 'x86_64':
SOURCES += ["gfxAlphaRecoverySSE2.cpp"]
# The file uses SSE2 intrinsics, so it needs special compile flags on some
# compilers.
diff --git mozglue/misc/SSE.h mozglue/misc/SSE.h
index 0b87366a8043..af0a0b38d23c 100644
--- mozglue/misc/SSE.h
+++ mozglue/misc/SSE.h
@@ -100,36 +100,50 @@
# define MOZILLA_PRESUME_MMX 1
# endif
# ifdef __SSE__
+# if !defined(__386__)
// It's ok to use SSE instructions based on the -march option (or
// the default for x86_64 or for Intel Mac).
# define MOZILLA_PRESUME_SSE 1
# endif
+# endif
# ifdef __SSE2__
+# if !defined(__386__)
// It's ok to use SSE2 instructions based on the -march option (or
// the default for x86_64 or for Intel Mac).
# define MOZILLA_PRESUME_SSE2 1
# endif
+# endif
# ifdef __SSE3__
+# if !defined(__386__)
// It's ok to use SSE3 instructions based on the -march option (or the
// default for Intel Mac).
# define MOZILLA_PRESUME_SSE3 1
# endif
+# endif
# ifdef __SSSE3__
+# if !defined(__386__)
// It's ok to use SSSE3 instructions based on the -march option.
# define MOZILLA_PRESUME_SSSE3 1
# endif
+# endif
# ifdef __SSE4A__
+# if !defined(__386__)
// It's ok to use SSE4A instructions based on the -march option.
# define MOZILLA_PRESUME_SSE4A 1
# endif
+# endif
# ifdef __SSE4_1__
+# if !defined(__386__)
// It's ok to use SSE4.1 instructions based on the -march option.
# define MOZILLA_PRESUME_SSE4_1 1
# endif
+# endif
# ifdef __SSE4_2__
+# if !defined(__386__)
// It's ok to use SSE4.2 instructions based on the -march option.
# define MOZILLA_PRESUME_SSE4_2 1
# endif
+# endif
# ifdef __AVX__
// It's ok to use AVX instructions based on the -march option.
# define MOZILLA_PRESUME_AVX 1
@@ -144,8 +158,10 @@
# endif
# ifdef HAVE_CPUID_H
+# if !defined(__i386__)
# define MOZILLA_SSE_HAVE_CPUID_DETECTION
# endif
+# endif
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64))

View File

@ -3,10 +3,10 @@
Ref: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1819
diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
index 49b64845100b..283c387db770 100644
index 1872a8684132..7e519f9e9cbb 100644
--- third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
+++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
@@ -402,7 +402,7 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream(
@@ -417,7 +417,7 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream(
pw_stream_node_id_ = stream_node_id;
@ -16,7 +16,7 @@ index 49b64845100b..283c387db770 100644
pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr);
diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc
index 3b829959aca8..9bdcdf1ffd51 100644
index ffba13775363..da6a828a21ee 100644
--- third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc
+++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc
@@ -36,7 +36,7 @@ TestScreenCastStreamProvider::TestScreenCastStreamProvider(Observer* observer,
@ -29,7 +29,7 @@ index 3b829959aca8..9bdcdf1ffd51 100644
pw_main_loop_ = pw_thread_loop_new("pipewire-test-main-loop", nullptr);
diff --git third_party/libwebrtc/modules/portal/pipewire.sigs third_party/libwebrtc/modules/portal/pipewire.sigs
index 139a8c37a551..9fe131d8daa6 100644
index c3abf05b386f..a994c218f5a5 100644
--- third_party/libwebrtc/modules/portal/pipewire.sigs
+++ third_party/libwebrtc/modules/portal/pipewire.sigs
@@ -15,7 +15,7 @@ pw_loop * pw_loop_new(const spa_dict *props);
@ -41,8 +41,21 @@ index 139a8c37a551..9fe131d8daa6 100644
const char* pw_get_library_version();
// properties.h
diff --git third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc
index f2680b28162c..03476a5fffd0 100644
--- third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc
+++ third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc
@@ -252,7 +252,7 @@ void PipeWireSession::InitPipeWire(int fd) {
}
bool PipeWireSession::StartPipeWire(int fd) {
- pw_init(/*argc=*/nullptr, /*argv=*/nullptr);
+ pipewire_init(/*argc=*/nullptr, /*argv=*/nullptr);
pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr);
diff --git third_party/pipewire/libpipewire/mozpipewire.cpp third_party/pipewire/libpipewire/mozpipewire.cpp
index fbeeb8e5a760..46f768790946 100644
index b8068296745e..7e8be3dc764f 100644
--- third_party/pipewire/libpipewire/mozpipewire.cpp
+++ third_party/pipewire/libpipewire/mozpipewire.cpp
@@ -58,7 +58,7 @@ struct pw_context * (*pw_context_new_fn)(struct pw_loop *main_loop,
@ -51,19 +64,19 @@ index fbeeb8e5a760..46f768790946 100644
static int (*pw_core_disconnect_fn)(struct pw_core *core);
-static void (*pw_init_fn)(int *argc, char **argv[]);
+static void (*pipewire_init_fn)(int *argc, char **argv[]);
static void (*pw_proxy_destroy_fn)(struct pw_proxy *proxy);
static void (*pw_stream_add_listener_fn)(struct pw_stream *stream,
struct spa_hook *listener,
const struct pw_stream_events *events,
@@ -101,7 +101,7 @@ bool IsPwLibraryLoaded() {
@@ -103,7 +103,7 @@ bool IsPwLibraryLoaded() {
IS_FUNC_LOADED(pw_context_destroy_fn) &&
IS_FUNC_LOADED(pw_context_new_fn) &&
IS_FUNC_LOADED(pw_core_disconnect_fn) &&
- IS_FUNC_LOADED(pw_init_fn) &&
+ IS_FUNC_LOADED(pipewire_init_fn) &&
IS_FUNC_LOADED(pw_proxy_destroy_fn) &&
IS_FUNC_LOADED(pw_stream_add_listener_fn) &&
IS_FUNC_LOADED(pw_stream_connect_fn) &&
IS_FUNC_LOADED(pw_stream_disconnect_fn) &&
@@ -142,7 +142,7 @@ bool LoadPWLibrary() {
@@ -146,7 +146,7 @@ bool LoadPWLibrary() {
GET_FUNC(pw_context_destroy, pwLib);
GET_FUNC(pw_context_new, pwLib);
GET_FUNC(pw_core_disconnect, pwLib);
@ -72,7 +85,7 @@ index fbeeb8e5a760..46f768790946 100644
GET_FUNC(pw_stream_add_listener, pwLib);
GET_FUNC(pw_stream_connect, pwLib);
GET_FUNC(pw_stream_disconnect, pwLib);
@@ -220,12 +220,12 @@ pw_core_disconnect(struct pw_core *core)
@@ -226,12 +226,12 @@ pw_core_disconnect(struct pw_core *core)
}
void

View File

@ -1,10 +1,10 @@
commit 0c96c599752d8d8f68b5ed8a6344888d1b505773
commit 6bfdff4afcc9e3843b9c3a5d7e884e281a305398
Author: Christoph Moench-Tegeder <cmt@burggraben.net>
fixup gn_processor.py for FreeBSD
chase gn_processor.py changes
diff --git python/mozbuild/mozbuild/gn_processor.py python/mozbuild/mozbuild/gn_processor.py
index b6c51ee010a8..15b4bda9df6e 100644
index a77b6c7759f1..e5498ac5e9df 100644
--- python/mozbuild/mozbuild/gn_processor.py
+++ python/mozbuild/mozbuild/gn_processor.py
@@ -185,6 +185,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target):
@ -15,7 +15,7 @@ index b6c51ee010a8..15b4bda9df6e 100644
"linux": "Linux",
"mac": "Darwin",
"openbsd": "OpenBSD",
@@ -735,16 +736,16 @@ def main():
@@ -742,17 +743,17 @@ def main():
vars_set = []
for is_debug in (True, False):
@ -30,14 +30,15 @@ index b6c51ee010a8..15b4bda9df6e 100644
- if target_os in ("android", "linux", "win"):
+ if target_os in ("android", "freebsd", "linux", "win"):
target_cpus.append("x86")
- if target_os in ("linux", "openbsd"):
+ if target_os in ("freebsd", "linux", "openbsd"):
target_cpus.append("riscv64")
- if target_os == "linux":
- target_cpus.extend(["ppc64", "riscv64", "mipsel", "mips64el"])
+ if target_os in ("freebsd", "linux"):
+ target_cpus.extend(["ppc64", "mipsel", "mips64el"])
target_cpus.extend(["ppc64", "mipsel", "mips64el"])
for target_cpu in target_cpus:
vars = {
"host_cpu": "x64",
@@ -752,7 +753,7 @@ def main():
@@ -761,7 +762,7 @@ def main():
"target_cpu": target_cpu,
"target_os": target_os,
}

View File

@ -0,0 +1,15 @@
--- python/mozversioncontrol/mozversioncontrol/__init__.py.orig 2024-12-13 13:44:42 UTC
+++ python/mozversioncontrol/mozversioncontrol/__init__.py
@@ -1019,9 +1019,10 @@ class SrcRepository(Repository):
"""
res = []
# move away the .git or .hg folder from path to more easily test in a hg/git repo
- for root, dirs, files in os.walk("."):
+ for root, dirs, files in os.walk(self.path):
+ base = os.path.relpath(root, self.path)
for name in files:
- res.append(os.path.join(root, name))
+ res.append(os.path.join(base, name))
return res
def get_tracked_files_finder(self, path):

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,26 @@
--- third_party/libwebrtc/build/config/BUILDCONFIG.gn.orig 2022-10-09 20:42:58.113963000 +0200
+++ third_party/libwebrtc/build/config/BUILDCONFIG.gn 2022-10-09 20:46:16.128220000 +0200
@@ -132,6 +132,7 @@
commit 93615ae859d1d819b33bbe0e32c5260a467b3625
Author: Christoph Moench-Tegeder <cmt@burggraben.net>
enable pipewire on bsd
diff --git third_party/libwebrtc/BUILD.gn third_party/libwebrtc/BUILD.gn
index 6eb14773b0a7..d63fd1d5529f 100644
--- third_party/libwebrtc/BUILD.gn
+++ third_party/libwebrtc/BUILD.gn
@@ -106,7 +106,7 @@ if (!build_with_chromium && !build_with_mozilla) {
"tools_webrtc/perf:webrtc_dashboard_upload",
]
}
- if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
deps += [ "modules/desktop_capture:shared_screencast_stream_test" ]
}
if (is_fuchsia) {
diff --git third_party/libwebrtc/build/config/BUILDCONFIG.gn third_party/libwebrtc/build/config/BUILDCONFIG.gn
index 571ae5f0d60d..863d428fc676 100644
--- third_party/libwebrtc/build/config/BUILDCONFIG.gn
+++ third_party/libwebrtc/build/config/BUILDCONFIG.gn
@@ -132,6 +132,7 @@ declare_args() {
# Set to true when compiling with the Clang compiler.
is_clang = current_os != "linux" || current_os == "openbsd" ||
@ -8,7 +28,7 @@
(current_cpu != "s390x" && current_cpu != "s390" &&
current_cpu != "ppc64" && current_cpu != "ppc" &&
current_cpu != "mips" && current_cpu != "mips64" &&
@@ -184,7 +185,7 @@
@@ -184,7 +185,7 @@ if (host_toolchain == "") {
# TODO(dpranke): Add some sort of assert here that verifies that
# no toolchain omitted host_toolchain from its toolchain_args().
@ -17,7 +37,7 @@
if (target_os != "linux") {
host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
} else if (is_clang) {
@@ -222,7 +223,7 @@
@@ -222,7 +223,7 @@ if (target_os == "android") {
assert(host_os == "linux" || host_os == "mac",
"Android builds are only supported on Linux and Mac hosts.")
_default_toolchain = "//build/toolchain/android:android_clang_$target_cpu"
@ -26,7 +46,7 @@
# See comments in build/toolchain/cros/BUILD.gn about board compiles.
if (is_clang) {
_default_toolchain = "//build/toolchain/linux:clang_$target_cpu"
@@ -288,7 +289,7 @@
@@ -288,7 +289,7 @@ is_chromeos = current_os == "chromeos"
is_fuchsia = current_os == "fuchsia"
is_ios = current_os == "ios"
is_linux = current_os == "linux"
@ -35,3 +55,87 @@
is_mac = current_os == "mac"
is_nacl = current_os == "nacl"
is_win = current_os == "win" || current_os == "winuwp"
diff --git third_party/libwebrtc/modules/desktop_capture/BUILD.gn third_party/libwebrtc/modules/desktop_capture/BUILD.gn
index c184e2fbbcac..e1af29734d8b 100644
--- third_party/libwebrtc/modules/desktop_capture/BUILD.gn
+++ third_party/libwebrtc/modules/desktop_capture/BUILD.gn
@@ -75,7 +75,7 @@ if (rtc_include_tests) {
"window_finder_unittest.cc",
]
- if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
configs += [ "../portal:gio" ]
}
@@ -87,7 +87,7 @@ if (rtc_include_tests) {
}
}
- if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
rtc_test("shared_screencast_stream_test") {
testonly = true
@@ -146,7 +146,7 @@ if (rtc_include_tests) {
"test_utils_unittest.cc",
]
- if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
configs += [ "../portal:gio" ]
}
@@ -255,7 +255,7 @@ if (rtc_include_tests) {
"mock_desktop_capturer_callback.h",
]
- if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+ if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
configs += [ "../portal:gio" ]
}
@@ -268,7 +268,7 @@ if (rtc_include_tests) {
}
# TODO(bugs.webrtc.org/14187): remove when all users are gone
-if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
config("pipewire_config") {
configs = [ "../portal:pipewire_config" ]
}
@@ -326,7 +326,7 @@ rtc_library("desktop_capture") {
"window_finder.cc",
"window_finder.h",
]
- if (is_linux && !is_castos && rtc_use_pipewire) {
+ if ((is_linux || is_bsd) && !is_castos && rtc_use_pipewire) {
sources += [ "desktop_capture_metadata.h" ]
}
if (is_mac) {
diff --git third_party/libwebrtc/modules/portal/BUILD.gn third_party/libwebrtc/modules/portal/BUILD.gn
index d7768b2323c9..3593a6959277 100644
--- third_party/libwebrtc/modules/portal/BUILD.gn
+++ third_party/libwebrtc/modules/portal/BUILD.gn
@@ -10,7 +10,7 @@ import("//build/config/linux/pkg_config.gni")
import("//tools/generate_stubs/rules.gni")
import("../../webrtc.gni")
-if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
if (!build_with_mozilla) {
pkg_config("gio") {
packages = [
diff --git third_party/libwebrtc/webrtc.gni third_party/libwebrtc/webrtc.gni
index b1db8ff88415..64e0cb8f7c79 100644
--- third_party/libwebrtc/webrtc.gni
+++ third_party/libwebrtc/webrtc.gni
@@ -153,7 +153,7 @@ declare_args() {
# By default it's only enabled on desktop Linux (excludes ChromeOS) and
# only when using the sysroot as PipeWire is not available in older and
# supported Ubuntu and Debian distributions.
- rtc_use_pipewire = is_linux && use_sysroot
+ rtc_use_pipewire = (is_linux || is_bsd) && use_sysroot
# Set this to link PipeWire and required libraries directly instead of using the dlopen.
rtc_link_pipewire = false

View File

@ -0,0 +1,26 @@
commit 3524023ca1d2184ab9a5a7cc61695923e6834cc1
Author: Christoph Moench-Tegeder <cmt@burggraben.net>
avoid linux-only includes
diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
index 6a019c64b4b3..18bb43d797dd 100644
--- third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
@@ -10,12 +10,16 @@
#include "modules/desktop_capture/linux/wayland/egl_dmabuf.h"
+#if !defined(__FreeBSD__)
#include <asm/ioctl.h>
+#endif
#include <dlfcn.h>
#include <fcntl.h>
#include <gdk/gdk.h>
#include <libdrm/drm_fourcc.h>
+#if !defined(__FreeBSD__)
#include <linux/types.h>
+#endif
#include <spa/param/video/format-utils.h>
#include <unistd.h>
#include <xf86drm.h>

View File

@ -1,17 +0,0 @@
--- toolkit/xre/glxtest/glxtest.cpp.orig 2023-05-28 22:08:21.663847000 +0200
+++ toolkit/xre/glxtest/glxtest.cpp 2023-05-28 22:09:33.647075000 +0200
@@ -195,9 +195,14 @@
static void get_pci_status() {
log("GLX_TEST: get_pci_status start\n");
+#if defined(__FreeBSD__)
+ if (access("/dev/pci", F_OK) != 0) {
+ record_warning("cannot access /dev/pci");
+#else
if (access("/sys/bus/pci/", F_OK) != 0 &&
access("/sys/bus/pci_express/", F_OK) != 0) {
record_warning("cannot access /sys/bus/pci");
+#endif
return;
}

View File

@ -1,51 +0,0 @@
commit 45a7951cb6a9b1735b9b6cec89db69b5933715c7
Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>
Date: Mon Mar 28 21:54:35 2022 +0200
FreeBSD can use sched_getcpu() from 1400046/1300524 on
diff --git tools/profiler/core/platform.cpp tools/profiler/core/platform.cpp
index 92bcc1100687..2f17a88942a8 100644
--- tools/profiler/core/platform.cpp
+++ tools/profiler/core/platform.cpp
@@ -111,6 +111,20 @@
# include <cpuid.h>
#endif
+#if defined(GP_OS_freebsd)
+#include <sys/param.h>
+// "after making CPU_SET macros compatible with glibc"
+# if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000)
+# include <sched.h>
+# else
+# if __x86_64__ || __i386__
+// similar cpuid_count() trick as on Darwin, using LLVM
+// but not for all CPUs
+# include <cpuid.h>
+# endif
+# endif
+#endif
+
#if defined(GP_OS_windows)
# include <processthreadsapi.h>
@@ -6368,6 +6382,19 @@ void profiler_mark_thread_awake() {
cpuId = ebx >> 24;
}
# endif
+#elif defined(GP_OS_freebsd)
+# if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000)
+ cpuId = sched_getcpu();
+# elif defined(__amd64__)
+ unsigned int eax, ebx, ecx, edx;
+ __cpuid_count(1, 0, eax, ebx, ecx, edx);
+ // Check if we have an APIC.
+ if ((edx & (1 << 9))) {
+ // APIC ID is bits 24-31 of EBX
+ cpuId = ebx >> 24;
+ }
+# endif
+// the fallthrough is cpuID = 0
#else
cpuId = sched_getcpu();
#endif