about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel')
-rw-r--r--nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/default.nix68
-rw-r--r--nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/indicators.patch21
-rw-r--r--nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix23
3 files changed, 112 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/default.nix b/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/default.nix
new file mode 100644
index 000000000000..c34beab7600d
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchFromGitHub, pantheon, fetchpatch, wrapGAppsHook, pkgconfig, meson, ninja
+, vala, gala, gtk3, libgee, granite, gettext, glib-networking, mutter, json-glib
+, python3, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "wingpanel";
+  version = "2.2.2";
+
+  src = fetchFromGitHub {
+    owner = "elementary";
+    repo = pname;
+    rev = version;
+    sha256 = "1knkqh9q6yp7qf27zi6ki20fq4w0ia2hklvv84ivfmfa0irz0j6r";
+  };
+
+  passthru = {
+    updateScript = pantheon.updateScript {
+      repoName = pname;
+    };
+  };
+
+  nativeBuildInputs = [
+    gettext
+    glib-networking
+    gobject-introspection
+    meson
+    ninja
+    pkgconfig
+    python3
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gala
+    granite
+    gtk3
+    json-glib
+    libgee
+    mutter
+  ];
+
+  patches = [
+    ./indicators.patch
+    # Fix wingpanel potentially overlapping windows: https://github.com/elementary/wingpanel/pull/198
+    (fetchpatch {
+      url = "https://github.com/elementary/wingpanel/commit/fc1b8ea3d6cfc5d6e4034af177eecd4542a59833.patch";
+      sha256 = "0w5z56di5lxwg9vb96f9y4r2q05znwpn814m2w12l3impf5xsdqs";
+    })
+  ];
+
+  postPatch = ''
+    chmod +x meson/post_install.py
+    patchShebangs meson/post_install.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "The extensible top panel for Pantheon";
+    longDescription = ''
+      Wingpanel is an empty container that accepts indicators as extensions,
+      including the applications menu.
+    '';
+    homepage = https://github.com/elementary/wingpanel;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = pantheon.maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/indicators.patch b/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/indicators.patch
new file mode 100644
index 000000000000..68a5fd532a8d
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/indicators.patch
@@ -0,0 +1,21 @@
+diff --git a/lib/IndicatorManager.vala b/lib/IndicatorManager.vala
+index a99a1ec..0ae7799 100644
+--- a/lib/IndicatorManager.vala
++++ b/lib/IndicatorManager.vala
+@@ -115,7 +115,15 @@ public class Wingpanel.IndicatorManager : GLib.Object {
+         }
+ 
+         /* load indicators */
+-        var base_folder = File.new_for_path (Build.INDICATORS_DIR);
++
++        var indicators_path = Environment.get_variable("WINGPANEL_INDICATORS_PATH");
++        if (indicators_path != null) {
++            debug ("WINGPANEL_INDICATORS_PATH set to %s", indicators_path);
++        } else {
++            critical ("WINGPANEL_INDICATORS_PATH not set");
++        }
++
++        var base_folder = File.new_for_path (indicators_path);
+ 
+         try {
+             monitor = base_folder.monitor_directory (FileMonitorFlags.NONE, null);
diff --git a/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
new file mode 100644
index 000000000000..cfae604d3a53
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
@@ -0,0 +1,23 @@
+{ lib, makeWrapper, symlinkJoin, wingpanel, wingpanelIndicators, switchboard-with-plugs, indicators ? null }:
+
+let
+  selectedIndicators = if indicators == null then wingpanelIndicators else indicators;
+in
+symlinkJoin {
+  name = "${wingpanel.name}-with-indicators";
+
+  paths = [ wingpanel ] ++ selectedIndicators;
+
+  buildInputs = [ makeWrapper ];
+
+  # We have to set SWITCHBOARD_PLUGS_PATH because wingpanel-applications-menu
+  # has a plugin to search switchboard settings
+  postBuild = ''
+    wrapProgram $out/bin/wingpanel \
+      --set WINGPANEL_INDICATORS_PATH "$out/lib/wingpanel" \
+      --set SWITCHBOARD_PLUGS_PATH "${switchboard-with-plugs}/lib/switchboard" \
+      --suffix XDG_DATA_DIRS : ${lib.concatMapStringsSep ":" (indicator: ''${indicator}/share/gsettings-schemas/${indicator.name}'') selectedIndicators}
+  '';
+
+  inherit (wingpanel) meta;
+}