commit a14c7ec7b7fdf55947d303ffb9cd875cec999336
parent cd592f6d94824bf4dc1b818bc358616a01b24f04
Author: Nihal Jere <nihal@nihaljere.xyz>
Date: Mon, 1 Mar 2021 11:05:09 -0600
librewolf: experimental
Diffstat:
6 files changed, 1673 insertions(+), 0 deletions(-)
diff --git a/librewolf/build b/librewolf/build
@@ -0,0 +1,109 @@
+#!/bin/sh -e
+
+for p in *.patch
+do
+ patch -p1 < "$p"
+done
+
+# install librewolf branding
+cp -r common/source_files/* ./
+
+
+# Remove libc header which conflicts with 7 or so Linux
+# kernel headers. See: https://github.com/kisslinux/repo/issues/207
+sed -i '/net\/if/d' \
+ dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c
+
+# Build autoconf 2.13 for Firefox's sole use.
+# See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642
+(
+ cd autoconf2.13
+
+ ./configure \
+ --prefix="$PWD/../junk" \
+ --program-suffix=-2.13
+
+ make
+ make install
+)
+
+# Build yasm for Firefox's sole use.
+# Firefox is the only package which needs it
+# and upstream is kinda dead.
+(
+ cd yasm
+
+ ./configure \
+ --prefix="$PWD/../junk"
+
+ make
+ make install
+)
+export PATH="$PWD/junk/bin:$PATH"
+
+# Bypass 'ccache' as it's totally useless when building
+# Firefox and only slows things down.
+export CC="${CC:-/usr/bin/cc}"
+export CXX="${CXX:-/usr/bin/c++}"
+
+export LDFLAGS="$LDFLAGS -Wl,-rpath=/usr/lib/firefox"
+export RUSTFLAGS="$RUSTFLAGS -Cdebuginfo=0"
+
+export MACH_USE_SYSTEM_PYTHON=1
+export MOZ_DEBUG_FLAGS=-g0
+export MOZ_NOSPAM=1
+export MOZ_TELEMETRY_REPORTING=0
+export MOZ_SERVICES_HEALTHREPORT=0
+
+./mach configure \
+ --prefix=/usr \
+ --libdir=/usr/lib \
+ --enable-optimize="$CFLAGS -w" \
+ --enable-install-strip \
+ --enable-strip \
+ --enable-rust-simd \
+ --enable-application=browser \
+ --enable-release \
+ --enable-alsa \
+ --with-app-name=librewolf \
+ --with-app-basename=Librewolf \
+ --with-branding-browser=browser/branding/librewolf \
+ --without-system-nspr \
+ --without-system-nss \
+ --with-system-jpeg \
+ --with-system-zlib \
+ --with-system-png \
+ --without-system-libvpx \
+ --with-system-pixman \
+ --with-system-ffi \
+ --disable-profiling \
+ --disable-accessibility \
+ --disable-tests \
+ --disable-system-extension-dirs \
+ --disable-parental-controls \
+ --disable-debug-symbols \
+ --disable-callgrind \
+ --disable-vtune \
+ --disable-elf-hack \
+ --disable-gold \
+ --disable-jemalloc \
+ --disable-pulseaudio \
+ --disable-crashreporter \
+ --disable-updater \
+ --disable-dbus \
+ --disable-eme \
+ --disable-necko-wifi
+
+./mach build
+DESTDIR="$1" ./mach install
+
+# Remove a lot of uneeded "stuff".
+rm -rf "$1/usr/include"
+rm -rf "$1/usr/lib/firefox-devel"
+rm -rf "$1/usr/share/idl"
+rm -rf "$1/usr/lib/firefox/gtk2" # Drop GTK+2 runtime dependency.
+rm -f "$1/usr/lib/firefox/browser/features/fxmonitor@mozilla.org.xpi"
+rm -f "$1/usr/lib/firefox/browser/features/screenshots@mozilla.org.xpi"
+rm -f "$1/usr/lib/firefox/browser/features/webcompat-reporter@mozilla.org.xpi"
+rm -f "$1/usr/lib/firefox/browser/features/webcompat@mozilla.org.xpi"
+rm -f "$1/usr/lib/firefox/browser/features/doh-rollout@mozilla.org.xpi"
diff --git a/librewolf/checksums b/librewolf/checksums
@@ -0,0 +1 @@
+d599e1e5661f1498989deb35a3181712842b554e45dff0af3857e5abfb0591ae
diff --git a/librewolf/depends b/librewolf/depends
@@ -0,0 +1,50 @@
+alsa-lib
+atk
+bzip2
+cairo
+cbindgen make
+clang make
+expat
+ffmpeg
+fontconfig
+freetype-harfbuzz
+fribidi
+gdk-pixbuf
+glib
+gtk+3
+libICE
+libSM
+libX11
+libXau
+libXcomposite
+libXcursor
+libXdamage
+libXext
+libXfixes
+libXi
+libXinerama
+libXrandr
+libXrender
+libXt
+libXxf86vm
+libdrm
+libepoxy
+libffi
+libjpeg-turbo
+libpng
+libvpx
+libxcb
+libxshmfence
+llvm make
+m4 make
+mesa
+nasm make
+nodejs make
+pango
+perl make
+pixman
+pkgconf make
+python make
+rust make
+zip make
+zlib
diff --git a/librewolf/patches/no-gtk2.patch b/librewolf/patches/no-gtk2.patch
@@ -0,0 +1,1505 @@
+diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
+index 566e643..cb1e0dd 100644
+--- a/browser/installer/package-manifest.in
++++ b/browser/installer/package-manifest.in
+@@ -107,7 +107,6 @@
+ #endif
+ #ifdef MOZ_GTK
+ @BINPATH@/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
+-@BINPATH@/gtk2/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
+ #ifdef MOZ_WAYLAND
+ @BINPATH@/@DLL_PREFIX@mozwayland@DLL_SUFFIX@
+ #endif
+diff --git a/dom/moz.build b/dom/moz.build
+index 9989f50..8c8167e 100644
+--- a/dom/moz.build
++++ b/dom/moz.build
+@@ -120,7 +120,7 @@ TEST_DIRS += [
+ "imptests",
+ ]
+
+-if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("gtk", "cocoa", "windows"):
++if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "windows"):
+ TEST_DIRS += ["plugins/test"]
+
+ SPHINX_TREES["/dom"] = "docs"
+diff --git a/dom/plugins/base/npapi.h b/dom/plugins/base/npapi.h
+index d6b189b..80dcb73 100644
+--- a/dom/plugins/base/npapi.h
++++ b/dom/plugins/base/npapi.h
+@@ -41,7 +41,7 @@
+ # endif
+ #endif
+
+-#if defined(XP_UNIX)
++#if defined(MOZ_X11)
+ # include <stdio.h>
+ # if defined(MOZ_X11)
+ # include <X11/Xlib.h>
+@@ -211,7 +211,7 @@ typedef struct _NPAsyncSurface {
+ /* Exact meaning must be spec'd in event model. */
+ # define kNPEventStartIME 2
+
+-# if defined(XP_UNIX)
++# if 0
+ /*
+ * Unix specific structures and definitions
+ */
+@@ -229,7 +229,7 @@ typedef struct {
+
+ typedef struct {
+ int32_t type;
+-# if defined(MOZ_X11)
++# if 0
+ Display* display;
+ Visual* visual;
+ Colormap colormap;
+@@ -291,7 +291,7 @@ typedef enum {
+ ,
+ NPDrawingModelSyncWin = 5
+ # endif
+-# if defined(MOZ_X11)
++# if 0
+ ,
+ NPDrawingModelSyncX = 6
+ # endif
+@@ -330,7 +330,7 @@ typedef enum {
+ * gcc 3.x generated vtables on UNIX and OSX are incompatible with
+ * previous compilers.
+ */
+-# if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
++# if 0
+ # define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
+ # else
+ # define _NP_ABI_MIXIN_FOR_GCC3 0
+@@ -530,7 +530,7 @@ typedef struct _NPWindow {
+ uint32_t width; /* Maximum window size */
+ uint32_t height;
+ NPRect clipRect; /* Clipping rectangle in port coordinates */
+-# if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
++# if (defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
+ void* ws_info; /* Platform-dependent additional data */
+ # endif /* XP_UNIX */
+ NPWindowType type; /* Is this a window or a drawable? */
+@@ -583,7 +583,7 @@ typedef struct _NPEvent {
+ uintptr_t wParam;
+ intptr_t lParam;
+ } NPEvent;
+-# elif defined(XP_UNIX) && defined(MOZ_X11)
++# elif 0
+ typedef XEvent NPEvent;
+ # else
+ typedef void* NPEvent;
+@@ -597,7 +597,7 @@ typedef RgnHandle NPQDRegion;
+ typedef CGPathRef NPCGRegion;
+ # elif defined(XP_WIN)
+ typedef HRGN NPRegion;
+-# elif defined(XP_UNIX) && defined(MOZ_X11)
++# elif 0
+ typedef Region NPRegion;
+ # elif defined(XP_SYMBIAN)
+ typedef QRegion* NPRegion;
+@@ -828,7 +828,7 @@ extern "C" {
+
+ /* NPP_* functions are provided by the plugin and called by the navigator. */
+
+-# if defined(XP_UNIX)
++# if 0
+ const char* NPP_GetMIMEDescription(void);
+ # endif
+
+diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp
+index 6d30257..c704df8 100644
+--- a/dom/plugins/base/nsNPAPIPlugin.cpp
++++ b/dom/plugins/base/nsNPAPIPlugin.cpp
+@@ -58,7 +58,7 @@
+ #endif
+
+ // needed for nppdf plugin
+-#if (MOZ_WIDGET_GTK)
++#if 0
+ # include <gdk/gdk.h>
+ # include <gdk/gdkx.h>
+ #endif
+@@ -77,7 +77,7 @@ using mozilla::PluginLibrary;
+ using mozilla::plugins::PluginModuleChromeParent;
+ using mozilla::plugins::PluginModuleContentParent;
+
+-#ifdef MOZ_X11
++#if 0
+ # include "mozilla/X11Util.h"
+ #endif
+
+@@ -1227,9 +1227,9 @@ NPError _getvalue(NPP npp, NPNVariable variable, void* result) {
+ // Cast NPNVariable enum to int to avoid warnings about including switch
+ // cases for android_npapi.h's non-standard ANPInterface values.
+ switch (static_cast<int>(variable)) {
+-#if defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ case NPNVxDisplay: {
+-# if defined(MOZ_X11)
++# if 0
+ if (npp) {
+ nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata;
+ bool windowless = false;
+@@ -1263,7 +1263,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void* result) {
+ return NPERR_GENERIC_ERROR;
+ #endif
+
+-#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
++#if defined(XP_WIN)
+ case NPNVnetscapeWindow: {
+ if (!npp || !npp->ndata) return NPERR_INVALID_INSTANCE_ERROR;
+
+@@ -1305,7 +1305,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void* result) {
+ }
+
+ case NPNVToolkit: {
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+ *((NPNToolkitType*)result) = NPNVGtk2;
+ #endif
+
+@@ -1315,7 +1315,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void* result) {
+ }
+
+ case NPNVSupportsXEmbedBool: {
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+ *(NPBool*)result = true;
+ #else
+ *(NPBool*)result = false;
+@@ -1336,8 +1336,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void* result) {
+ }
+
+ case NPNVSupportsWindowless: {
+-#if defined(XP_WIN) || defined(XP_MACOSX) || \
+- (defined(MOZ_X11) && defined(MOZ_WIDGET_GTK))
++#if defined(XP_WIN) || defined(XP_MACOSX)
+ *(NPBool*)result = true;
+ #else
+ *(NPBool*)result = false;
+diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp
+index a1462f6..b878c4e 100644
+--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
++++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
+@@ -317,7 +317,7 @@ nsresult nsNPAPIPluginInstance::SetWindow(NPWindow* window) {
+ // NPAPI plugins don't want a SetWindow(nullptr).
+ if (!window || RUNNING != mRunning) return NS_OK;
+
+-#if MOZ_WIDGET_GTK
++#if 0
+ // bug 108347, flash plugin on linux doesn't like window->width <= 0
+ return NS_OK;
+ #endif
+diff --git a/dom/plugins/base/nsNPAPIPluginInstance.h b/dom/plugins/base/nsNPAPIPluginInstance.h
+index 1ca2569..16a9706 100644
+--- a/dom/plugins/base/nsNPAPIPluginInstance.h
++++ b/dom/plugins/base/nsNPAPIPluginInstance.h
+@@ -38,7 +38,7 @@ class Element;
+
+ #if defined(OS_WIN)
+ const NPDrawingModel kDefaultDrawingModel = NPDrawingModelSyncWin;
+-#elif defined(MOZ_X11)
++#elif 0
+ const NPDrawingModel kDefaultDrawingModel = NPDrawingModelSyncX;
+ #elif defined(XP_MACOSX)
+ # ifndef NP_NO_QUICKDRAW
+diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp
+index 4cc7d89..d35bcb9 100644
+--- a/dom/plugins/base/nsPluginHost.cpp
++++ b/dom/plugins/base/nsPluginHost.cpp
+@@ -112,7 +112,7 @@
+ # include "windows.h"
+ # include "winbase.h"
+ #endif
+-#if (MOZ_WIDGET_GTK)
++#if 0
+ # include <gdk/gdk.h>
+ # include <gdk/gdkx.h>
+ #endif
+@@ -289,7 +289,7 @@ nsPluginHost::nsPluginHost()
+ Preferences::GetBool("plugin.override_internal_types", false);
+
+ bool waylandBackend = false;
+-#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11)
++#if 0
+ GdkDisplay* display = gdk_display_get_default();
+ if (display) {
+ waylandBackend = !GDK_IS_X11_DISPLAY(display);
+diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp
+index a1a7a2a..8334604 100644
+--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
++++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
+@@ -4,7 +4,7 @@
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+-#ifdef MOZ_X11
++#if 0
+ # include <cairo-xlib.h>
+ # include "gfxXlibSurface.h"
+ /* X headers suck */
+@@ -72,7 +72,7 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
+ # include "mozilla/widget/WinMessages.h"
+ #endif // #ifdef XP_WIN
+
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+ # include <gdk/gdk.h>
+ # include <gtk/gtk.h>
+ #endif
+@@ -637,7 +637,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetNetscapeWindow(void* value) {
+ }
+
+ return NS_OK;
+-#elif defined(MOZ_WIDGET_GTK) && defined(MOZ_X11)
++#elif 0
+ // X11 window managers want the toplevel window for WM_TRANSIENT_FOR.
+ nsIWidget* win = mPluginFrame->GetNearestWidget();
+ if (!win) return NS_ERROR_FAILURE;
+@@ -1676,7 +1676,7 @@ nsresult nsPluginInstanceOwner::HandleEvent(Event* aEvent) {
+ return NS_OK;
+ }
+
+-#ifdef MOZ_X11
++#if 0
+ static unsigned int XInputEventState(const WidgetInputEvent& anEvent) {
+ unsigned int state = 0;
+ if (anEvent.IsShift()) state |= ShiftMask;
+@@ -2103,7 +2103,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(
+ }
+ #endif
+
+-#ifdef MOZ_X11
++#if 0
+ // this code supports windowless plugins
+ nsIWidget* widget = anEvent.mWidget;
+ XEvent pluginEvent = XEvent();
+@@ -2134,7 +2134,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(
+ if (widget) {
+ rootPoint = anEvent.mRefPoint + widget->WidgetToScreenOffset();
+ }
+-# ifdef MOZ_WIDGET_GTK
++# if 0
+ Window root = GDK_ROOT_WINDOW();
+ # else
+ Window root = X11None; // Could XQueryTree, but this is not important.
+@@ -2212,7 +2212,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(
+ case eKeyboardEventClass:
+ if (anEvent.mPluginEvent) {
+ XKeyEvent& event = pluginEvent.xkey;
+-# ifdef MOZ_WIDGET_GTK
++# if 0
+ event.root = GDK_ROOT_WINDOW();
+ event.time = anEvent.mTime;
+ const GdkEventKey* gdkEvent =
+@@ -2396,7 +2396,7 @@ void nsPluginInstanceOwner::Paint(const RECT& aDirty, HDC aDC) {
+ }
+ #endif
+
+-#if defined(MOZ_X11)
++#if 0
+ void nsPluginInstanceOwner::Paint(gfxContext* aContext,
+ const gfxRect& aFrameRect,
+ const gfxRect& aDirtyRect) {
+@@ -2530,7 +2530,7 @@ nsresult nsPluginInstanceOwner::Renderer::DrawWithXlib(
+
+ NPSetWindowCallbackStruct* ws_info =
+ static_cast<NPSetWindowCallbackStruct*>(mWindow->ws_info);
+-# ifdef MOZ_X11
++# if 0
+ if (ws_info->visual != visual || ws_info->colormap != colormap) {
+ ws_info->visual = visual;
+ ws_info->colormap = colormap;
+@@ -2741,7 +2741,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void) {
+ // passing HDC till paint event when it is really
+ // needed. Change spec?
+ mPluginWindow->window = nullptr;
+-#ifdef MOZ_X11
++#if 0
+ // Fill in the display field.
+ NPSetWindowCallbackStruct* ws_info =
+ static_cast<NPSetWindowCallbackStruct*>(mPluginWindow->ws_info);
+diff --git a/dom/plugins/base/nsPluginInstanceOwner.h b/dom/plugins/base/nsPluginInstanceOwner.h
+index a868c22..382c82f 100644
+--- a/dom/plugins/base/nsPluginInstanceOwner.h
++++ b/dom/plugins/base/nsPluginInstanceOwner.h
+@@ -31,7 +31,7 @@ class nsPluginDOMContextMenuListener;
+ class nsPluginFrame;
+ class nsDisplayListBuilder;
+
+-#if defined(MOZ_X11)
++#if 0
+ class gfxContext;
+ #endif
+
+@@ -48,7 +48,7 @@ class PuppetWidget;
+
+ using mozilla::widget::PuppetWidget;
+
+-#ifdef MOZ_X11
++#if 0
+ # include "gfxXlibNativeRenderer.h"
+ #endif
+
+@@ -113,7 +113,7 @@ class nsPluginInstanceOwner final : public nsIPluginInstanceOwner,
+ void Paint(const gfxRect& aDirtyRect, CGContextRef cgContext);
+ void RenderCoreAnimation(CGContextRef aCGContext, int aWidth, int aHeight);
+ void DoCocoaEventDrawRect(const gfxRect& aDrawRect, CGContextRef cgContext);
+-#elif defined(MOZ_X11)
++#elif 0
+ void Paint(gfxContext* aContext, const gfxRect& aFrameRect,
+ const gfxRect& aDirtyRect);
+ #endif
+@@ -194,7 +194,7 @@ class nsPluginInstanceOwner final : public nsIPluginInstanceOwner,
+ return "";
+ }
+
+-#ifdef MOZ_X11
++#if 0
+ void GetPluginDescription(nsACString& aDescription) {
+ aDescription.Truncate();
+ if (mInstance && mPluginHost) {
+@@ -215,7 +215,7 @@ class nsPluginInstanceOwner final : public nsIPluginInstanceOwner,
+ return mPluginWindow->type == NPWindowTypeDrawable &&
+ (MatchPluginName("Shockwave Flash") ||
+ MatchPluginName("Test Plug-in"));
+-#elif defined(MOZ_X11) || defined(XP_MACOSX)
++#elif defined(XP_MACOSX)
+ return true;
+ #else
+ return false;
+@@ -323,7 +323,7 @@ class nsPluginInstanceOwner final : public nsIPluginInstanceOwner,
+ uint32_t mLastEventloopNestingLevel;
+ bool mContentFocused;
+ bool mWidgetVisible; // used on Mac to store our widget's visible state
+-#ifdef MOZ_X11
++#if 0
+ // Used with windowless plugins only, initialized in CreateWidget().
+ bool mFlash10Quirks;
+ #endif
+@@ -369,7 +369,7 @@ class nsPluginInstanceOwner final : public nsIPluginInstanceOwner,
+
+ int mLastMouseDownButtonType;
+
+-#ifdef MOZ_X11
++#if 0
+ class Renderer : public gfxXlibNativeRenderer {
+ public:
+ Renderer(NPWindow* aWindow, nsPluginInstanceOwner* aInstanceOwner,
+diff --git a/dom/plugins/base/nsPluginNativeWindow.cpp b/dom/plugins/base/nsPluginNativeWindow.cpp
+index 73da098..44554cf 100644
+--- a/dom/plugins/base/nsPluginNativeWindow.cpp
++++ b/dom/plugins/base/nsPluginNativeWindow.cpp
+@@ -17,7 +17,7 @@ class nsPluginNativeWindowImpl : public nsPluginNativeWindow {
+ nsPluginNativeWindowImpl();
+ virtual ~nsPluginNativeWindowImpl();
+
+-#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11)
++#if 0
+ NPSetWindowCallbackStruct mWsInfo;
+ #endif
+ };
+@@ -32,14 +32,14 @@ nsPluginNativeWindowImpl::nsPluginNativeWindowImpl() : nsPluginNativeWindow() {
+ memset(&clipRect, 0, sizeof(clipRect));
+ type = NPWindowTypeWindow;
+
+-#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11)
++#if 0
+ ws_info = &mWsInfo;
+ mWsInfo.type = 0;
+ mWsInfo.display = nullptr;
+ mWsInfo.visual = nullptr;
+ mWsInfo.colormap = 0;
+ mWsInfo.depth = 0;
+-#elif defined(XP_UNIX) && !defined(XP_MACOSX)
++#elif 0
+ ws_info = nullptr;
+ #endif
+ }
+diff --git a/dom/plugins/ipc/NPEventUnix.h b/dom/plugins/ipc/NPEventUnix.h
+index 55494b4..822d3b8 100644
+--- a/dom/plugins/ipc/NPEventUnix.h
++++ b/dom/plugins/ipc/NPEventUnix.h
+@@ -9,7 +9,7 @@
+
+ #include "npapi.h"
+
+-#ifdef MOZ_X11
++#if 0
+ # include "mozilla/X11Util.h"
+ #endif
+
+@@ -59,7 +59,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent> // synonym for XEvent
+ return false;
+ }
+
+-#ifdef MOZ_X11
++#if 0
+ SetXDisplay(aResult->event);
+ #endif
+ return true;
+@@ -70,7 +70,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent> // synonym for XEvent
+ aLog->append(L"(XEvent)");
+ }
+
+-#ifdef MOZ_X11
++#if 0
+ private:
+ static void SetXDisplay(XEvent& ev) {
+ Display* display = mozilla::DefaultXDisplay();
+diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp
+index 403a735..fbe273a 100644
+--- a/dom/plugins/ipc/PluginInstanceChild.cpp
++++ b/dom/plugins/ipc/PluginInstanceChild.cpp
+@@ -16,7 +16,7 @@
+ #include "nsNPAPIPluginInstance.h"
+ #include "mozilla/gfx/2D.h"
+ #include "mozilla/gfx/Logging.h"
+-#ifdef MOZ_X11
++#if 0
+ # include "gfxXlibSurface.h"
+ #endif
+ #ifdef XP_WIN
+@@ -45,7 +45,7 @@ using namespace mozilla::layers;
+ using namespace mozilla::gfx;
+ using namespace mozilla::widget;
+
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+
+ # include <gtk/gtk.h>
+ # include <gdk/gdkx.h>
+@@ -189,10 +189,10 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface,
+ mWindow.type = NPWindowTypeWindow;
+ mData.ndata = (void*)this;
+ mData.pdata = nullptr;
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ mWindow.ws_info = &mWsInfo;
+ memset(&mWsInfo, 0, sizeof(mWsInfo));
+-# ifdef MOZ_WIDGET_GTK
++# if 1
+ mWsInfo.display = nullptr;
+ # else
+ mWsInfo.display = DefaultXDisplay();
+@@ -357,7 +357,7 @@ NPError PluginInstanceChild::NPN_GetValue(NPNVariable aVar, void* aValue) {
+ AutoStackHelper guard(this);
+
+ switch (aVar) {
+-#if defined(MOZ_X11)
++#if 0
+ case NPNVToolkit:
+ *((NPNToolkitType*)aValue) = NPNVGtk2;
+ return NPERR_NO_ERROR;
+@@ -429,7 +429,7 @@ NPError PluginInstanceChild::NPN_GetValue(NPNVariable aVar, void* aValue) {
+ *static_cast<HWND*>(aValue) = mPluginWindowHWND;
+ return NPERR_NO_ERROR;
+ }
+-#elif defined(MOZ_X11)
++#elif 0
+ NPError result;
+ CallNPN_GetValue_NPNVnetscapeWindow(static_cast<XID*>(aValue), &result);
+ return result;
+@@ -843,7 +843,7 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_HandleEvent(
+ AssertPluginThread();
+ AutoStackHelper guard(this);
+
+-#if defined(MOZ_X11) && defined(DEBUG)
++#if 0
+ if (GraphicsExpose == event.event.type)
+ PLUGIN_LOG_DEBUG(
+ (" received drawable 0x%lx\n", event.event.xgraphicsexpose.drawable));
+@@ -900,7 +900,7 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_HandleEvent(
+ }
+ #endif
+
+-#ifdef MOZ_X11
++#if 0
+ if (GraphicsExpose == event.event.type) {
+ // Make sure the X server completes the drawing before the parent
+ // draws on top and destroys the Drawable.
+@@ -1155,7 +1155,7 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_SetWindow(
+ AssertPluginThread();
+ AutoStackHelper guard(this);
+
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ NS_ASSERTION(mWsInfo.display, "We should have a valid display!");
+
+ // The minimum info is sent over IPC to allow this
+@@ -1251,14 +1251,14 @@ mozilla::ipc::IPCResult PluginInstanceChild::AnswerNPP_SetWindow(
+ #elif defined(MOZ_WIDGET_UIKIT) || defined(MOZ_WAYLAND)
+ // Don't care
+ #else
+-# error Implement me for your OS
++//# error Implement me for your OS
+ #endif
+
+ return IPC_OK();
+ }
+
+ bool PluginInstanceChild::Initialize() {
+-#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11)
++#if 0
+ if (mWsInfo.display) {
+ // Already initialized
+ return true;
+@@ -2846,7 +2846,7 @@ bool PluginInstanceChild::CreateOptSurface(void) {
+ ? SurfaceFormat::A8R8G8B8_UINT32
+ : SurfaceFormat::X8R8G8B8_UINT32;
+
+-#ifdef MOZ_X11
++#if 0
+ Display* dpy = mWsInfo.display;
+ Screen* screen = DefaultScreenOfDisplay(dpy);
+ if (format == SurfaceFormat::X8R8G8B8_UINT32 &&
+@@ -2902,7 +2902,7 @@ bool PluginInstanceChild::MaybeCreatePlatformHelperSurface(void) {
+ return false;
+ }
+
+-#ifdef MOZ_X11
++#if 0
+ bool supportNonDefaultVisual = false;
+ Screen* screen = DefaultScreenOfDisplay(mWsInfo.display);
+ Visual* defaultVisual = DefaultVisualOfScreen(screen);
+@@ -3054,12 +3054,12 @@ bool PluginInstanceChild::EnsureCurrentBuffer(void) {
+ }
+
+ void PluginInstanceChild::UpdateWindowAttributes(bool aForceSetWindow) {
+-#if defined(MOZ_X11) || defined(XP_WIN)
++#if 0
+ RefPtr<gfxASurface> curSurface =
+ mHelperSurface ? mHelperSurface : mCurrentSurface;
+ #endif // Only used within MOZ_X11 or XP_WIN blocks. Unused variable otherwise
+ bool needWindowUpdate = aForceSetWindow;
+-#ifdef MOZ_X11
++#if 0
+ Visual* visual = nullptr;
+ Colormap colormap = 0;
+ if (curSurface && curSurface->GetType() == gfxSurfaceType::Xlib) {
+@@ -3158,7 +3158,7 @@ void PluginInstanceChild::PaintRectToPlatformSurface(const nsIntRect& aRect,
+ // We should not send an async surface if we're using direct rendering.
+ MOZ_ASSERT(!IsUsingDirectDrawing());
+
+-#ifdef MOZ_X11
++#if 0
+ {
+ NS_ASSERTION(aSurface->GetType() == gfxSurfaceType::Xlib,
+ "Non supported platform surface type");
+@@ -3206,7 +3206,7 @@ void PluginInstanceChild::PaintRectToSurface(const nsIntRect& aRect,
+ // Render using temporary X surface, with copy to image surface
+ nsIntRect plPaintRect(aRect);
+ RefPtr<gfxASurface> renderSurface = aSurface;
+-#ifdef MOZ_X11
++#if 0
+ if (mIsTransparent && (GetQuirks() & QUIRK_FLASH_EXPOSE_COORD_TRANSLATION)) {
+ // Work around a bug in Flash up to 10.1 d51 at least, where expose event
+ // top left coordinates within the plugin-rect and not at the drawable
+@@ -3549,7 +3549,7 @@ bool PluginInstanceChild::ShowPluginFrame() {
+ NPRect r = {(uint16_t)rect.y, (uint16_t)rect.x, (uint16_t)rect.YMost(),
+ (uint16_t)rect.XMost()};
+ SurfaceDescriptor currSurf;
+-#ifdef MOZ_X11
++#if 0
+ if (mCurrentSurface->GetType() == gfxSurfaceType::Xlib) {
+ gfxXlibSurface* xsurf = static_cast<gfxXlibSurface*>(mCurrentSurface.get());
+ currSurf = SurfaceDescriptorX11(xsurf);
+@@ -3597,7 +3597,7 @@ bool PluginInstanceChild::ReadbackDifferenceRect(const nsIntRect& rect) {
+
+ // We can read safely from XSurface,SharedDIBSurface and Unsafe
+ // SharedMemory, because PluginHost is not able to modify that surface
+-#if defined(MOZ_X11)
++#if 0
+ if (mBackSurface->GetType() != gfxSurfaceType::Xlib &&
+ !gfxSharedImageSurface::IsSharedImage(mBackSurface))
+ return false;
+@@ -3605,7 +3605,7 @@ bool PluginInstanceChild::ReadbackDifferenceRect(const nsIntRect& rect) {
+ if (!SharedDIBSurface::IsSharedDIBSurface(mBackSurface)) return false;
+ #endif
+
+-#if defined(MOZ_X11) || defined(XP_WIN)
++#if 0
+ if (mCurrentSurface->GetContentType() != mBackSurface->GetContentType())
+ return false;
+
+@@ -3723,7 +3723,7 @@ mozilla::ipc::IPCResult PluginInstanceChild::RecvUpdateBackground(
+ if (!mBackground) {
+ // XXX refactor me
+ switch (aBackground.type()) {
+-#ifdef MOZ_X11
++#if 0
+ case SurfaceDescriptor::TSurfaceDescriptorX11: {
+ mBackground = aBackground.get_SurfaceDescriptorX11().OpenForeign();
+ break;
+diff --git a/dom/plugins/ipc/PluginInstanceChild.h b/dom/plugins/ipc/PluginInstanceChild.h
+index 479c060..512a0cb 100644
+--- a/dom/plugins/ipc/PluginInstanceChild.h
++++ b/dom/plugins/ipc/PluginInstanceChild.h
+@@ -363,7 +363,7 @@ class PluginInstanceChild : public PPluginInstanceChild {
+ PluginScriptableObjectChild* mCachedWindowActor;
+ PluginScriptableObjectChild* mCachedElementActor;
+
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ NPSetWindowCallbackStruct mWsInfo;
+ #elif defined(OS_WIN)
+ HWND mPluginWindowHWND;
+diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp
+index 6e29171..5cb7ae7 100644
+--- a/dom/plugins/ipc/PluginInstanceParent.cpp
++++ b/dom/plugins/ipc/PluginInstanceParent.cpp
+@@ -27,7 +27,7 @@
+ #include "nsNPAPIPluginInstance.h"
+ #include "nsPluginInstanceOwner.h"
+ #include "nsFocusManager.h"
+-#ifdef MOZ_X11
++#if 0
+ # include "gfxXlibSurface.h"
+ #endif
+ #include "gfxUtils.h"
+@@ -62,7 +62,7 @@
+ # include "GPUVideoImage.h"
+ # include "mozilla/layers/SynchronousTask.h"
+ extern const wchar_t* kFlashFullscreenClass;
+-#elif defined(MOZ_WIDGET_GTK)
++#elif 0
+ # include "mozilla/dom/ContentChild.h"
+ # include <gdk/gdk.h>
+ #elif defined(XP_MACOSX)
+@@ -183,7 +183,7 @@ void PluginInstanceParent::ActorDestroy(ActorDestroyReason why) {
+ if (mImageContainer) {
+ mImageContainer->ClearAllImages();
+ }
+-#ifdef MOZ_X11
++#if 0
+ FinishX(DefaultXDisplay());
+ #endif
+ }
+@@ -228,7 +228,7 @@ PluginInstanceParent::AnswerNPN_GetValue_NPNVnetscapeWindow(
+ #ifdef XP_WIN
+ HWND id;
+ #elif defined(MOZ_X11)
+- XID id;
++ int id;
+ #elif defined(XP_DARWIN)
+ intptr_t id;
+ #elif defined(ANDROID) || defined(MOZ_WAYLAND)
+@@ -406,7 +406,7 @@ PluginInstanceParent::AnswerNPN_SetValue_NPPVpluginDrawingModel(
+ case NPDrawingModelAsyncWindowsDXGISurface:
+ allowed = SupportsPluginDirectDXGISurfaceDrawing();
+ break;
+-#elif defined(MOZ_X11)
++#elif 0
+ case NPDrawingModelSyncX:
+ allowed = true;
+ break;
+@@ -969,7 +969,7 @@ mozilla::ipc::IPCResult PluginInstanceParent::RecvShow(
+ return IPC_OK();
+ }
+ #endif
+-#ifdef MOZ_X11
++#if 0
+ else if (newSurface.type() == SurfaceDescriptor::TSurfaceDescriptorX11) {
+ surface = newSurface.get_SurfaceDescriptorX11().OpenForeign();
+ }
+@@ -986,7 +986,7 @@ mozilla::ipc::IPCResult PluginInstanceParent::RecvShow(
+ // This is the "old front buffer" we're about to hand back to
+ // the plugin. We might still have drawing operations
+ // referencing it.
+-#ifdef MOZ_X11
++#if 0
+ if (mFrontSurface->GetType() == gfxSurfaceType::Xlib) {
+ // Finish with the surface and XSync here to ensure the server has
+ // finished operations on the surface before the plugin starts
+@@ -1225,7 +1225,7 @@ nsresult PluginInstanceParent::EndUpdateBackground(const nsIntRect& aRect) {
+ ("[InstanceParent][%p] EndUpdateBackground for <x=%d,y=%d, w=%d,h=%d>",
+ this, aRect.x, aRect.y, aRect.width, aRect.height));
+
+-#ifdef MOZ_X11
++#if 0
+ // Have to XSync here to avoid the plugin trying to draw with this
+ // surface racing with its creation in the X server. We also want
+ // to avoid the plugin drawing onto stale pixels, then handing us
+@@ -1271,7 +1271,7 @@ bool PluginInstanceParent::CreateBackground(const nsIntSize& aSize) {
+
+ // XXX refactor me
+
+-#if defined(MOZ_X11)
++#if 0
+ Screen* screen = DefaultScreenOfDisplay(DefaultXDisplay());
+ Visual* visual = DefaultVisualOfScreen(screen);
+ mBackground = gfxXlibSurface::Create(
+@@ -1311,7 +1311,7 @@ PluginInstanceParent::BackgroundDescriptor() {
+
+ // XXX refactor me
+
+-#ifdef MOZ_X11
++#if 0
+ gfxXlibSurface* xsurf = static_cast<gfxXlibSurface*>(mBackground.get());
+ return SurfaceDescriptorX11(xsurf);
+ #endif
+@@ -1428,7 +1428,7 @@ NPError PluginInstanceParent::NPP_SetWindow(const NPWindow* aWindow) {
+ }
+ #endif
+
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ const NPSetWindowCallbackStruct* ws_info =
+ static_cast<NPSetWindowCallbackStruct*>(aWindow->ws_info);
+ window.visualID = ws_info->visual ? ws_info->visual->visualid : 0;
+@@ -1622,7 +1622,7 @@ int16_t PluginInstanceParent::NPP_HandleEvent(void* event) {
+ }
+ #endif
+
+-#if defined(MOZ_X11)
++#if 0
+ switch (npevent->type) {
+ case GraphicsExpose:
+ PLUGIN_LOG_DEBUG((" schlepping drawable 0x%lx across the pipe\n",
+@@ -1642,7 +1642,7 @@ int16_t PluginInstanceParent::NPP_HandleEvent(void* event) {
+ // Release any active pointer grab so that the plugin X client can
+ // grab the pointer if it wishes.
+ Display* dpy = DefaultXDisplay();
+-# ifdef MOZ_WIDGET_GTK
++# if 0
+ // GDK attempts to (asynchronously) track whether there is an active
+ // grab so ungrab through GDK.
+ //
+diff --git a/dom/plugins/ipc/PluginMessageUtils.cpp b/dom/plugins/ipc/PluginMessageUtils.cpp
+index 4d639b6..4e585fc 100644
+--- a/dom/plugins/ipc/PluginMessageUtils.cpp
++++ b/dom/plugins/ipc/PluginMessageUtils.cpp
+@@ -49,7 +49,7 @@ NPRemoteWindow::NPRemoteWindow()
+ width(0),
+ height(0),
+ type(NPWindowTypeDrawable)
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ ,
+ visualID(0),
+ colormap(0)
+@@ -81,7 +81,7 @@ ipc::RacyInterruptPolicy MediateRace(const MessageChannel::MessageInfo& parent,
+ }
+ }
+
+-#if defined(OS_LINUX) || defined(OS_SOLARIS)
++#if defined(OS_SOLARIS)
+ static string ReplaceAll(const string& haystack, const string& needle,
+ const string& with) {
+ string munged = haystack;
+@@ -97,7 +97,7 @@ static string ReplaceAll(const string& haystack, const string& needle,
+ #endif
+
+ string MungePluginDsoPath(const string& path) {
+-#if defined(OS_LINUX) || defined(OS_SOLARIS)
++#if defined(OS_SOLARIS)
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=519601
+ return ReplaceAll(path, "netscape", "netsc@pe");
+ #else
+@@ -106,7 +106,7 @@ string MungePluginDsoPath(const string& path) {
+ }
+
+ string UnmungePluginDsoPath(const string& munged) {
+-#if defined(OS_LINUX) || defined(OS_SOLARIS)
++#if defined(OS_SOLARIS)
+ return ReplaceAll(munged, "netsc@pe", "netscape");
+ #else
+ return munged;
+diff --git a/dom/plugins/ipc/PluginMessageUtils.h b/dom/plugins/ipc/PluginMessageUtils.h
+index c21aa10..7bf8180 100644
+--- a/dom/plugins/ipc/PluginMessageUtils.h
++++ b/dom/plugins/ipc/PluginMessageUtils.h
+@@ -87,7 +87,7 @@ struct NPRemoteWindow {
+ uint32_t height;
+ NPRect clipRect;
+ NPWindowType type;
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ VisualID visualID;
+ Colormap colormap;
+ #endif /* XP_UNIX */
+@@ -113,9 +113,9 @@ struct NPAudioDeviceStateChangedIPC {
+
+ #ifdef XP_WIN
+ typedef HWND NativeWindowHandle;
+-#elif defined(MOZ_X11)
++#elif 0
+ typedef XID NativeWindowHandle;
+-#elif defined(XP_DARWIN) || defined(ANDROID) || defined(MOZ_WAYLAND)
++#elif defined(XP_DARWIN) || defined(ANDROID) || defined(MOZ_WAYLAND) || defined(MOZ_X11)
+ typedef intptr_t NativeWindowHandle; // never actually used, will always be 0
+ #else
+ # error Need NativeWindowHandle for this platform
+@@ -323,7 +323,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteWindow> {
+ WriteParam(aMsg, aParam.height);
+ WriteParam(aMsg, aParam.clipRect);
+ WriteParam(aMsg, aParam.type);
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ aMsg->WriteULong(aParam.visualID);
+ aMsg->WriteULong(aParam.colormap);
+ #endif
+@@ -345,7 +345,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteWindow> {
+ ReadParam(aMsg, aIter, &clipRect) && ReadParam(aMsg, aIter, &type)))
+ return false;
+
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ unsigned long visualID;
+ unsigned long colormap;
+ if (!(aMsg->ReadULong(aIter, &visualID) &&
+@@ -365,7 +365,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteWindow> {
+ aResult->height = height;
+ aResult->clipRect = clipRect;
+ aResult->type = type;
+-#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ aResult->visualID = visualID;
+ aResult->colormap = colormap;
+ #endif
+diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
+index 81eb846..1d17be7 100644
+--- a/dom/plugins/ipc/PluginModuleChild.cpp
++++ b/dom/plugins/ipc/PluginModuleChild.cpp
+@@ -12,7 +12,7 @@
+
+ #include "mozilla/ipc/MessageChannel.h"
+
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+ # include <gtk/gtk.h>
+ # include <gdk/gdkx.h>
+ #endif
+@@ -25,7 +25,7 @@
+ #include "nsPluginsDir.h"
+ #include "nsXULAppAPI.h"
+
+-#ifdef MOZ_X11
++#if 0
+ # include "nsX11ErrorHandler.h"
+ # include "mozilla/X11Util.h"
+ #endif
+@@ -101,7 +101,7 @@ PluginModuleChild::PluginModuleChild(bool aIsChrome)
+ #if defined(OS_WIN) || defined(OS_MACOSX)
+ ,
+ mGetEntryPointsFunc(0)
+-#elif defined(MOZ_WIDGET_GTK)
++#elif 0
+ ,
+ mNestedLoopTimerId(0)
+ #endif
+@@ -255,7 +255,7 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
+ // XXX quirks isn't initialized yet
+ mAsyncRenderSupport = info.fSupportsAsyncRender;
+ #endif
+-#if defined(MOZ_X11)
++#if 0
+ constexpr auto flash10Head = "Shockwave Flash 10."_ns;
+ if (StringBeginsWith(nsDependentCString(info.fDescription), flash10Head)) {
+ AddQuirk(QUIRK_FLASH_EXPOSE_COORD_TRANSLATION);
+@@ -268,7 +268,7 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
+ mozilla::plugins::PluginUtilsOSX::SetProcessName(nameBuffer);
+ #endif
+ pluginFile.FreePluginInfo(info);
+-#if defined(MOZ_X11) || defined(XP_MACOSX)
++#if 0
+ if (!mLibrary)
+ #endif
+ {
+@@ -331,7 +331,7 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
+ return true;
+ }
+
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+
+ typedef void (*GObjectDisposeFn)(GObject*);
+ typedef gboolean (*GtkWidgetScrollEventFn)(GtkWidget*, GdkEventScroll*);
+@@ -551,7 +551,7 @@ bool PluginModuleChild::ShouldContinueFromReplyTimeout() {
+ }
+
+ bool PluginModuleChild::InitGraphics() {
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+ // Work around plugins that don't interact well with GDK
+ // client-side windows.
+ PR_SetEnv("GDK_NATIVE_WINDOWS=1");
+@@ -589,7 +589,7 @@ bool PluginModuleChild::InitGraphics() {
+ #else
+ // may not be necessary on all platforms
+ #endif
+-#ifdef MOZ_X11
++#if 0
+ // Do this after initializing GDK, or GDK will install its own handler.
+ InstallX11ErrorHandler();
+ #endif
+@@ -597,7 +597,7 @@ bool PluginModuleChild::InitGraphics() {
+ }
+
+ void PluginModuleChild::DeinitGraphics() {
+-#if defined(MOZ_X11) && defined(NS_FREE_PERMANENT_DATA)
++#if 0
+ // We free some data off of XDisplay close hooks, ensure they're
+ // run. Closing the display is pretty scary, so we only do it to
+ // silence leak checkers.
+@@ -995,7 +995,7 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
+ switch (aVariable) {
+ // Copied from nsNPAPIPlugin.cpp
+ case NPNVToolkit:
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+ *static_cast<NPNToolkitType*>(aValue) = NPNVGtk2;
+ return NPERR_NO_ERROR;
+ #endif
+@@ -1021,7 +1021,7 @@ NPError _getvalue(NPP aNPP, NPNVariable aVariable, void* aValue) {
+ case NPNVSupportsWindowless:
+ *(NPBool*)aValue = true;
+ return NPERR_NO_ERROR;
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+ case NPNVxDisplay: {
+ if (!aNPP) {
+ return NPERR_INVALID_INSTANCE_ERROR;
+@@ -1549,8 +1549,8 @@ NPError PluginModuleChild::DoNP_Initialize(const PluginSettings& aSettings) {
+ SetEventHooks();
+ #endif
+
+-#ifdef MOZ_X11
+-# ifdef MOZ_WIDGET_GTK
++#if 0
++# if 0
+ if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+ // We don't support NPAPI plugins on Wayland.
+ return NPERR_GENERIC_ERROR;
+diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h
+index 31d4eaf..cec8ca2 100644
+--- a/dom/plugins/ipc/PluginModuleChild.h
++++ b/dom/plugins/ipc/PluginModuleChild.h
+@@ -32,7 +32,7 @@
+ #include "mozilla/plugins/PluginMessageUtils.h"
+ #include "mozilla/plugins/PluginQuirks.h"
+
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+ # include <glib.h>
+ #endif
+
+@@ -210,7 +210,7 @@ class PluginModuleChild : public PPluginModuleChild {
+ bool InitGraphics();
+ void DeinitGraphics();
+
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+ static gboolean DetectNestedEventLoop(gpointer data);
+ static gboolean ProcessBrowserEvents(gpointer data);
+
+@@ -242,7 +242,7 @@ class PluginModuleChild : public PPluginModuleChild {
+
+ PluginSettings mCachedSettings;
+
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+ // If a plugin spins a nested glib event loop in response to a
+ // synchronous IPC message from the browser, the loop might break
+ // only after the browser responds to a request sent by the
+diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp
+index 6743ed1..44ae006 100644
+--- a/dom/plugins/ipc/PluginModuleParent.cpp
++++ b/dom/plugins/ipc/PluginModuleParent.cpp
+@@ -55,7 +55,7 @@
+ # include "PluginUtilsWin.h"
+ #endif
+
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+ # include <glib.h>
+ #elif XP_MACOSX
+ # include "PluginInterposeOSX.h"
+@@ -1596,7 +1596,7 @@ mozilla::ipc::IPCResult PluginModuleChromeParent::
+
+ mozilla::ipc::IPCResult PluginModuleParent::RecvBackUpXResources(
+ const FileDescriptor& aXSocketFd) {
+-#ifndef MOZ_X11
++#if 1
+ MOZ_CRASH("This message only makes sense on X11 platforms");
+ #else
+ MOZ_ASSERT(0 > mPluginXSocketFdDup.get(), "Already backed up X resources??");
+@@ -1782,7 +1782,7 @@ void PluginModuleChromeParent::CachedSettingChanged(const char* aPref,
+ module->CachedSettingChanged();
+ }
+
+-#if defined(XP_UNIX) && !defined(XP_MACOSX)
++#if 0
+ nsresult PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs,
+ NPPluginFuncs* pFuncs,
+ NPError* error) {
+@@ -1837,6 +1837,22 @@ nsresult PluginModuleChromeParent::NP_Initialize(NPNetscapeFuncs* bFuncs,
+
+ return NS_OK;
+ }
++#endif
++
++#if defined(XP_UNIX) && !defined(XP_MACOSX)
++nsresult PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs,
++ NPPluginFuncs* pFuncs,
++ NPError* error) {
++*error = NPERR_GENERIC_ERROR;
++return NS_ERROR_FAILURE;
++}
++
++nsresult PluginModuleChromeParent::NP_Initialize(NPNetscapeFuncs* bFuncs,
++ NPPluginFuncs* pFuncs,
++ NPError* error) {
++ *error = NPERR_GENERIC_ERROR;
++ return NS_ERROR_FAILURE;
++}
+
+ #else
+
+@@ -2040,7 +2056,7 @@ class nsCaseInsensitiveUTF8StringArrayComparator {
+ }
+ };
+
+-#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
++#if defined(XP_WIN)
+ static void ForceWindowless(nsTArray<nsCString>& names,
+ nsTArray<nsCString>& values) {
+ nsCaseInsensitiveUTF8StringArrayComparator comparator;
+@@ -2123,7 +2139,7 @@ nsresult PluginModuleParent::NPP_NewInternal(
+ # endif
+ ForceWindowless(names, values);
+ }
+-#elif defined(MOZ_WIDGET_GTK)
++#elif 0
+ // We no longer support windowed mode on Linux.
+ ForceWindowless(names, values);
+ #endif
+@@ -2237,7 +2253,7 @@ mozilla::ipc::IPCResult PluginModuleParent::AnswerProcessSomeEvents() {
+ return IPC_OK();
+ }
+
+-#elif !defined(MOZ_WIDGET_GTK)
++#elif 1
+ mozilla::ipc::IPCResult PluginModuleParent::AnswerProcessSomeEvents() {
+ MOZ_CRASH("unreached");
+ }
+diff --git a/dom/plugins/ipc/PluginModuleParent.h b/dom/plugins/ipc/PluginModuleParent.h
+index 9fd7490..b77279b 100644
+--- a/dom/plugins/ipc/PluginModuleParent.h
++++ b/dom/plugins/ipc/PluginModuleParent.h
+@@ -288,7 +288,7 @@ class PluginModuleParent : public PPluginModuleParent,
+ int32_t mSandboxLevel;
+ bool mIsFlashPlugin;
+
+-#ifdef MOZ_X11
++#if 0
+ // Dup of plugin's X socket, used to scope its resources to this
+ // object instead of the plugin process's lifetime
+ ScopedClose mPluginXSocketFdDup;
+diff --git a/dom/plugins/ipc/moz.build b/dom/plugins/ipc/moz.build
+index 62a726e..7273ba7 100644
+--- a/dom/plugins/ipc/moz.build
++++ b/dom/plugins/ipc/moz.build
+@@ -139,9 +139,6 @@ DEFINES["FORCE_PR_LOG"] = True
+
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] != "gtk":
+ CXXFLAGS += CONFIG["TK_CFLAGS"]
+-else:
+- # Force build against gtk+2 for struct offsets and such.
+- CXXFLAGS += CONFIG["MOZ_GTK2_CFLAGS"]
+
+ CXXFLAGS += CONFIG["MOZ_CAIRO_CFLAGS"]
+
+diff --git a/dom/plugins/test/moz.build b/dom/plugins/test/moz.build
+index 7f40fb3..a2feb2f 100644
+--- a/dom/plugins/test/moz.build
++++ b/dom/plugins/test/moz.build
+@@ -6,6 +6,6 @@
+
+ DIRS += ["testplugin"]
+
+-if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("gtk", "cocoa", "windows"):
++if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "windows"):
+ MOCHITEST_MANIFESTS += ["mochitest/mochitest.ini"]
+ BROWSER_CHROME_MANIFESTS += ["mochitest/browser.ini"]
+diff --git a/dom/plugins/test/testplugin/nptest.cpp b/dom/plugins/test/testplugin/nptest.cpp
+index 2a9d20c..d9b6d06 100644
+--- a/dom/plugins/test/testplugin/nptest.cpp
++++ b/dom/plugins/test/testplugin/nptest.cpp
+@@ -2692,7 +2692,7 @@ bool stallPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount,
+ return true;
+ }
+
+-#if defined(MOZ_WIDGET_GTK)
++#if 0
+ bool getClipboardText(NPObject* npobj, const NPVariant* args, uint32_t argCount,
+ NPVariant* result) {
+ NPP npp = static_cast<TestNPObject*>(npobj)->npp;
+diff --git a/dom/plugins/test/testplugin/testplugin.mozbuild b/dom/plugins/test/testplugin/testplugin.mozbuild
+index 2c46640..ad87356 100644
+--- a/dom/plugins/test/testplugin/testplugin.mozbuild
++++ b/dom/plugins/test/testplugin/testplugin.mozbuild
+@@ -18,11 +18,6 @@ if toolkit == 'cocoa':
+ UNIFIED_SOURCES += [
+ 'nptest_macosx.mm'
+ ]
+-elif toolkit == 'gtk':
+- UNIFIED_SOURCES += [
+- 'nptest_gtk2.cpp',
+- ]
+-elif toolkit == 'windows':
+ UNIFIED_SOURCES += [
+ 'nptest_windows.cpp',
+ ]
+@@ -46,14 +41,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and CONFIG['TARGET_CPU'] == 'x86_64':
+ OS_LIBS += ['-framework Carbon']
+
+-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
+- CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
+- CFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
+- OS_LIBS += CONFIG['MOZ_GTK2_LIBS']
+- OS_LIBS += CONFIG['XLDFLAGS']
+- OS_LIBS += CONFIG['XLIBS']
+- OS_LIBS += CONFIG['XEXT_LIBS']
+-
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+ FINAL_TARGET = 'dist/plugins/%s.plugin/Contents/MacOS' % cocoa_name
+ OBJDIR_FILES.dist.plugins['%s.plugin' % cocoa_name].Contents += ['%s/Info.plist' % relative_path]
+diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp
+index 8f97256..a371581 100644
+--- a/gfx/gl/GLContextProviderGLX.cpp
++++ b/gfx/gl/GLContextProviderGLX.cpp
+@@ -3,7 +3,7 @@
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+ # include <gdk/gdk.h>
+ # include <gdk/gdkx.h>
+ # define GET_NATIVE_WINDOW(aWidget) \
+@@ -42,7 +42,7 @@
+
+ #include "gfxCrashReporterUtils.h"
+
+-#ifdef MOZ_WIDGET_GTK
++#if MOZ_WIDGET_GTK
+ # include "gfxPlatformGtk.h"
+ #endif
+
+diff --git a/gfx/gl/GLContextProviderWayland.cpp b/gfx/gl/GLContextProviderWayland.cpp
+index 4f7c153..25ee2d4 100644
+--- a/gfx/gl/GLContextProviderWayland.cpp
++++ b/gfx/gl/GLContextProviderWayland.cpp
+@@ -3,7 +3,7 @@
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+-#ifdef MOZ_WIDGET_GTK
++#if 0
+ # include <gdk/gdk.h>
+ # include <gdk/gdkx.h>
+ #endif
+@@ -21,41 +21,24 @@ static class GLContextProviderEGL sGLContextProviderEGL;
+ already_AddRefed<GLContext> GLContextProviderWayland::CreateForCompositorWidget(
+ CompositorWidget* aCompositorWidget, bool aWebRender,
+ bool aForceAccelerated) {
+- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+- return sGLContextProviderX11.CreateForCompositorWidget(
+- aCompositorWidget, aWebRender, aForceAccelerated);
+- } else {
+ return sGLContextProviderEGL.CreateForCompositorWidget(
+ aCompositorWidget, aWebRender, aForceAccelerated);
+- }
+ }
+
+ /*static*/
+ already_AddRefed<GLContext> GLContextProviderWayland::CreateHeadless(
+ const GLContextCreateDesc& desc, nsACString* const out_failureId) {
+- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+- return sGLContextProviderX11.CreateHeadless(desc, out_failureId);
+- } else {
+ return sGLContextProviderEGL.CreateHeadless(desc, out_failureId);
+- }
+ }
+
+ /*static*/
+ GLContext* GLContextProviderWayland::GetGlobalContext() {
+- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+- return sGLContextProviderX11.GetGlobalContext();
+- } else {
+ return sGLContextProviderEGL.GetGlobalContext();
+- }
+ }
+
+ /*static*/
+ void GLContextProviderWayland::Shutdown() {
+- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+- sGLContextProviderX11.Shutdown();
+- } else {
+ sGLContextProviderEGL.Shutdown();
+- }
+ }
+
+ } // namespace mozilla::gl
+diff --git a/gfx/thebes/gfxGdkNativeRenderer.cpp b/gfx/thebes/gfxGdkNativeRenderer.cpp
+index 49f3afd..95760b1 100644
+--- a/gfx/thebes/gfxGdkNativeRenderer.cpp
++++ b/gfx/thebes/gfxGdkNativeRenderer.cpp
+@@ -7,7 +7,7 @@
+ #include "gfxContext.h"
+ #include "gfxPlatformGtk.h"
+
+-#ifdef MOZ_X11
++#if 0
+ # include <gdk/gdkx.h>
+ # include "cairo-xlib.h"
+ # include "gfxXlibSurface.h"
+diff --git a/gfx/thebes/gfxGdkNativeRenderer.h b/gfx/thebes/gfxGdkNativeRenderer.h
+index e11a3ba..1cfaf8c 100644
+--- a/gfx/thebes/gfxGdkNativeRenderer.h
++++ b/gfx/thebes/gfxGdkNativeRenderer.h
+@@ -6,9 +6,9 @@
+ #ifndef GFXGDKNATIVERENDER_H_
+ #define GFXGDKNATIVERENDER_H_
+
+-#include <gdk/gdk.h>
++//#include <gdk/gdk.h>
+ #include "nsSize.h"
+-#ifdef MOZ_X11
++#if MOZ_X11
+ # include "gfxXlibNativeRenderer.h"
+ #endif
+
+diff --git a/old-configure b/old-configure
+index 621aa58..14a23b3 100644
+--- a/old-configure
++++ b/old-configure
+@@ -746,7 +746,6 @@ GLIB_VERSION=2.42
+ GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_42
+ GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_42
+ CAIRO_VERSION=1.10
+-GTK2_VERSION=2.18.0
+ GTK3_VERSION=3.14.0
+ GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_14
+ W32API_VERSION=3.14
+@@ -7890,78 +7889,6 @@ cat >> confdefs.h <<EOF
+ EOF
+
+ fi
+- if test "$MOZ_ENABLE_GTK"; then
+- cat >> confdefs.pytmp <<EOF
+- (''' GLIB_VERSION_MIN_REQUIRED ''', r''' $GLIB_VERSION_MIN_REQUIRED ''')
+-EOF
+-cat >> confdefs.h <<EOF
+-#define GLIB_VERSION_MIN_REQUIRED $GLIB_VERSION_MIN_REQUIRED
+-EOF
+-
+- cat >> confdefs.pytmp <<EOF
+- (''' GLIB_VERSION_MAX_ALLOWED ''', r''' $GLIB_VERSION_MAX_ALLOWED ''')
+-EOF
+-cat >> confdefs.h <<EOF
+-#define GLIB_VERSION_MAX_ALLOWED $GLIB_VERSION_MAX_ALLOWED
+-EOF
+-
+-
+- if test "$MOZ_X11"; then
+- succeeded=no
+-
+- if test -z "$PKG_CONFIG"; then
+- echo "*** The pkg-config script could not be found. Make sure it is"
+- echo "*** in your path, or set the PKG_CONFIG environment variable"
+- echo "*** to the full path to pkg-config."
+- echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+- else
+- PKG_CONFIG_MIN_VERSION=0.9.0
+- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+- echo $ac_n "checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0""... $ac_c" 1>&6
+-echo "configure:7922: checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0" >&5
+-
+- if $PKG_CONFIG --exists "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0" ; then
+- echo "$ac_t""yes" 1>&6
+- succeeded=yes
+-
+- echo $ac_n "checking MOZ_GTK2_CFLAGS""... $ac_c" 1>&6
+-echo "configure:7929: checking MOZ_GTK2_CFLAGS" >&5
+- MOZ_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0"`
+- echo "$ac_t""$MOZ_GTK2_CFLAGS" 1>&6
+-
+- echo $ac_n "checking MOZ_GTK2_LIBS""... $ac_c" 1>&6
+-echo "configure:7934: checking MOZ_GTK2_LIBS" >&5
+- ## Remove evil flags like -Wl,--export-dynamic
+- MOZ_GTK2_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0\" |sed s/-Wl,--export-dynamic//g`"
+- echo "$ac_t""$MOZ_GTK2_LIBS" 1>&6
+- else
+- MOZ_GTK2_CFLAGS=""
+- MOZ_GTK2_LIBS=""
+- ## If we have a custom action on failure, don't print errors, but
+- ## do set a variable so people can do so.
+- MOZ_GTK2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0"`
+- echo $MOZ_GTK2_PKG_ERRORS
+- fi
+-
+-
+-
+- else
+- echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+- echo "*** See http://www.freedesktop.org/software/pkgconfig"
+- fi
+- fi
+-
+- if test $succeeded = yes; then
+- :
+- else
+- if test "$COMPILE_ENVIRONMENT"; then
+- { echo "configure: error: Library requirements (gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; echo "configure: error: Library requirements (gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 gdk-x11-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&5; exit 1; }
+- fi
+- fi
+-
+- MOZ_GTK2_CFLAGS="-I${_topsrcdir}/widget/gtk/compat $MOZ_GTK2_CFLAGS"
+- fi
+- fi
+ fi # COMPILE_ENVIRONMENT
+
+
+@@ -10577,8 +10504,6 @@ sed 's/$/,/' >> $CONFIG_STATUS <<EOF
+ (''' MOZ_ANDROID_MAX_SDK_VERSION ''', r''' $MOZ_ANDROID_MAX_SDK_VERSION ''')
+ (''' MOZ_GTK3_CFLAGS ''', list(split(r''' $MOZ_GTK3_CFLAGS ''')))
+ (''' MOZ_GTK3_LIBS ''', list(split(r''' $MOZ_GTK3_LIBS ''')))
+- (''' MOZ_GTK2_CFLAGS ''', list(split(r''' $MOZ_GTK2_CFLAGS ''')))
+- (''' MOZ_GTK2_LIBS ''', list(split(r''' $MOZ_GTK2_LIBS ''')))
+ (''' MOZ_FS_LAYOUT ''', r''' $MOZ_FS_LAYOUT ''')
+ (''' TK_CFLAGS ''', list(split(r''' $TK_CFLAGS ''')))
+ (''' TK_LIBS ''', list(split(r''' $TK_LIBS ''')))
+diff --git a/widget/gtk/mozgtk/gtk2/moz.build b/widget/gtk/mozgtk/gtk2/moz.build
+deleted file mode 100644
+index 93e43c3..0000000
+--- a/widget/gtk/mozgtk/gtk2/moz.build
++++ /dev/null
+@@ -1,40 +0,0 @@
+-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+-# vim: set filetype=python:
+-# This Source Code Form is subject to the terms of the Mozilla Public
+-# License, v. 2.0. If a copy of the MPL was not distributed with this
+-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+-
+-SOURCES += [
+- "../mozgtk.c",
+-]
+-
+-DEFINES["GTK3_SYMBOLS"] = True
+-
+-SharedLibrary("mozgtk2")
+-
+-SHARED_LIBRARY_NAME = "mozgtk"
+-
+-FINAL_TARGET = "dist/bin/gtk2"
+-
+-# If LDFLAGS contains -Wl,--as-needed or if it's the default for the toolchain,
+-# we need to add -Wl,--no-as-needed before the gtk libraries, otherwise the
+-# linker will drop those dependencies because no symbols are used from them.
+-# But those dependencies need to be kept for things to work properly.
+-# Ideally, we'd only add -Wl,--no-as-needed if necessary, but it's just simpler
+-# to add it unconditionally. This library is also simple enough that forcing
+-# -Wl,--as-needed after the gtk libraries is not going to make a significant
+-# difference.
+-if CONFIG["GCC_USE_GNU_LD"]:
+- no_as_needed = ["-Wl,--no-as-needed"]
+- as_needed = ["-Wl,--as-needed"]
+-else:
+- no_as_needed = []
+- as_needed = []
+-
+-OS_LIBS += [f for f in CONFIG["MOZ_GTK2_LIBS"] if f.startswith("-L")]
+-OS_LIBS += no_as_needed
+-OS_LIBS += [
+- "gtk-x11-2.0",
+- "gdk-x11-2.0",
+-]
+-OS_LIBS += as_needed
+diff --git a/widget/gtk/mozgtk/gtk3/moz.build b/widget/gtk/mozgtk/gtk3/moz.build
+index b4ab68e..e6e4a6d 100644
+--- a/widget/gtk/mozgtk/gtk3/moz.build
++++ b/widget/gtk/mozgtk/gtk3/moz.build
+@@ -8,8 +8,6 @@ SOURCES += [
+ "../mozgtk.c",
+ ]
+
+-DEFINES["GTK2_SYMBOLS"] = True
+-
+ SharedLibrary("mozgtk")
+
+ SONAME = "mozgtk"
+diff --git a/widget/gtk/mozgtk/moz.build b/widget/gtk/mozgtk/moz.build
+index 8288583..cca6db0 100644
+--- a/widget/gtk/mozgtk/moz.build
++++ b/widget/gtk/mozgtk/moz.build
+@@ -4,4 +4,4 @@
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+-DIRS += ["stub", "gtk2", "gtk3"]
++DIRS += ["stub", "gtk3"]
+diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c
+index 0b2e3fd..0bb4ac0 100644
+--- a/widget/gtk/mozgtk/mozgtk.c
++++ b/widget/gtk/mozgtk/mozgtk.c
+@@ -646,21 +646,6 @@ STUB(gtk_color_chooser_get_rgba)
+ STUB(gtk_color_chooser_set_use_alpha)
+ #endif
+
+-#ifdef GTK2_SYMBOLS
+-STUB(gdk_drawable_get_screen)
+-STUB(gdk_rgb_get_colormap)
+-STUB(gdk_rgb_get_visual)
+-STUB(gdk_window_lookup)
+-STUB(gdk_window_set_back_pixmap)
+-STUB(gdk_x11_colormap_foreign_new)
+-STUB(gdk_x11_colormap_get_xcolormap)
+-STUB(gdk_x11_drawable_get_xdisplay)
+-STUB(gdk_x11_drawable_get_xid)
+-STUB(gdk_x11_window_get_drawable_impl)
+-STUB(gdkx_visual_get)
+-STUB(gtk_object_get_type)
+-#endif
+-
+ #ifndef GTK3_SYMBOLS
+ // Only define the following workaround when using GTK3, which we detect
+ // by checking if GTK3 stubs are not provided.
+diff --git a/widget/gtk/mozgtk/stub/moz.build b/widget/gtk/mozgtk/stub/moz.build
+index 8af0cc1..d523310 100644
+--- a/widget/gtk/mozgtk/stub/moz.build
++++ b/widget/gtk/mozgtk/stub/moz.build
+@@ -8,7 +8,7 @@ SOURCES += [
+ "../mozgtk.c",
+ ]
+
+-for var in ("COMMON_SYMBOLS", "GTK2_SYMBOLS", "GTK3_SYMBOLS"):
++for var in ("COMMON_SYMBOLS", "GTK3_SYMBOLS"):
+ DEFINES[var] = True
+
+ SharedLibrary("mozgtk_stub")
+diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
+index 5bfdcd9..95caf91 100644
+--- a/widget/gtk/nsWindow.h
++++ b/widget/gtk/nsWindow.h
+@@ -8,14 +8,14 @@
+ #ifndef __nsWindow_h__
+ #define __nsWindow_h__
+
+-#include <gdk/gdk.h>
++//#include <gdk/gdk.h>
+ #include <gtk/gtk.h>
+ #ifdef MOZ_X11
+ # include <gdk/gdkx.h>
+ # include "X11UndefineNone.h"
+ #endif /* MOZ_X11 */
+ #ifdef MOZ_WAYLAND
+-# include <gdk/gdkwayland.h>
++//# include <gdk/gdkwayland.h>
+ # include "base/thread.h"
+ # include "WaylandVsyncSource.h"
+ #endif
diff --git a/librewolf/sources b/librewolf/sources
@@ -0,0 +1,7 @@
+https://archive.mozilla.org/pub/firefox/releases/86.0/source/firefox-86.0.source.tar.xz
+https://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz autoconf2.13/
+https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz yasm/
+https://gitlab.com/librewolf-community/browser/linux/-/archive/v86.0-1/linux-v86.0-1.tar.gz
+git+https://gitlab.com/librewolf-community/browser/common.git common
+git+https://gitlab.com/librewolf-community/settings.git#c5c75a39dd91a8772255a78493853be6553262b2 settings
+patches/no-gtk2.patch
diff --git a/librewolf/version b/librewolf/version
@@ -0,0 +1 @@
+86.0-1 1