budgie.budgie-desktop-with-plugins: init

Signed-off-by: Federico Damián Schonborn <fdschonborn@gmail.com>
This commit is contained in:
Federico Damián Schonborn 2023-04-21 20:50:26 -03:00
parent 043340c046
commit 2a78931434
No known key found for this signature in database
GPG key ID: 193F70F15C9AB0A0
4 changed files with 124 additions and 0 deletions

View file

@ -46,6 +46,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-ww65J9plixbxFza6xCfaz1WYtT9giKkLVH1XYxH41+0=";
};
patches = [
./plugins.patch
];
nativeBuildInputs = [
docbook-xsl-nons
gtk-doc

View file

@ -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);

View file

@ -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;
}

View file

@ -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 { };
})