summary refs log tree commit diff
path: root/pkgs/desktops/pantheon/apps/switchboard-plugs/about
diff options
context:
space:
mode:
authorBobby Rong <rjl931189261@126.com>2021-07-16 23:02:01 +0800
committerBobby Rong <rjl931189261@126.com>2021-09-18 19:33:32 +0800
commit0f4d3a87b46edb704f6935c7452eba80684f5b6b (patch)
tree79ce9bb601f045845cc6368252836cfd9d5e121c /pkgs/desktops/pantheon/apps/switchboard-plugs/about
parent2912d5927a0d0515adff0c74d76f00fc8b774e95 (diff)
downloadnixpkgs-0f4d3a87b46edb704f6935c7452eba80684f5b6b.tar
nixpkgs-0f4d3a87b46edb704f6935c7452eba80684f5b6b.tar.gz
nixpkgs-0f4d3a87b46edb704f6935c7452eba80684f5b6b.tar.bz2
nixpkgs-0f4d3a87b46edb704f6935c7452eba80684f5b6b.tar.lz
nixpkgs-0f4d3a87b46edb704f6935c7452eba80684f5b6b.tar.xz
nixpkgs-0f4d3a87b46edb704f6935c7452eba80684f5b6b.tar.zst
nixpkgs-0f4d3a87b46edb704f6935c7452eba80684f5b6b.zip
pantheon.switchboard-plug-about: 2.6.3 -> 6.0.1
Diffstat (limited to 'pkgs/desktops/pantheon/apps/switchboard-plugs/about')
-rw-r--r--pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix37
-rw-r--r--pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-paths.patch26
-rw-r--r--pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch36
3 files changed, 49 insertions, 50 deletions
diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix
index adba2ec0801..cb12f5b8cc2 100644
--- a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix
+++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/default.nix
@@ -1,6 +1,5 @@
 { lib, stdenv
 , fetchFromGitHub
-, fetchpatch
 , nix-update-script
 , pantheon
 , substituteAll
@@ -9,22 +8,24 @@
 , pkg-config
 , vala
 , libgee
+, libgtop
+, libhandy
 , granite
 , gtk3
 , switchboard
-, pciutils
-, elementary-feedback
+, fwupd
+, appstream
 }:
 
 stdenv.mkDerivation rec {
   pname = "switchboard-plug-about";
-  version = "2.6.3";
+  version = "6.0.1";
 
   src = fetchFromGitHub {
     owner = "elementary";
     repo = pname;
     rev = version;
-    sha256 = "sha256-wis6wNEOOjPLUCT9vRRhMxbKHR2Y2nZArKogSF/FQv8=";
+    sha256 = "0c075ac7iqz4hqbp2ph0cwyhiq0jn6c1g1jjfhygjbssv3vvd268";
   };
 
   passthru = {
@@ -41,32 +42,20 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
+    appstream
+    fwupd
     granite
     gtk3
     libgee
+    libgtop
+    libhandy
     switchboard
   ];
 
   patches = [
-    # Get OS Info from GLib.Environment
-    # https://github.com/elementary/switchboard-plug-about/pull/128
-    (fetchpatch {
-      url = "https://github.com/elementary/switchboard-plug-about/commit/5ed29988e3a895b2df66e5529df0f12a94d5517c.patch";
-      sha256 = "1ipDxnpDZjpSEzZdtOeNe5U+QOXiB5M+hC3yDAsl/rQ=";
-    })
-
-    # Use Pretty Name
-    # https://github.com/elementary/switchboard-plug-about/pull/134
-    (fetchpatch {
-      url = "https://github.com/elementary/switchboard-plug-about/commit/653d131dc8fac10ae7523f2bf6b179ffffa9c0fd.patch";
-      sha256 = "AsM49Dc9/yn2tG6fqjfedeOlDXUu+iEoyNUmNYLH+zE=";
-    })
-
-    (substituteAll {
-      src = ./fix-paths.patch;
-      inherit pciutils;
-      elementary_feedback = elementary-feedback;
-    })
+    # The NixOS logo is not centered in the circular background and path
+    # to the background is hardcoded, we will drop the background.
+    ./remove-logo-background.patch
   ];
 
   meta = with lib; {
diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-paths.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-paths.patch
deleted file mode 100644
index d458689a325..00000000000
--- a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/fix-paths.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/Plug.vala b/src/Plug.vala
-index c32efcbe..0cdaeaca 100644
---- a/src/Plug.vala
-+++ b/src/Plug.vala
-@@ -178,7 +178,7 @@ public class About.Plug : Switchboard.Plug {
- 
-         var bug_button = new Gtk.Button.with_label (_("Report a Problem"));
-         bug_button.clicked.connect (() => {
--            var appinfo = new GLib.DesktopAppInfo ("io.elementary.feedback.desktop");
-+            var appinfo = new GLib.DesktopAppInfo ("@elementary_feedback@/bin/io.elementary.feedback.desktop");
-             if (appinfo != null) {
-                 try {
-                     appinfo.launch (null, null);
-diff --git a/src/Views/HardwareView.vala b/src/Views/HardwareView.vala
-index f8113634..3794bad8 100644
---- a/src/Views/HardwareView.vala
-+++ b/src/Views/HardwareView.vala
-@@ -179,7 +179,7 @@ public class About.HardwareView : Gtk.Grid {
- 
-         // Graphics
-         try {
--            Process.spawn_command_line_sync ("lspci", out graphics);
-+            Process.spawn_command_line_sync ("@pciutils@/bin/lspci", out graphics);
- 
-             if ("VGA" in graphics) { //VGA-keyword indicates graphics-line
-                 string[] lines = graphics.split("\n");
diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch
new file mode 100644
index 00000000000..bc7805a22c4
--- /dev/null
+++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/about/remove-logo-background.patch
@@ -0,0 +1,36 @@
+diff --git a/src/Views/OperatingSystemView.vala b/src/Views/OperatingSystemView.vala
+index fdb92e7..87bb3a4 100644
+--- a/src/Views/OperatingSystemView.vala
++++ b/src/Views/OperatingSystemView.vala
+@@ -39,21 +39,6 @@ public class About.OperatingSystemView : Gtk.Grid {
+             logo_icon_name = "distributor-logo";
+         }
+ 
+-        var logo = new Hdy.Avatar (128, "", false) {
+-            // In case the wallpaper can't be loaded, we don't want an icon or text
+-            icon_name = "invalid-icon-name",
+-            // We need this for the shadow to not get clipped by Gtk.Overlay
+-            margin = 6
+-        };
+-        logo.set_image_load_func ((size) => {
+-            try {
+-                return new Gdk.Pixbuf.from_file_at_scale ("/usr/share/backgrounds/elementaryos-default", -1, size, true);
+-            } catch (Error e) {
+-                critical (e.message);
+-            }
+-        });
+-        logo.get_style_context ().add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+-
+         var icon = new Gtk.Image () {
+             icon_name = logo_icon_name + "-symbolic",
+             // 128 minus 3px padding on each side
+@@ -65,8 +50,7 @@ public class About.OperatingSystemView : Gtk.Grid {
+         icon_style_context.add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+ 
+         var logo_overlay = new Gtk.Overlay ();
+-        logo_overlay.add (logo);
+-        logo_overlay.add_overlay (icon);
++        logo_overlay.add (icon);
+ 
+         // Intentionally not using GLib.OsInfoKey.PRETTY_NAME here because we
+         // want more granular control over text formatting