summary refs log tree commit diff
path: root/pkgs/desktops/gnome/core/epiphany
diff options
context:
space:
mode:
authorBobby Rong <rjl931189261@126.com>2021-10-27 09:00:38 +0800
committerBobby Rong <rjl931189261@126.com>2021-10-27 09:00:38 +0800
commit20a9ac8d35bb9a3b618df441bcc7c6f09353b040 (patch)
tree68f34ba1c0d4564c004d5fe5fe25ea85de7f4acf /pkgs/desktops/gnome/core/epiphany
parenta57a7c035f5152019541310883ffbaae480be62b (diff)
downloadnixpkgs-20a9ac8d35bb9a3b618df441bcc7c6f09353b040.tar
nixpkgs-20a9ac8d35bb9a3b618df441bcc7c6f09353b040.tar.gz
nixpkgs-20a9ac8d35bb9a3b618df441bcc7c6f09353b040.tar.bz2
nixpkgs-20a9ac8d35bb9a3b618df441bcc7c6f09353b040.tar.lz
nixpkgs-20a9ac8d35bb9a3b618df441bcc7c6f09353b040.tar.xz
nixpkgs-20a9ac8d35bb9a3b618df441bcc7c6f09353b040.tar.zst
nixpkgs-20a9ac8d35bb9a3b618df441bcc7c6f09353b040.zip
pantheon.epiphany: update patches
https://github.com/elementary/browser/pull/41
Diffstat (limited to 'pkgs/desktops/gnome/core/epiphany')
-rw-r--r--pkgs/desktops/gnome/core/epiphany/default.nix29
-rw-r--r--pkgs/desktops/gnome/core/epiphany/pantheon-dark-style.patch76
-rw-r--r--pkgs/desktops/gnome/core/epiphany/pantheon-navigation-buttons.patch12
3 files changed, 24 insertions, 93 deletions
diff --git a/pkgs/desktops/gnome/core/epiphany/default.nix b/pkgs/desktops/gnome/core/epiphany/default.nix
index 617ef1cc38f..6f996552064 100644
--- a/pkgs/desktops/gnome/core/epiphany/default.nix
+++ b/pkgs/desktops/gnome/core/epiphany/default.nix
@@ -3,6 +3,7 @@
 , ninja
 , gettext
 , fetchurl
+, fetchpatch
 , pkg-config
 , gtk3
 , glib
@@ -46,12 +47,30 @@ stdenv.mkDerivation rec {
     sha256 = "s50YJUkllbC3TF1qZoaoV/lBnfpMAvgBPCl7yHDibdA=";
   };
 
-  patches = lib.optionals withPantheon [
-    # Make this respect dark mode settings from Pantheon
+  patches = [
+    # tab-view: Update close button position on startup
+    # https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1025
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/epiphany/-/commit/6e9d6d3cf7fa7ddf21a70e9816a5cd4767a79523.patch";
+      sha256 = "sha256-lBVliGCIKwTvsYnWjAcmJxhTg1HS/2x4wlOh+4sx/xQ=";
+    })
+  ] ++ lib.optionals withPantheon [
+    # Pantheon specific patches for epiphany
     # https://github.com/elementary/browser
-    # The patch currently differs from upstream (updated for epiphany 40 and 41).
-    ./pantheon-dark-style.patch
-    ./pantheon-navigation-buttons.patch
+    #
+    # Make this respect dark mode settings from Pantheon
+    # https://github.com/elementary/browser/pull/21
+    # https://github.com/elementary/browser/pull/41
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/elementary/browser/cc17559a7ac6effe593712b4f3d0bbefde6e3b62/dark-style.patch";
+      sha256 = "sha256-RzMUc9P51UN3tRFefzRtMniXR9duOOmLj5eu5gL2TEQ=";
+    })
+    # Patch to unlink nav buttons
+    # https://github.com/elementary/browser/pull/18
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/elementary/browser/cc17559a7ac6effe593712b4f3d0bbefde6e3b62/navigation-buttons.patch";
+      sha256 = "sha256-G1/JUjn/8DyO9sgL/5Kq205KbTOs4EMi4Vf3cJ8FHXU=";
+    })
   ];
 
   nativeBuildInputs = [
diff --git a/pkgs/desktops/gnome/core/epiphany/pantheon-dark-style.patch b/pkgs/desktops/gnome/core/epiphany/pantheon-dark-style.patch
deleted file mode 100644
index 56ac5c1e5b2..00000000000
--- a/pkgs/desktops/gnome/core/epiphany/pantheon-dark-style.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-diff --git a/meson.build b/meson.build
-index de9cbfa850..647f617605 100644
---- a/meson.build
-+++ b/meson.build
-@@ -92,6 +92,7 @@ iso_codes_dep = dependency('iso-codes', version: '>= 0.35')
- json_glib_dep = dependency('json-glib-1.0', version: '>= 1.6')
- libarchive_dep = dependency('libarchive')
- libdazzle_dep = dependency('libdazzle-1.0', version: '>= 3.37.1')
-+libgranite_dep = dependency('granite', version: '>= 6.0.0')
- libhandy_dep = dependency('libhandy-1', version: '>= 1.1.0')
- libsecret_dep = dependency('libsecret-1', version: '>= 0.19.0')
- libsoup_dep = dependency('libsoup-2.4', version: '>= 2.48.0')
-diff --git a/src/ephy-shell.c b/src/ephy-shell.c
-index 650531da86..b9d1355e86 100644
---- a/src/ephy-shell.c
-+++ b/src/ephy-shell.c
-@@ -50,6 +50,7 @@
- 
- #include <glib/gi18n.h>
- #include <gtk/gtk.h>
-+#include <granite.h>
- #include <handy.h>
- 
- struct _EphyShell {
-@@ -483,6 +484,20 @@ run_in_background_set_mapping (const GValue       *value,
-   return g_variant_new_boolean (g_variant_get_boolean (var));
- }
- 
-+static void
-+ephy_shell_set_prefers_color_scheme (EphyShell *shell)
-+{
-+    GtkSettings* gtk_settings = gtk_settings_get_default ();
-+    GraniteSettings* granite_settings = granite_settings_get_default ();
-+
-+    g_object_set (
-+        gtk_settings,
-+        "gtk-application-prefer-dark-theme",
-+        granite_settings_get_prefers_color_scheme (granite_settings) == GRANITE_SETTINGS_COLOR_SCHEME_DARK,
-+        NULL
-+    );
-+}
-+
- static void
- ephy_shell_startup (GApplication *application)
- {
-@@ -490,11 +505,18 @@ ephy_shell_startup (GApplication *application)
-   EphyShell *shell = EPHY_SHELL (application);
-   EphyEmbedShellMode mode;
-   GAction *action;
-+  GraniteSettings* granite_settings = granite_settings_get_default ();
- 
-   G_APPLICATION_CLASS (ephy_shell_parent_class)->startup (application);
- 
-   hdy_init ();
- 
-+  ephy_shell_set_prefers_color_scheme (shell);
-+
-+  g_signal_connect (granite_settings, "notify::prefers-color-scheme",
-+    G_CALLBACK (ephy_shell_set_prefers_color_scheme), shell
-+  );
-+
-   /* If we are under Pantheon set the icon-theme and cursor-theme accordingly. */
-   if (is_desktop_pantheon ()) {
-     GtkSettings *settings = gtk_settings_get_default ();
-diff --git a/src/meson.build b/src/meson.build
-index 5bf3eb92ec..d17b1b6d93 100644
---- a/src/meson.build
-+++ b/src/meson.build
-@@ -74,6 +74,7 @@ libephymain_deps = [
-   gdk_dep,
-   gvdb_dep,
-   libarchive_dep,
-+  libgranite_dep,
-   libhandy_dep
- ]
- 
diff --git a/pkgs/desktops/gnome/core/epiphany/pantheon-navigation-buttons.patch b/pkgs/desktops/gnome/core/epiphany/pantheon-navigation-buttons.patch
deleted file mode 100644
index b7b3b620535..00000000000
--- a/pkgs/desktops/gnome/core/epiphany/pantheon-navigation-buttons.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/resources/gtk/action-bar-start.ui b/src/resources/gtk/action-bar-start.ui
-index e604b9601f..2bfe244d53 100644
---- a/src/resources/gtk/action-bar-start.ui
-+++ b/src/resources/gtk/action-bar-start.ui
-@@ -7,7 +7,6 @@
-         <property name="visible">True</property>
-         <property name="orientation">horizontal</property>
-         <style>
--          <class name="linked"/>
-           <class name="navigation-box"/>
-         </style>
-         <child>