@gjsify/gtk-runtime-win32-x64 0.26.1 → 0.27.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/gtk-runtime-win32-x64",
3
- "version": "0.26.1",
3
+ "version": "0.27.1",
4
4
  "description": "Batteries-included GTK/GObject-Introspection runtime bundle for Windows x64 — lets @gjsify/node-gi load gi:// namespaces (GLib/GObject/Gio/cairo/Pango/Graphene/Gdk) with NO gvsbuild/system GTK. Platform-gated (win32/x64 only).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,16 +34,7 @@
34
34
  // Reference: GJS ships no relocation; gvsbuild ships the MSVC-ABI GTK4 stack whose
35
35
  // DLLs load into stock (MSVC-ABI) Node.
36
36
  import { execFileSync } from 'node:child_process';
37
- import {
38
- copyFileSync,
39
- cpSync,
40
- existsSync,
41
- mkdirSync,
42
- readdirSync,
43
- rmSync,
44
- statSync,
45
- writeFileSync,
46
- } from 'node:fs';
37
+ import { copyFileSync, cpSync, existsSync, mkdirSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';
47
38
  import { basename, dirname, join } from 'node:path';
48
39
  import { fileURLToPath } from 'node:url';
49
40
 
@@ -64,7 +55,9 @@ if (process.platform !== 'win32' || process.arch !== 'x64') {
64
55
  process.exit(2);
65
56
  }
66
57
  if (!PREFIX) {
67
- console.error('build-gtk-runtime: no GTK prefix — pass --prefix or set GTK_PREFIX (e.g. C:\\gtk-build\\gtk\\x64\\release)');
58
+ console.error(
59
+ 'build-gtk-runtime: no GTK prefix — pass --prefix or set GTK_PREFIX (e.g. C:\\gtk-build\\gtk\\x64\\release)',
60
+ );
68
61
  process.exit(1);
69
62
  }
70
63
 
@@ -126,7 +119,10 @@ function findTool(leaf, envVar) {
126
119
  const inBin = join(gtkBin, leaf);
127
120
  if (existsSync(inBin)) return inBin;
128
121
  try {
129
- const p = sh('where', [leaf.replace(/\.exe$/i, '')]).split(/\r?\n/).map((s) => s.trim()).filter(Boolean)[0];
122
+ const p = sh('where', [leaf.replace(/\.exe$/i, '')])
123
+ .split(/\r?\n/)
124
+ .map((s) => s.trim())
125
+ .filter(Boolean)[0];
130
126
  if (p && existsSync(p)) return p;
131
127
  } catch {
132
128
  // not on PATH
@@ -141,7 +137,10 @@ function findDumpbin() {
141
137
  const envd = process.env.DUMPBIN;
142
138
  if (envd && existsSync(envd)) return envd;
143
139
  try {
144
- const p = sh('where', ['dumpbin']).split(/\r?\n/).map((s) => s.trim()).filter(Boolean)[0];
140
+ const p = sh('where', ['dumpbin'])
141
+ .split(/\r?\n/)
142
+ .map((s) => s.trim())
143
+ .filter(Boolean)[0];
145
144
  if (p && existsSync(p)) return p;
146
145
  } catch {
147
146
  // not on PATH
@@ -155,7 +154,10 @@ function findDumpbin() {
155
154
  if (existsSync(vswhere)) {
156
155
  try {
157
156
  const out = sh(vswhere, ['-latest', '-products', '*', '-find', '**\\Hostx64\\x64\\dumpbin.exe']);
158
- const p = out.split(/\r?\n/).map((s) => s.trim()).filter(Boolean)[0];
157
+ const p = out
158
+ .split(/\r?\n/)
159
+ .map((s) => s.trim())
160
+ .filter(Boolean)[0];
159
161
  if (p && existsSync(p)) return p;
160
162
  } catch {
161
163
  // vswhere present but no match
@@ -220,7 +222,9 @@ if (WINDOWING && existsSync(gdkPixbufLoaderDir)) {
220
222
  if (f.toLowerCase().endsWith('.dll')) loaderSeeds.push(join(gdkPixbufLoaderDir, f));
221
223
  }
222
224
  }
223
- console.log(`build-gtk-runtime: ${seeds.length} seed DLLs${loaderSeeds.length ? ` + ${loaderSeeds.length} pixbuf loaders` : ''}`);
225
+ console.log(
226
+ `build-gtk-runtime: ${seeds.length} seed DLLs${loaderSeeds.length ? ` + ${loaderSeeds.length} pixbuf loaders` : ''}`,
227
+ );
224
228
 
225
229
  const dumpbin = findDumpbin();
226
230
  // leaf(lower) -> actual filename (source in <prefix>/bin); '\0loader:'-prefixed keys
@@ -328,7 +332,9 @@ if (WINDOWING) {
328
332
  writeFileSync(cacheOut, rel);
329
333
  console.log(`build-gtk-runtime: wrote loaders.cache (${windowing.pixbufLoaders} loaders, bundle-relative)`);
330
334
  } else {
331
- console.warn('build-gtk-runtime: WARNING — gdk-pixbuf-query-loaders not found; loaders.cache NOT generated (SVG/PNG icons may not load)');
335
+ console.warn(
336
+ 'build-gtk-runtime: WARNING — gdk-pixbuf-query-loaders not found; loaders.cache NOT generated (SVG/PNG icons may not load)',
337
+ );
332
338
  }
333
339
  } else {
334
340
  console.warn(`build-gtk-runtime: WARNING — ${gdkPixbufLoaderDir} missing; no gdk-pixbuf loaders bundled`);
@@ -355,15 +361,20 @@ if (WINDOWING) {
355
361
  }
356
362
  }
357
363
  windowing.schemas = existsSync(join(schemasOut, 'gschemas.compiled'));
358
- console.log(`build-gtk-runtime: GSettings schemas ${windowing.schemas ? 'compiled' : 'copied (no gschemas.compiled!)'}`);
364
+ console.log(
365
+ `build-gtk-runtime: GSettings schemas ${windowing.schemas ? 'compiled' : 'copied (no gschemas.compiled!)'}`,
366
+ );
359
367
  } else {
360
- console.warn(`build-gtk-runtime: WARNING — ${schemasSrc} missing; GSettings schemas NOT bundled (GTK settings reads will fail)`);
368
+ console.warn(
369
+ `build-gtk-runtime: WARNING — ${schemasSrc} missing; GSettings schemas NOT bundled (GTK settings reads will fail)`,
370
+ );
361
371
  }
362
372
 
363
373
  // 4c. Icon themes (Adwaita for symbolic icons + hicolor fallback) + caches. The
364
374
  // theme is loaded from XDG_DATA_DIRS/icons/<theme>/ (node-gi prepends <bundle>/share).
365
- const updateIconCache = findTool('gtk4-update-icon-cache.exe', 'GTK4_UPDATE_ICON_CACHE')
366
- ?? findTool('gtk-update-icon-cache.exe', 'GTK_UPDATE_ICON_CACHE');
375
+ const updateIconCache =
376
+ findTool('gtk4-update-icon-cache.exe', 'GTK4_UPDATE_ICON_CACHE') ??
377
+ findTool('gtk-update-icon-cache.exe', 'GTK_UPDATE_ICON_CACHE');
367
378
  for (const theme of ['Adwaita', 'hicolor']) {
368
379
  const themeSrc = join(PREFIX, 'share', 'icons', theme);
369
380
  if (!existsSync(themeSrc)) continue;
@@ -425,9 +436,13 @@ if (WINDOWING) {
425
436
  }
426
437
  }
427
438
  windowing.gtksource = copied > 0;
428
- console.log(`build-gtk-runtime: GtkSource-5 data ${windowing.gtksource ? `bundled (${copied} language-specs/styles files)` : 'directory present but empty'}`);
439
+ console.log(
440
+ `build-gtk-runtime: GtkSource-5 data ${windowing.gtksource ? `bundled (${copied} language-specs/styles files)` : 'directory present but empty'}`,
441
+ );
429
442
  } else {
430
- console.warn(`build-gtk-runtime: WARNING — ${gtksourceSrc} missing; GtkSource-5 language-specs/styles NOT bundled (the editor's built-in highlighting will be unavailable)`);
443
+ console.warn(
444
+ `build-gtk-runtime: WARNING — ${gtksourceSrc} missing; GtkSource-5 language-specs/styles NOT bundled (the editor's built-in highlighting will be unavailable)`,
445
+ );
431
446
  }
432
447
  }
433
448