git: 7659a22057ab - main - www/firefox: update to 123.0 (rc1)

From: Christoph Moench-Tegeder <cmt_at_FreeBSD.org>
Date: Mon, 12 Feb 2024 19:17:50 UTC
The branch main has been updated by cmt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7659a22057ab397f816f864662dc972d38f694a8

commit 7659a22057ab397f816f864662dc972d38f694a8
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2024-02-12 19:17:19 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2024-02-12 19:17:19 +0000

    www/firefox: update to 123.0 (rc1)
    
    Release Notes (soon):
      https://www.mozilla.org/en-US/firefox/123.0/releasenotes/
---
 www/firefox/Makefile                               |   7 +-
 www/firefox/distinfo                               |   6 +-
 www/firefox/files/patch-bug1559213                 |  19 -
 www/firefox/files/patch-bug1680982                 | 388 ---------------------
 www/firefox/files/patch-bug1874059                 |  25 ++
 www/firefox/files/patch-bug1876366                 | 188 ++++++++++
 .../patch-python_mozbuild_backend_recursivemake.py |  10 +
 7 files changed, 229 insertions(+), 414 deletions(-)

diff --git a/www/firefox/Makefile b/www/firefox/Makefile
index 936fde1d8578..68ccb7877f7b 100644
--- a/www/firefox/Makefile
+++ b/www/firefox/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	firefox
-DISTVERSION=	122.0.1
-PORTREVISION=	3
+DISTVERSION=	123.0
 PORTEPOCH=	2
 CATEGORIES=	www wayland
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}${DISTVERSIONSUFFIX}/source \
@@ -12,14 +11,14 @@ COMMENT=	Web browser based on the browser portion of Mozilla
 WWW=		https://www.mozilla.com/firefox
 
 BUILD_DEPENDS=	nspr>=4.32:devel/nspr \
-		nss>=3.95:security/nss \
+		nss>=3.97:security/nss \
 		icu>=73.1:devel/icu \
 		libevent>=2.1.8:devel/libevent \
 		harfbuzz>=8.3.0:print/harfbuzz \
 		graphite2>=1.3.14:graphics/graphite2 \
 		png>=1.6.39:graphics/png \
 		dav1d>=1.0.0:multimedia/dav1d \
-		libvpx>=1.13.1: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 \
diff --git a/www/firefox/distinfo b/www/firefox/distinfo
index 18556518ac19..73df908338b4 100644
--- a/www/firefox/distinfo
+++ b/www/firefox/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1707158162
-SHA256 (firefox-122.0.1.source.tar.xz) = 36f19c9a748eec2fd6d3a1594d0f1d7b715eaa1d9ed6d7eeda9db8478dcf36d6
-SIZE (firefox-122.0.1.source.tar.xz) = 533052916
+TIMESTAMP = 1707758063
+SHA256 (firefox-123.0.source.tar.xz) = 25be7849fa86dab6b26c314328c475d753825ee67f46c5b80a5e56c05023e539
+SIZE (firefox-123.0.source.tar.xz) = 542778984
diff --git a/www/firefox/files/patch-bug1559213 b/www/firefox/files/patch-bug1559213
index 7fbffbbff396..ae11fb38f989 100644
--- a/www/firefox/files/patch-bug1559213
+++ b/www/firefox/files/patch-bug1559213
@@ -26,25 +26,6 @@ index 2fc8df57992e..63d18e50a961 100644
  
  if not CONFIG["MOZ_SYSTEM_PNG"]:
      external_dirs += ["media/libpng"]
