Commit 8ada077
libghostty-vt: fix pkg-config libdir/includedir under split install
`pkgConfigFiles` in GhosttyLibVt.zig was emitting
`libdir=${prefix}/lib` and `includedir=${prefix}/include`, interpolating
a single install prefix for both the header and library locations. When
a packager installs libghostty-vt with the header tree rooted in one
place and the shared library in another (e.g. Nix multi-output
derivations splitting `$out` for runtime and `$dev` for development
artifacts), the interpolated libdir points at the wrong directory and
pkg-config-built consumers fail at runtime with
libghostty-vt.so.<N>: cannot open shared object file
because the SONAME-versioned library does not actually live next to
`prefix`.
Resolve `libdir` and `includedir` to absolute paths via
`b.getInstallPath(.lib, "")` and `b.getInstallPath(.header, "")`, which
honor `--prefix-lib-dir` and `--prefix-include-dir` from zig's install
options. Single-prefix installs produce the same output as before;
split-prefix installs now embed the real, resolved locations into
libghostty-vt.pc without any downstream fixup.
The Nix package takes advantage of this by installing headers directly
into the `dev` output with `--prefix-include-dir`, which lets us drop
the entire postInstall dance (`mv $out/include $dev`, `rm $out/lib/libghostty-vt.so`
plus the `ln -sf` into `$dev/lib`, and the equivalent darwin unversioned
dylib relocation) and the postFixup that used to rewrite the .pc files.
libghostty-vt.a now stays alongside the shared library in `$out/lib`
so the shared and static .pc files share a single correct libdir,
eliminating the need for per-variant postFixup rewriting.
Removes the `-Wl,-rpath,"${finalAttrs.finalPackage}/lib"` workaround
from the `build-with-shared` and `build-example-c-vt-build-info`
passthru tests; they now prove that pkg-config alone is sufficient to
produce a binary whose dynamic loader can find libghostty-vt.so.<N>
at runtime.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 691b7ac commit 8ada077
2 files changed
Lines changed: 42 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| |||
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 88 | | |
122 | 89 | | |
123 | 90 | | |
124 | 91 | | |
125 | 92 | | |
126 | 93 | | |
127 | 94 | | |
128 | | - | |
| 95 | + | |
129 | 96 | | |
130 | 97 | | |
131 | 98 | | |
132 | 99 | | |
133 | | - | |
134 | | - | |
| 100 | + | |
| 101 | + | |
135 | 102 | | |
136 | 103 | | |
137 | 104 | | |
| |||
148 | 115 | | |
149 | 116 | | |
150 | 117 | | |
151 | | - | |
| 118 | + | |
152 | 119 | | |
153 | 120 | | |
154 | 121 | | |
| |||
162 | 129 | | |
163 | 130 | | |
164 | 131 | | |
165 | | - | |
166 | | - | |
| 132 | + | |
167 | 133 | | |
168 | 134 | | |
169 | 135 | | |
| |||
241 | 207 | | |
242 | 208 | | |
243 | 209 | | |
244 | | - | |
245 | | - | |
| 210 | + | |
246 | 211 | | |
247 | 212 | | |
248 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
374 | 388 | | |
375 | 389 | | |
376 | 390 | | |
377 | | - | |
378 | | - | |
| 391 | + | |
| 392 | + | |
379 | 393 | | |
380 | 394 | | |
381 | 395 | | |
| |||
385 | 399 | | |
386 | 400 | | |
387 | 401 | | |
388 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
389 | 410 | | |
390 | 411 | | |
391 | | - | |
392 | | - | |
| 412 | + | |
| 413 | + | |
393 | 414 | | |
394 | 415 | | |
395 | 416 | | |
| |||
401 | 422 | | |
402 | 423 | | |
403 | 424 | | |
| 425 | + | |
| 426 | + | |
404 | 427 | | |
405 | 428 | | |
406 | 429 | | |
| |||
0 commit comments