Merge pull request #140828 from bobby285271/evince

pantheon.evince: init

authored by davidak and committed by GitHub 249d3f30 97774c04

+132 -12
+13 -4
nixos/modules/programs/evince.nix
··· 4 4 5 5 with lib; 6 6 7 - { 7 + let cfg = config.programs.evince; 8 + 9 + in { 8 10 9 11 # Added 2019-08-09 10 12 imports = [ ··· 22 24 enable = mkEnableOption 23 25 "Evince, the GNOME document viewer"; 24 26 27 + package = mkOption { 28 + type = types.package; 29 + default = pkgs.evince; 30 + defaultText = literalExpression "pkgs.evince"; 31 + description = "Evince derivation to use."; 32 + }; 33 + 25 34 }; 26 35 27 36 }; ··· 31 40 32 41 config = mkIf config.programs.evince.enable { 33 42 34 - environment.systemPackages = [ pkgs.evince ]; 43 + environment.systemPackages = [ cfg.package ]; 35 44 36 - services.dbus.packages = [ pkgs.evince ]; 45 + services.dbus.packages = [ cfg.package ]; 37 46 38 - systemd.packages = [ pkgs.evince ]; 47 + systemd.packages = [ cfg.package ]; 39 48 40 49 }; 41 50
+1
nixos/modules/services/x11/desktop-managers/pantheon.nix
··· 219 219 ] config.environment.pantheon.excludePackages); 220 220 221 221 programs.evince.enable = mkDefault true; 222 + programs.evince.package = pkgs.pantheon.evince; 222 223 programs.file-roller.enable = mkDefault true; 223 224 224 225 # Settings from elementary-default-settings
pkgs/desktops/gnome/core/epiphany/dark-style.patch pkgs/desktops/gnome/core/epiphany/pantheon-dark-style.patch
+7 -3
pkgs/desktops/gnome/core/epiphany/default.nix
··· 47 47 }; 48 48 49 49 patches = lib.optionals withPantheon [ 50 + # Make this respect dark mode settings from Pantheon 50 51 # https://github.com/elementary/browser 51 - ./dark-style.patch 52 - ./navigation-buttons.patch 52 + # The patch currently differs from upstream (updated for epiphany 40 and 41). 53 + ./pantheon-dark-style.patch 54 + ./pantheon-navigation-buttons.patch 53 55 ]; 54 56 55 57 nativeBuildInputs = [ ··· 95 97 p11-kit 96 98 sqlite 97 99 webkitgtk 98 - ] ++ lib.optional withPantheon pantheon.granite; 100 + ] ++ lib.optionals withPantheon [ 101 + pantheon.granite 102 + ]; 99 103 100 104 # Tests need an X display 101 105 mesonFlags = [
pkgs/desktops/gnome/core/epiphany/navigation-buttons.patch pkgs/desktops/gnome/core/epiphany/pantheon-navigation-buttons.patch
+23 -5
pkgs/desktops/gnome/core/evince/default.nix
··· 30 30 , gsettings-desktop-schemas 31 31 , gnome-desktop 32 32 , dbus 33 + , pantheon 33 34 , python3 34 35 , texlive 35 36 , t1lib ··· 40 41 , supportMultimedia ? true # PDF multimedia 41 42 , libgxps 42 43 , supportXPS ? true # Open XML Paper Specification via libgxps 44 + , withPantheon ? false 43 45 }: 44 46 45 47 stdenv.mkDerivation rec { ··· 52 54 url = "mirror://gnome/sources/evince/${lib.versions.major version}/${pname}-${version}.tar.xz"; 53 55 sha256 = "lautDW/urJVg2zq4C6fF6rsf3xyg47PJMzmvBUU6JNg="; 54 56 }; 57 + 58 + patches = lib.optionals withPantheon [ 59 + # Make this respect dark mode settings from Pantheon 60 + # https://github.com/elementary/evince 61 + # The patch currently differs from upstream (updated for evince 41). 62 + ./pantheon-dark-style.patch 63 + ]; 55 64 56 65 postPatch = '' 57 66 chmod +x meson_post_install.py ··· 96 105 poppler 97 106 t1lib 98 107 texlive.bin.core # kpathsea for DVI support 99 - ] ++ lib.optional supportXPS libgxps 100 - ++ lib.optionals supportMultimedia (with gst_all_1; [ 101 - gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ]); 108 + ] ++ lib.optionals supportXPS [ 109 + libgxps 110 + ] ++ lib.optionals supportMultimedia (with gst_all_1; [ 111 + gstreamer 112 + gst-plugins-base 113 + gst-plugins-good 114 + gst-plugins-bad 115 + gst-plugins-ugly 116 + gst-libav 117 + ]) ++ lib.optionals withPantheon [ 118 + pantheon.granite 119 + ]; 102 120 103 121 mesonFlags = [ 104 122 "-Dnautilus=false" ··· 128 146 on the GNOME Desktop with a single simple application. 129 147 ''; 130 148 131 - license = lib.licenses.gpl2Plus; 149 + license = licenses.gpl2Plus; 132 150 platforms = platforms.linux; 133 - maintainers = teams.gnome.members; 151 + maintainers = teams.gnome.members ++ teams.pantheon.members; 134 152 }; 135 153 }
+86
pkgs/desktops/gnome/core/evince/pantheon-dark-style.patch
··· 1 + diff --git a/meson.build b/meson.build 2 + index bcb69cf7..4a18c08c 100644 3 + --- a/meson.build 4 + +++ b/meson.build 5 + @@ -162,6 +162,7 @@ gmodule_dep = dependency('gmodule-2.0') 6 + gmodule_no_export_dep = dependency('gmodule-no-export-2.0', version: glib_req_version) 7 + gtk_dep = dependency('gtk+-3.0', version: gtk_req_version) 8 + gthread_dep = dependency('gthread-2.0', version: glib_req_version) 9 + +granite_dep = dependency('granite') 10 + # Keep the version here synchronised with subprojects/libhandy.wrap 11 + hdy_dep = dependency('libhandy-1', version: hdy_req_version, fallback: ['libhandy', 'libhandy_dep']) 12 + 13 + diff --git a/shell/ev-application.c b/shell/ev-application.c 14 + index e704bda2..d705328c 100644 15 + --- a/shell/ev-application.c 16 + +++ b/shell/ev-application.c 17 + @@ -30,6 +30,7 @@ 18 + #include <glib/gi18n.h> 19 + #include <glib/gstdio.h> 20 + #include <gtk/gtk.h> 21 + +#include <granite.h> 22 + #include <handy.h> 23 + #ifdef GDK_WINDOWING_X11 24 + #include <gdk/gdkx.h> 25 + @@ -176,7 +177,7 @@ ev_spawn (const char *uri, 26 + 27 + g_string_append_printf (cmd, " %s", path); 28 + g_free (path); 29 + - 30 + + 31 + /* Page label */ 32 + if (dest) { 33 + switch (ev_link_dest_get_dest_type (dest)) { 34 + @@ -940,6 +941,20 @@ ev_application_migrate_config_dir (EvApplication *application) 35 + g_free (old_accels); 36 + } 37 + 38 + +static void 39 + +ev_application_set_prefers_color_scheme () 40 + +{ 41 + + GtkSettings* gtk_settings = gtk_settings_get_default (); 42 + + GraniteSettings* granite_settings = granite_settings_get_default (); 43 + + 44 + + g_object_set ( 45 + + gtk_settings, 46 + + "gtk-application-prefer-dark-theme", 47 + + granite_settings_get_prefers_color_scheme (granite_settings) == GRANITE_SETTINGS_COLOR_SCHEME_DARK, 48 + + NULL 49 + + ); 50 + +} 51 + + 52 + static void 53 + ev_application_startup (GApplication *gapplication) 54 + { 55 + @@ -992,6 +1007,7 @@ ev_application_startup (GApplication *gapplication) 56 + 57 + EvApplication *application = EV_APPLICATION (gapplication); 58 + const gchar **it; 59 + + GraniteSettings* granite_settings = granite_settings_get_default (); 60 + 61 + g_application_set_resource_base_path (gapplication, "/org/gnome/evince"); 62 + 63 + @@ -999,6 +1015,11 @@ ev_application_startup (GApplication *gapplication) 64 + 65 + hdy_init (); 66 + 67 + + ev_application_set_prefers_color_scheme (); 68 + + 69 + + g_signal_connect (granite_settings, "notify::prefers-color-scheme", 70 + + G_CALLBACK(ev_application_set_prefers_color_scheme), NULL); 71 + + 72 + for (it = action_accels; it[0]; it += g_strv_length ((gchar **)it) + 1) 73 + gtk_application_set_accels_for_action (GTK_APPLICATION (application), it[0], &it[1]); 74 + } 75 + diff --git a/shell/meson.build b/shell/meson.build 76 + index 7cbc48f2..a3089b13 100644 77 + --- a/shell/meson.build 78 + +++ b/shell/meson.build 79 + @@ -52,6 +52,7 @@ sources += gnome.compile_resources( 80 + deps = [ 81 + gdk_pixbuf_dep, 82 + gnome_desktop_dep, 83 + + granite_dep, 84 + hdy_dep, 85 + libevmisc_dep, 86 + libevproperties_dep,
+2
pkgs/desktops/pantheon/default.nix
··· 71 71 72 72 epiphany = pkgs.epiphany.override { withPantheon = true; }; 73 73 74 + evince = pkgs.evince.override { withPantheon = true; }; 75 + 74 76 sideload = callPackage ./apps/sideload { }; 75 77 76 78 #### DESKTOP