-diff --git config/system-headers.mozbuild config/system-headers.mozbuild
-index 07d48e7f9748..e56e5e084518 100644
---- config/system-headers.mozbuild
-+++ config/system-headers.mozbuild
-@@ -1304,6 +1304,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_ICU"]:
-     system_headers += [
-         "unicode/calendar.h",
 diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build
 index 5c6e25b3980b..ce99ebfb6d3f 100644
 --- dom/media/platforms/moz.build
diff --git a/www/firefox/files/patch-bug1680982 b/www/firefox/files/patch-bug1680982
deleted file mode 100644
index c9fc2344bb44..000000000000
--- a/www/firefox/files/patch-bug1680982
+++ /dev/null
@@ -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"]
diff --git a/www/firefox/files/patch-bug1874059 b/www/firefox/files/patch-bug1874059
new file mode 100644
index 000000000000..3fa954ef9def
--- /dev/null
+++ b/www/firefox/files/patch-bug1874059
@@ -0,0 +1,25 @@
+commit 56c888446600991803fd92d668349101ad4bf160
+Author: Christoph Moench-Tegeder <cmt@burggraben.net>
+Date:   Tue Feb 6 22:51:27 2024 +0100
+
+    switch to -fvisibility flags
+    
+    this fixes linkage with llvm18 (which does not like the former
+    approach via the #pragma in gcc_hidden.h
+    
+    PR: 276746
+    Submitted by: dim@
+
+diff --git build/moz.configure/toolchain.configure build/moz.configure/toolchain.configure
+index d08b748db250..4696f69153f6 100644
+--- build/moz.configure/toolchain.configure
++++ build/moz.configure/toolchain.configure
+@@ -2186,7 +2186,7 @@ set_define("_LIBCPP_HIDE_FROM_ABI", libcxx_override_visibility.hide_from_abi)
+ @depends(target, build_environment)
+ def visibility_flags(target, env):
+     if target.os != "WINNT":
+-        if target.kernel == "Darwin":
++        if target.kernel == "Darwin" or target.kernel == "FreeBSD":
+             return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
+         return (
+             "-I%s/system_wrappers" % os.path.join(env.dist),
diff --git a/www/firefox/files/patch-bug1876366 b/www/firefox/files/patch-bug1876366
new file mode 100644
index 000000000000..a6f39ffabab8
--- /dev/null
+++ b/www/firefox/files/patch-bug1876366
@@ -0,0 +1,188 @@
+commit 54d21b7398dc1a8ff22a987c660d400347b144a9
+Author: Christoph Moench-Tegeder <cmt@burggraben.net>
+Date:   Sun Feb 11 19:11:15 2024 +0100
+
+    Bug 1876366: many X11 cursors stopped working
+    
+    revert switch to newer gdk interface, as it broke cursor shape
+    switching and living with the default cursor only is no fun.
+    
+    Revert "Bug 1872961 [Linux] Use pointer cursor for hyperlinks r=emilio"
+    
+    This reverts commit 0574d0cdc438e4b0ce588f1652af802a0357f255.
+    
+    Revert "Bug 1871863 - Port from GdkCursorType to gdk_cursor_new_from_name. r=rmader,stransky"
+    
+    This reverts commit 5dfa42970a9577f0ac4e0992d9ec58c691e9bef6.
+
+diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp
+index a011dcc51fdb..28100db36d89 100644
+--- widget/gtk/nsWindow.cpp
++++ widget/gtk/nsWindow.cpp
+@@ -7797,53 +7797,61 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) {
+ 
+   GdkDisplay* defaultDisplay = gdk_display_get_default();
+ 
++  // The strategy here is to use standard GDK cursors, and, if not available,
++  // load by standard name with gdk_cursor_new_from_name.
++  // Spec is here: http://www.freedesktop.org/wiki/Specifications/cursor-spec/
+   switch (aCursor) {
+     case eCursor_standard:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "default");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_PTR);
+       break;
+     case eCursor_wait:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "wait");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_WATCH);
+       break;
+     case eCursor_select:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "text");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_XTERM);
+       break;
+     case eCursor_hyperlink:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "pointer");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_HAND2);
+       break;
+     case eCursor_n_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "n-resize");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_TOP_SIDE);
+       break;
+     case eCursor_s_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "s-resize");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_BOTTOM_SIDE);
+       break;
+     case eCursor_w_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "w-resize");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_SIDE);
+       break;
+     case eCursor_e_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "e-resize");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_RIGHT_SIDE);
+       break;
+     case eCursor_nw_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "nw-resize");
++      gdkcursor =
++          gdk_cursor_new_for_display(defaultDisplay, GDK_TOP_LEFT_CORNER);
+       break;
+     case eCursor_se_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "se-resize");
++      gdkcursor =
++          gdk_cursor_new_for_display(defaultDisplay, GDK_BOTTOM_RIGHT_CORNER);
+       break;
+     case eCursor_ne_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "ne-resize");
++      gdkcursor =
++          gdk_cursor_new_for_display(defaultDisplay, GDK_TOP_RIGHT_CORNER);
+       break;
+     case eCursor_sw_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "sw-resize");
++      gdkcursor =
++          gdk_cursor_new_for_display(defaultDisplay, GDK_BOTTOM_LEFT_CORNER);
+       break;
+     case eCursor_crosshair:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "crosshair");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_CROSSHAIR);
+       break;
+     case eCursor_move:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "move");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_FLEUR);
+       break;
+     case eCursor_help:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "help");
++      gdkcursor =
++          gdk_cursor_new_for_display(defaultDisplay, GDK_QUESTION_ARROW);
+       break;
+-    case eCursor_copy:
++    case eCursor_copy:  // CSS3
+       gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "copy");
+       if (!gdkcursor) newType = MOZ_CURSOR_COPY;
+       break;
+@@ -7856,14 +7864,18 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) {
+       if (!gdkcursor) newType = MOZ_CURSOR_CONTEXT_MENU;
+       break;
+     case eCursor_cell:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "cell");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_PLUS);
+       break;
++    // Those two aren’t standardized. Trying both KDE’s and GNOME’s names
+     case eCursor_grab:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "grab");
++      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "openhand");
+       if (!gdkcursor) newType = MOZ_CURSOR_HAND_GRAB;
+       break;
+     case eCursor_grabbing:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "grabbing");
++      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "closedhand");
++      if (!gdkcursor) {
++        gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "grabbing");
++      }
+       if (!gdkcursor) newType = MOZ_CURSOR_HAND_GRABBING;
+       break;
+     case eCursor_spinning:
+@@ -7880,6 +7892,9 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) {
+       break;
+     case eCursor_not_allowed:
+       gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "not-allowed");
++      if (!gdkcursor) {  // nonstandard, yet common
++        gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "crossed_circle");
++      }
+       if (!gdkcursor) newType = MOZ_CURSOR_NOT_ALLOWED;
+       break;
+     case eCursor_no_drop:
+@@ -7900,35 +7915,46 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) {
+       }
+       break;
+     case eCursor_all_scroll:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "move");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_FLEUR);
+       break;
+     case eCursor_nesw_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "nesw-resize");
++      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "size_bdiag");
+       if (!gdkcursor) newType = MOZ_CURSOR_NESW_RESIZE;
+       break;
+     case eCursor_nwse_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "nwse-resize");
++      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "size_fdiag");
+       if (!gdkcursor) newType = MOZ_CURSOR_NWSE_RESIZE;
+       break;
+     case eCursor_ns_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "ns-resize");
++      gdkcursor =
++          gdk_cursor_new_for_display(defaultDisplay, GDK_SB_V_DOUBLE_ARROW);
+       break;
+     case eCursor_ew_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "ew-resize");
++      gdkcursor =
++          gdk_cursor_new_for_display(defaultDisplay, GDK_SB_H_DOUBLE_ARROW);
+       break;
++    // Here, two better fitting cursors exist in some cursor themes. Try those
++    // first
+     case eCursor_row_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "row-resize");
++      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "split_v");
++      if (!gdkcursor) {
++        gdkcursor =
++            gdk_cursor_new_for_display(defaultDisplay, GDK_SB_V_DOUBLE_ARROW);
++      }
+       break;
+     case eCursor_col_resize:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "col-resize");
++      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "split_h");
++      if (!gdkcursor) {
++        gdkcursor =
++            gdk_cursor_new_for_display(defaultDisplay, GDK_SB_H_DOUBLE_ARROW);
++      }
+       break;
+     case eCursor_none:
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "none");
+-      if (!gdkcursor) newType = MOZ_CURSOR_NONE;
++      newType = MOZ_CURSOR_NONE;
+       break;
+     default:
+       NS_ASSERTION(aCursor, "Invalid cursor type");
+-      gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "default");
++      gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_PTR);
+       break;
+   }
+ 
diff --git a/www/firefox/files/patch-python_mozbuild_backend_recursivemake.py b/www/firefox/files/patch-python_mozbuild_backend_recursivemake.py
new file mode 100644
index 000000000000..5d98c1d31c4f
--- /dev/null
+++ b/www/firefox/files/patch-python_mozbuild_backend_recursivemake.py
@@ -0,0 +1,10 @@
+--- python/mozbuild/mozbuild/backend/recursivemake.py.orig	2024-02-06 22:20:32.176365000 +0100
++++ python/mozbuild/mozbuild/backend/recursivemake.py	2024-02-06 22:22:12.303380000 +0100
+@@ -549,6 +549,7 @@
+             if not reldir:
+                 for out in obj.outputs:
+                     out = mozpath.join(relobjdir, out)
++                    print('XXX Out: ' + out)
+                     assert out not in self._target_per_file
+                     self._target_per_file[out] = (relobjdir, tier)
+                 for input in obj.inputs: