@gjsify/gtk-runtime-darwin-arm64 0.20.0 → 0.21.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/gtk-runtime-darwin-arm64",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Batteries-included, relocated GTK/GObject-Introspection runtime bundle for macOS arm64 — lets @gjsify/node-gi load gi:// namespaces (GLib/GObject/Gio/cairo/Pango/Graphene/Gdk) with NO Homebrew GTK. Platform-gated (darwin/arm64 only).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -74,6 +74,23 @@ const SEED_PATTERNS = [
74
74
  /^libgtk-4\..*\.dylib$/, // provides the Gdk typelib's backing library
75
75
  ];
76
76
 
77
+ // WINDOWING superset (opt-in via --windowing): also bundle libadwaita, whose dylib
78
+ // backs the Adw-1 typelib, AND libgtksourceview-5, whose dylib backs the GtkSource-5
79
+ // typelib. The display-free conformance closure never touches Adwaita OR GtkSource,
80
+ // so they are NOT base seeds — but the batteries-included bundle ships their TYPELIBS,
81
+ // so without the dylibs a real `new Adw.Application()` / `new GtkSource.View()` fails
82
+ // with "Failed to load shared library '…'" (→ the type is not a constructible
83
+ // GObject). libgtksourceview backs the Learn6502 editor (a GtkSource.View subclass) —
84
+ // the app-gnome node-gi port. This is exactly what the macOS GTK-GUI proof
85
+ // (macos-gtk-windowing) needs; the recursive otool walk pulls each seed's transitive
86
+ // deps + relocates them like any other seed. Mirrors the win32 --windowing superset
87
+ // (WINDOWING_SEED_PATTERNS there). NB: GtkSource's runtime DATA (language-specs /
88
+ // styles under share/gtksourceview-5) is a separate concern; the darwin bundle has no
89
+ // share/ DATA step yet, so GtkSource CONSTRUCTS here but syntax-highlighting language
90
+ // files are not bundled (tracked follow-up; the win32 bundle DOES ship them).
91
+ const WINDOWING = process.argv.includes('--windowing');
92
+ const WINDOWING_SEED_PATTERNS = [/^libadwaita-1\..*\.dylib$/, /^libgtksourceview-5\..*\.dylib$/];
93
+
77
94
  function isSystemPath(p) {
78
95
  return p.startsWith('/usr/lib/') || p.startsWith('/System/');
79
96
  }
@@ -112,8 +129,9 @@ function resolveInBrew(leaf) {
112
129
  }
113
130
 
114
131
  // --- 1. discover the closure ----------------------------------------------
115
- console.log(`build-gtk-runtime: brew prefix ${brewPrefix}`);
116
- const seeds = readdirSync(brewLib).filter((f) => SEED_PATTERNS.some((re) => re.test(f)));
132
+ console.log(`build-gtk-runtime: brew prefix ${brewPrefix}${WINDOWING ? ' (windowing superset — + libadwaita + libgtksourceview)' : ' (display-free)'}`);
133
+ const seedPatterns = WINDOWING ? [...SEED_PATTERNS, ...WINDOWING_SEED_PATTERNS] : SEED_PATTERNS;
134
+ const seeds = readdirSync(brewLib).filter((f) => seedPatterns.some((re) => re.test(f)));
117
135
  if (seeds.length === 0) {
118
136
  console.error('build-gtk-runtime: no seed libraries found — is the GTK stack installed?');
119
137
  process.exit(1);