@gjsify/node-gi 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gtk-runtime.js
CHANGED
|
@@ -158,7 +158,12 @@ export function maybePrependGtkRuntimeDllPath() {
|
|
|
158
158
|
* @returns {void}
|
|
159
159
|
*/
|
|
160
160
|
export function maybeWireGtkWindowingEnv() {
|
|
161
|
-
|
|
161
|
+
// win32 AND darwin ship a batteries-included --windowing bundle whose runtime
|
|
162
|
+
// DATA (gschemas / icons / loaders / gtksource / fonts) is located by these env
|
|
163
|
+
// vars — GLib/GTK read them at init, not at launch (unlike dyld's DYLD_FALLBACK),
|
|
164
|
+
// so setting them in-process works on both. The only platform difference is the
|
|
165
|
+
// XDG_DATA_DIRS separator (';' on win32, ':' on unix/darwin).
|
|
166
|
+
if (process.platform !== 'win32' && process.platform !== 'darwin') return;
|
|
162
167
|
const bundle = resolveGtkRuntimeBundle();
|
|
163
168
|
if (!bundle) return; // strict no-op when no bundle is present
|
|
164
169
|
|
|
@@ -166,6 +171,7 @@ export function maybeWireGtkWindowingEnv() {
|
|
|
166
171
|
// gschemas.compiled = the windowing-data marker; absent → display-free bundle.
|
|
167
172
|
if (!existsSync(join(schemaDir, 'gschemas.compiled'))) return;
|
|
168
173
|
|
|
174
|
+
const pathSep = process.platform === 'win32' ? ';' : ':';
|
|
169
175
|
const setIfUnset = (name, value) => {
|
|
170
176
|
if (!process.env[name]) process.env[name] = value;
|
|
171
177
|
};
|
|
@@ -177,11 +183,13 @@ export function maybeWireGtkWindowingEnv() {
|
|
|
177
183
|
setIfUnset('GDK_PIXBUF_MODULE_FILE', loaderCache);
|
|
178
184
|
}
|
|
179
185
|
|
|
186
|
+
// XDG_DATA_DIRS → <bundle>/share so the icon themes (share/icons) AND GtkSource's
|
|
187
|
+
// language-specs/styles (share/gtksourceview-5) resolve.
|
|
180
188
|
const shareDir = join(bundle.dir, 'share');
|
|
181
|
-
if (existsSync(
|
|
189
|
+
if (existsSync(shareDir)) {
|
|
182
190
|
const cur = process.env.XDG_DATA_DIRS ?? '';
|
|
183
|
-
if (!cur.split(
|
|
184
|
-
process.env.XDG_DATA_DIRS = cur ? `${shareDir}
|
|
191
|
+
if (!cur.split(pathSep).filter(Boolean).includes(shareDir)) {
|
|
192
|
+
process.env.XDG_DATA_DIRS = cur ? `${shareDir}${pathSep}${cur}` : shareDir;
|
|
185
193
|
}
|
|
186
194
|
}
|
|
187
195
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/node-gi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "GObject-Introspection runtime for Node.js — load gi:// namespaces (GLib/GObject/Gio/…) with GJS-compatible semantics. Vendored + rewritten from node-gtk under MIT.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
Binary file
|
|
Binary file
|