From 30bf82ff5abf0563e48b27431cc9a1eab49eedba Mon Sep 17 00:00:00 2001 From: Alexander Wauck Date: Thu, 9 Apr 2026 10:02:01 -0500 Subject: [PATCH] surf: fix build and force use of X11 The latest version of surf from upstream git has support for webkitgtk-4.1, but it will crash on startup if allowed to run as a Wayland application (which any gtk3 app will happily do). So, I forced GDK_BACKEND=x11 in the wrapper as an interim solution until surf fully supports Wayland. --- pkgs/by-name/su/surf/package.nix | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/su/surf/package.nix b/pkgs/by-name/su/surf/package.nix index d7e31c56d772..83e8f47c450e 100644 --- a/pkgs/by-name/su/surf/package.nix +++ b/pkgs/by-name/su/surf/package.nix @@ -8,9 +8,8 @@ gcr, glib-networking, gsettings-desktop-schemas, - gtk2, - libsoup_2_4, - # webkitgtk_4_0, + gtk3, + libsoup_3, webkitgtk_4_1, xprop, dmenu, @@ -20,16 +19,15 @@ gst_all_1, patches ? null, }: - -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "surf"; - version = "2.1"; + version = "2.1-unstable-2025-04-19"; # tarball is missing file common.h src = fetchgit { url = "git://git.suckless.org/surf"; - rev = version; - sha256 = "1v926hiayddylq79n8l7dy51bm0dsa9n18nx9bkhg666cx973x4z"; + rev = "48517e586cdc98bc1af7115674b554cc70c8bc2e"; + hash = "sha256-+qg1mF5X/hYxCy7N3CxIEM2yHi1jmUGiK/vaQBjKy1I="; }; nativeBuildInputs = [ @@ -41,9 +39,9 @@ stdenv.mkDerivation rec { gcr glib-networking gsettings-desktop-schemas - gtk2 - libsoup_2_4 - # webkitgtk_4_0 + libsoup_3 + gtk3 + webkitgtk_4_1 ] ++ (with gst_all_1; [ # Audio & video support for webkitgtk WebView @@ -72,13 +70,11 @@ stdenv.mkDerivation rec { '' gappsWrapperArgs+=( --suffix PATH : ${depsPath} + --set GDK_BACKEND x11 ) ''; meta = { - # webkitgtk_4_0 was removed. master is supposed to support 4.1 - # but it crashes with BadWindow X Error - broken = true; description = "Simple web browser based on WebKitGTK"; mainProgram = "surf"; longDescription = ''