Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / bu / budgie-desktop / plugins.patch
blob9fa40adaa5dcca5b70c2cd3345855d7c11e4ae74
1 diff --git a/meson.build b/meson.build
2 index 6c6e473e..9b8fb73a 100644
3 --- a/meson.build
4 +++ b/meson.build
5 @@ -88,11 +88,6 @@ datadir = join_paths(prefix, get_option('datadir'))
6 localedir = join_paths(prefix, get_option('localedir'))
7 podir = join_paths(meson.source_root(), 'po')
9 -cdata.set_quoted('DATADIR', datadir)
10 -cdata.set_quoted('SYSCONFDIR', confdir)
11 -cdata.set_quoted('LOCALEDIR', localedir)
12 -cdata.set_quoted('PACKAGE_URL', 'https://buddiesofbudgie.org')
14 # Handle i18n on the .desktop file
15 # Originally stolem from TingPing:
16 # https://github.com/vinszent/gnome-twitch/blob/master/data/meson.build
17 @@ -111,23 +106,10 @@ cdata.set_quoted('MODULEDIR', plugin_libdir)
18 cdata.set_quoted('MODULE_DATA_DIR', plugin_datadir)
19 cdata.set_quoted('RAVEN_PLUGIN_LIBDIR', raven_plugin_libdir)
20 cdata.set_quoted('RAVEN_PLUGIN_DATADIR', raven_plugin_datadir)
22 -if prefix == '/usr' or prefix == '/usr/local'
23 - cdata.set('HAS_SECONDARY_PLUGIN_DIRS', true)
25 - if prefix == '/usr'
26 - secondary_libdir_root = join_paths(prefix, 'local', get_option('libdir'), meson.project_name())
27 - secondary_datadir_root = join_paths(prefix, 'local', get_option('datadir'), meson.project_name())
28 - else
29 - secondary_libdir_root = join_paths('/usr', get_option('libdir'), meson.project_name())
30 - secondary_datadir_root = join_paths('/usr', get_option('datadir'), meson.project_name())
31 - endif
33 - cdata.set_quoted('MODULEDIR_SECONDARY', join_paths(secondary_libdir_root, 'plugins'))
34 - cdata.set_quoted('MODULE_DATA_DIR_SECONDARY', join_paths(secondary_datadir_root, 'plugins'))
35 - cdata.set_quoted('RAVEN_PLUGIN_LIBDIR_SECONDARY', join_paths(secondary_libdir_root, 'raven-plugins'))
36 - cdata.set_quoted('RAVEN_PLUGIN_DATADIR_SECONDARY', join_paths(secondary_datadir_root, 'raven-plugins'))
37 -endif
38 +cdata.set_quoted('DATADIR', datadir)
39 +cdata.set_quoted('SYSCONFDIR', confdir)
40 +cdata.set_quoted('LOCALEDIR', localedir)
41 +cdata.set_quoted('PACKAGE_URL', 'https://buddiesofbudgie.org')
43 with_bluetooth = get_option('with-bluetooth')
44 if with_bluetooth == true
45 diff --git a/src/config/budgie-config.c b/src/config/budgie-config.c
46 index 3ffe3632..da53e054 100644
47 --- a/src/config/budgie-config.c
48 +++ b/src/config/budgie-config.c
49 @@ -11,7 +11,6 @@
51 #ifndef CONFIG_H_INCLUDED
52 #include "config.h"
53 -#include <stdbool.h>
54 #include <stddef.h>
56 /**
57 @@ -22,20 +21,6 @@ const char* BUDGIE_MODULE_DATA_DIRECTORY = MODULE_DATA_DIR;
58 const char* BUDGIE_RAVEN_PLUGIN_LIBDIR = RAVEN_PLUGIN_LIBDIR;
59 const char* BUDGIE_RAVEN_PLUGIN_DATADIR = RAVEN_PLUGIN_DATADIR;
61 -#ifdef HAS_SECONDARY_PLUGIN_DIRS
62 -const bool BUDGIE_HAS_SECONDARY_PLUGIN_DIRS = true;
63 -const char* BUDGIE_MODULE_DIRECTORY_SECONDARY = MODULEDIR_SECONDARY;
64 -const char* BUDGIE_MODULE_DATA_DIRECTORY_SECONDARY = MODULE_DATA_DIR_SECONDARY;
65 -const char* BUDGIE_RAVEN_PLUGIN_LIBDIR_SECONDARY = RAVEN_PLUGIN_LIBDIR_SECONDARY;
66 -const char* BUDGIE_RAVEN_PLUGIN_DATADIR_SECONDARY = RAVEN_PLUGIN_DATADIR_SECONDARY;
67 -#else
68 -const bool BUDGIE_HAS_SECONDARY_PLUGIN_DIRS = false;
69 -const char* BUDGIE_MODULE_DIRECTORY_SECONDARY = NULL;
70 -const char* BUDGIE_MODULE_DATA_DIRECTORY_SECONDARY = NULL;
71 -const char* BUDGIE_RAVEN_PLUGIN_LIBDIR_SECONDARY = NULL;
72 -const char* BUDGIE_RAVEN_PLUGIN_DATADIR_SECONDARY = NULL;
73 -#endif
75 const char* BUDGIE_DATADIR = DATADIR;
76 const char* BUDGIE_VERSION = PACKAGE_VERSION;
77 const char* BUDGIE_WEBSITE = PACKAGE_URL;
78 diff --git a/src/config/budgie-config.h b/src/config/budgie-config.h
79 index b7581203..11df4347 100644
80 --- a/src/config/budgie-config.h
81 +++ b/src/config/budgie-config.h
82 @@ -12,7 +12,6 @@
83 #ifndef _BUDGIE_CONFIG_H_
84 #define _BUDGIE_CONFIG_H_
86 -#include <stdbool.h>
87 #include <stddef.h>
89 /* i.e. /usr/lib/budgie-desktop */
90 @@ -27,12 +26,6 @@ extern const char* BUDGIE_RAVEN_PLUGIN_LIBDIR;
91 /* i.e. /usr/share/budgie-desktop/raven-plugins */
92 extern const char* BUDGIE_RAVEN_PLUGIN_DATADIR;
94 -extern const bool BUDGIE_HAS_SECONDARY_PLUGIN_DIRS;
95 -extern const char* BUDGIE_MODULE_DIRECTORY_SECONDARY;
96 -extern const char* BUDGIE_MODULE_DATA_DIRECTORY_SECONDARY;
97 -extern const char* BUDGIE_RAVEN_PLUGIN_LIBDIR_SECONDARY;
98 -extern const char* BUDGIE_RAVEN_PLUGIN_DATADIR_SECONDARY;
100 /* i.e. /usr/share/ */
101 extern const char* BUDGIE_DATADIR;
103 diff --git a/src/config/budgie-config.vapi b/src/config/budgie-config.vapi
104 index 5eb445d1..7d27e348 100644
105 --- a/src/config/budgie-config.vapi
106 +++ b/src/config/budgie-config.vapi
107 @@ -22,21 +22,6 @@ namespace Budgie {
108 [CCode (cheader_filename="budgie-config.h")]
109 public extern const string RAVEN_PLUGIN_DATADIR;
111 - [CCode (cheader_filename="budgie-config.h")]
112 - public extern const bool HAS_SECONDARY_PLUGIN_DIRS;
114 - [CCode (cheader_filename="budgie-config.h")]
115 - public extern const string? MODULE_DIRECTORY_SECONDARY;
117 - [CCode (cheader_filename="budgie-config.h")]
118 - public extern const string? MODULE_DATA_DIRECTORY_SECONDARY;
120 - [CCode (cheader_filename="budgie-config.h")]
121 - public extern const string? RAVEN_PLUGIN_LIBDIR_SECONDARY;
123 - [CCode (cheader_filename="budgie-config.h")]
124 - public extern const string? RAVEN_PLUGIN_DATADIR_SECONDARY;
126 [CCode (cheader_filename="budgie-config.h")]
127 public extern const string DATADIR;
129 diff --git a/src/panel/plugin_manager.vala b/src/panel/plugin_manager.vala
130 index f4f2e4da..3dfee49a 100644
131 --- a/src/panel/plugin_manager.vala
132 +++ b/src/panel/plugin_manager.vala
133 @@ -40,13 +40,26 @@ namespace Budgie {
136 /* System path */
137 - var dir = Environment.get_user_data_dir();
138 - engine.add_search_path(Budgie.MODULE_DIRECTORY, Budgie.MODULE_DATA_DIRECTORY);
139 - if (Budgie.HAS_SECONDARY_PLUGIN_DIRS) {
140 - engine.add_search_path(Budgie.MODULE_DIRECTORY_SECONDARY, Budgie.MODULE_DATA_DIRECTORY_SECONDARY);
141 + var libdir = Environment.get_variable("BUDGIE_PLUGIN_LIBDIR");
142 + if (libdir != null) {
143 + debug("BUDGIE_PLUGIN_LIBDIR is set to %s", libdir);
144 + } else {
145 + debug("BUDGIE_PLUGIN_LIBDIR is unset, defaulting to %s", Budgie.MODULE_DIRECTORY);
146 + libdir = Budgie.MODULE_DIRECTORY;
149 + var datadir = Environment.get_variable("BUDGIE_PLUGIN_DATADIR");
150 + if (datadir != null) {
151 + debug("BUDGIE_PLUGIN_DATADIR is set to %s", datadir);
152 + } else {
153 + debug("BUDGIE_PLUGIN_DATADIR is unset, defaulting to %s", Budgie.MODULE_DATA_DIRECTORY);
154 + datadir = Budgie.MODULE_DATA_DIRECTORY;
157 + engine.add_search_path(libdir, datadir);
159 /* User path */
160 + var dir = Environment.get_user_data_dir();
161 var user_mod = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "plugins");
162 var hdata = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "data");
163 engine.add_search_path(user_mod, hdata);
164 diff --git a/src/raven/plugin_manager.vala b/src/raven/plugin_manager.vala
165 index 01f32553..2826b7e5 100644
166 --- a/src/raven/plugin_manager.vala
167 +++ b/src/raven/plugin_manager.vala
168 @@ -51,13 +51,26 @@ namespace Budgie {
171 /* System path */
172 - var dir = Environment.get_user_data_dir();
173 - engine.add_search_path(Budgie.RAVEN_PLUGIN_LIBDIR, Budgie.RAVEN_PLUGIN_DATADIR);
174 - if (Budgie.HAS_SECONDARY_PLUGIN_DIRS) {
175 - engine.add_search_path(Budgie.RAVEN_PLUGIN_LIBDIR_SECONDARY, Budgie.RAVEN_PLUGIN_DATADIR_SECONDARY);
176 + var libdir = Environment.get_variable("RAVEN_PLUGIN_LIBDIR");
177 + if (libdir != null) {
178 + debug("RAVEN_PLUGIN_LIBDIR is set to %s", libdir);
179 + } else {
180 + debug("RAVEN_PLUGIN_LIBDIR is unset, defaulting to %s", Budgie.RAVEN_PLUGIN_LIBDIR);
181 + libdir = Budgie.RAVEN_PLUGIN_LIBDIR;
184 + var datadir = Environment.get_variable("RAVEN_PLUGIN_DATADIR");
185 + if (datadir != null) {
186 + debug("RAVEN_PLUGIN_DATADIR is set to %s", datadir);
187 + } else {
188 + debug("RAVEN_PLUGIN_DATADIR is unset, defaulting to %s", Budgie.RAVEN_PLUGIN_DATADIR);
189 + datadir = Budgie.RAVEN_PLUGIN_DATADIR;
192 + engine.add_search_path(libdir, datadir);
194 /* User path */
195 + var dir = Environment.get_user_data_dir();
196 var user_mod = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "raven-plugins");
197 var hdata = Path.build_path(Path.DIR_SEPARATOR_S, dir, "budgie-desktop", "raven-data");
198 engine.add_search_path(user_mod, hdata);