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 5 with lib; 6 7 - { 8 9 # Added 2019-08-09 10 imports = [ ··· 22 enable = mkEnableOption 23 "Evince, the GNOME document viewer"; 24 25 }; 26 27 }; ··· 31 32 config = mkIf config.programs.evince.enable { 33 34 - environment.systemPackages = [ pkgs.evince ]; 35 36 - services.dbus.packages = [ pkgs.evince ]; 37 38 - systemd.packages = [ pkgs.evince ]; 39 40 }; 41
··· 4 5 with lib; 6 7 + let cfg = config.programs.evince; 8 + 9 + in { 10 11 # Added 2019-08-09 12 imports = [ ··· 24 enable = mkEnableOption 25 "Evince, the GNOME document viewer"; 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 + 34 }; 35 36 }; ··· 40 41 config = mkIf config.programs.evince.enable { 42 43 + environment.systemPackages = [ cfg.package ]; 44 45 + services.dbus.packages = [ cfg.package ]; 46 47 + systemd.packages = [ cfg.package ]; 48 49 }; 50
+1
nixos/modules/services/x11/desktop-managers/pantheon.nix
··· 219 ] config.environment.pantheon.excludePackages); 220 221 programs.evince.enable = mkDefault true; 222 programs.file-roller.enable = mkDefault true; 223 224 # Settings from elementary-default-settings
··· 219 ] config.environment.pantheon.excludePackages); 220 221 programs.evince.enable = mkDefault true; 222 + programs.evince.package = pkgs.pantheon.evince; 223 programs.file-roller.enable = mkDefault true; 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 }; 48 49 patches = lib.optionals withPantheon [ 50 # https://github.com/elementary/browser 51 - ./dark-style.patch 52 - ./navigation-buttons.patch 53 ]; 54 55 nativeBuildInputs = [ ··· 95 p11-kit 96 sqlite 97 webkitgtk 98 - ] ++ lib.optional withPantheon pantheon.granite; 99 100 # Tests need an X display 101 mesonFlags = [
··· 47 }; 48 49 patches = lib.optionals withPantheon [ 50 + # Make this respect dark mode settings from Pantheon 51 # https://github.com/elementary/browser 52 + # The patch currently differs from upstream (updated for epiphany 40 and 41). 53 + ./pantheon-dark-style.patch 54 + ./pantheon-navigation-buttons.patch 55 ]; 56 57 nativeBuildInputs = [ ··· 97 p11-kit 98 sqlite 99 webkitgtk 100 + ] ++ lib.optionals withPantheon [ 101 + pantheon.granite 102 + ]; 103 104 # Tests need an X display 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 , gsettings-desktop-schemas 31 , gnome-desktop 32 , dbus 33 , python3 34 , texlive 35 , t1lib ··· 40 , supportMultimedia ? true # PDF multimedia 41 , libgxps 42 , supportXPS ? true # Open XML Paper Specification via libgxps 43 }: 44 45 stdenv.mkDerivation rec { ··· 52 url = "mirror://gnome/sources/evince/${lib.versions.major version}/${pname}-${version}.tar.xz"; 53 sha256 = "lautDW/urJVg2zq4C6fF6rsf3xyg47PJMzmvBUU6JNg="; 54 }; 55 56 postPatch = '' 57 chmod +x meson_post_install.py ··· 96 poppler 97 t1lib 98 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 ]); 102 103 mesonFlags = [ 104 "-Dnautilus=false" ··· 128 on the GNOME Desktop with a single simple application. 129 ''; 130 131 - license = lib.licenses.gpl2Plus; 132 platforms = platforms.linux; 133 - maintainers = teams.gnome.members; 134 }; 135 }
··· 30 , gsettings-desktop-schemas 31 , gnome-desktop 32 , dbus 33 + , pantheon 34 , python3 35 , texlive 36 , t1lib ··· 41 , supportMultimedia ? true # PDF multimedia 42 , libgxps 43 , supportXPS ? true # Open XML Paper Specification via libgxps 44 + , withPantheon ? false 45 }: 46 47 stdenv.mkDerivation rec { ··· 54 url = "mirror://gnome/sources/evince/${lib.versions.major version}/${pname}-${version}.tar.xz"; 55 sha256 = "lautDW/urJVg2zq4C6fF6rsf3xyg47PJMzmvBUU6JNg="; 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 + ]; 64 65 postPatch = '' 66 chmod +x meson_post_install.py ··· 105 poppler 106 t1lib 107 texlive.bin.core # kpathsea for DVI support 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 + ]; 120 121 mesonFlags = [ 122 "-Dnautilus=false" ··· 146 on the GNOME Desktop with a single simple application. 147 ''; 148 149 + license = licenses.gpl2Plus; 150 platforms = platforms.linux; 151 + maintainers = teams.gnome.members ++ teams.pantheon.members; 152 }; 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 72 epiphany = pkgs.epiphany.override { withPantheon = true; }; 73 74 sideload = callPackage ./apps/sideload { }; 75 76 #### DESKTOP
··· 71 72 epiphany = pkgs.epiphany.override { withPantheon = true; }; 73 74 + evince = pkgs.evince.override { withPantheon = true; }; 75 + 76 sideload = callPackage ./apps/sideload { }; 77 78 #### DESKTOP