diff options
author | Federico Damián Schonborn <fdschonborn@gmail.com> | 2023-04-21 20:50:26 -0300 |
---|---|---|
committer | Federico Damián Schonborn <fdschonborn@gmail.com> | 2023-04-23 10:39:37 -0300 |
commit | 2a789314349583bb3ad0fb98e88dee972ade6b3f (patch) | |
tree | ee79aad5923d023a7cddd827dce84d91985c4a5f /pkgs/desktops/budgie | |
parent | 043340c046f56a92cff8407aa1de63b53e0ab71c (diff) |
budgie.budgie-desktop-with-plugins: init
Signed-off-by: Federico Damián Schonborn <fdschonborn@gmail.com>
Diffstat (limited to 'pkgs/desktops/budgie')
-rw-r--r-- | pkgs/desktops/budgie/budgie-desktop/default.nix | 4 | ||||
-rw-r--r-- | pkgs/desktops/budgie/budgie-desktop/plugins.patch | 66 | ||||
-rw-r--r-- | pkgs/desktops/budgie/budgie-desktop/wrapper.nix | 53 | ||||
-rw-r--r-- | pkgs/desktops/budgie/default.nix | 1 |
4 files changed, 124 insertions, 0 deletions
diff --git a/pkgs/desktops/budgie/budgie-desktop/default.nix b/pkgs/desktops/budgie/budgie-desktop/default.nix index 252f4cbd38d4..6c593206ac51 100644 --- a/pkgs/desktops/budgie/budgie-desktop/default.nix +++ b/pkgs/desktops/budgie/budgie-desktop/default.nix @@ -46,6 +46,10 @@ stdenv.mkDerivation rec { sha256 = "sha256-ww65J9plixbxFza6xCfaz1WYtT9giKkLVH1XYxH41+0="; }; + patches = [ + ./plugins.patch + ]; + nativeBuildInputs = [ docbook-xsl-nons gtk-doc diff --git a/pkgs/desktops/budgie/budgie-desktop/plugins.patch b/pkgs/desktops/budgie/budgie-desktop/plugins.patch new file mode 100644 index 000000000000..af03fb635140 --- /dev/null +++ b/pkgs/desktops/budgie/budgie-desktop/plugins.patch @@ -0,0 +1,66 @@ +diff --git a/src/panel/plugin_manager.vala b/src/panel/plugin_manager.vala +index d3cdb65c..9d569bd1 100644 +--- a/src/panel/plugin_manager.vala ++++ b/src/panel/plugin_manager.vala +@@ -40,10 +40,26 @@ namespace Budgie { + } + + /* System path */ +- var dir = Environment.get_user_data_dir(); +- engine.add_search_path(Budgie.MODULE_DIRECTORY, Budgie.MODULE_DATA_DIRECTORY); ++ var libdir = Environment.get_variable("BUDGIE_PLUGIN_LIBDIR"); ++ if (libdir != null) { ++ debug("BUDGIE_PLUGIN_LIBDIR is set to %s", libdir); ++ } else { ++ debug("BUDGIE_PLUGIN_LIBDIR is unset, defaulting to %s", Budgie.MODULE_DIRECTORY); ++ libdir = Budgie.MODULE_DIRECTORY; ++ } ++ ++ var datadir = Environment.get_variable("BUDGIE_PLUGIN_DATADIR"); ++ if (datadir != null) { ++ debug("BUDGIE_PLUGIN_DATADIR is set to %s", datadir); ++ } else { ++ debug("BUDGIE_PLUGIN_DATADIR is unset, defaulting to %s", Budgie.MODULE_DATA_DIRECTORY); ++ datadir = Budgie.MODULE_DATA_DIRECTORY; ++ } ++ ++ engine.add_search_path(libdir, datadir); + + /* User path */ ++ var dir = Environment.get_user_data_dir(); + var user_mod = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "plugins"); + var hdata = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "data"); + engine.add_search_path(user_mod, hdata); +diff --git a/src/raven/plugin_manager.vala b/src/raven/plugin_manager.vala +index b0814693..d671109a 100644 +--- a/src/raven/plugin_manager.vala ++++ b/src/raven/plugin_manager.vala +@@ -51,10 +51,26 @@ namespace Budgie { + } + + /* System path */ +- var dir = Environment.get_user_data_dir(); +- engine.add_search_path(Budgie.RAVEN_PLUGIN_LIBDIR, Budgie.RAVEN_PLUGIN_DATADIR); ++ var libdir = Environment.get_variable("RAVEN_PLUGIN_LIBDIR"); ++ if (libdir != null) { ++ debug("RAVEN_PLUGIN_LIBDIR is set to %s", libdir); ++ } else { ++ debug("RAVEN_PLUGIN_LIBDIR is unset, defaulting to %s", Budgie.RAVEN_PLUGIN_LIBDIR); ++ libdir = Budgie.RAVEN_PLUGIN_LIBDIR; ++ } ++ ++ var datadir = Environment.get_variable("RAVEN_PLUGIN_DATADIR"); ++ if (datadir != null) { ++ debug("RAVEN_PLUGIN_DATADIR is set to %s", datadir); ++ } else { ++ debug("RAVEN_PLUGIN_DATADIR is unset, defaulting to %s", Budgie.RAVEN_PLUGIN_DATADIR); ++ datadir = Budgie.RAVEN_PLUGIN_DATADIR; ++ } ++ ++ engine.add_search_path(libdir, datadir); + + /* User path */ ++ var dir = Environment.get_user_data_dir(); + var user_mod = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "raven-plugins"); + var hdata = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "raven-data"); + engine.add_search_path(user_mod, hdata); diff --git a/pkgs/desktops/budgie/budgie-desktop/wrapper.nix b/pkgs/desktops/budgie/budgie-desktop/wrapper.nix new file mode 100644 index 000000000000..88c8d132bf12 --- /dev/null +++ b/pkgs/desktops/budgie/budgie-desktop/wrapper.nix @@ -0,0 +1,53 @@ +{ lib +, stdenv +, glib +, xorg +, wrapGAppsHook +, budgie-desktop +, plugins ? [] +}: + +stdenv.mkDerivation { + pname = "${budgie-desktop.pname}-with-plugins"; + inherit (budgie-desktop) version; + + src = null; + + paths = [ + budgie-desktop + ] ++ plugins; + + passAsFile = [ "paths" ]; + + nativeBuildInputs = [ + glib + wrapGAppsHook + ]; + + buildInputs = lib.forEach plugins (plugin: plugin.buildInputs) ++ plugins; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + preferLocalBuild = true; + allowSubstitutes = false; + + installPhase = '' + mkdir -p $out + for i in $(cat $pathsPath); do + ${xorg.lndir}/bin/lndir -silent $i $out + done + ''; + + preFixup = '' + gappsWrapperArgs+=( + --set BUDGIE_PLUGIN_LIBDIR "$out/lib/budgie-desktop/plugins" + --set BUDGIE_PLUGIN_DATADIR "$out/share/budgie-desktop/plugins" + --set RAVEN_PLUGIN_LIBDIR "$out/lib/budgie-desktop/raven-plugins" + --set RAVEN_PLUGIN_DATADIR "$out/share/budgie-desktop/raven-plugins" + ) + ''; + + inherit (budgie-desktop) meta; +} diff --git a/pkgs/desktops/budgie/default.nix b/pkgs/desktops/budgie/default.nix index cfbf8ecc8c6c..8c49ac5b0234 100644 --- a/pkgs/desktops/budgie/default.nix +++ b/pkgs/desktops/budgie/default.nix @@ -6,6 +6,7 @@ lib.makeScope pkgs.newScope (self: with self; { budgie-control-center = callPackage ./budgie-control-center { }; budgie-desktop = callPackage ./budgie-desktop { }; budgie-desktop-view = callPackage ./budgie-desktop-view { }; + budgie-desktop-with-plugins = callPackage ./budgie-desktop/wrapper.nix { }; budgie-gsettings-overrides = callPackage ./budgie-gsettings-overrides { }; budgie-screensaver = callPackage ./budgie-screensaver { }; }) |