Commitaaf8b1cdRecorded24 Apr 2026Repositorysigil-app
v0.8.4: procedural link-flags for cross-compile correctness
Message
Migrates link-flags: from (case (host-os) ...) to (lambda (ctx) (case (target-os ctx) ...)) so cross-compile builds (Linux → Windows via zig) pick the right branch at link time.
Before: (case (host-os) ...) evaluated once at package-load on the host, so a Linux host cross-compiling for Windows injected -lX11 -lXi -lXcursor into the final link and failed against zig's MinGW sysroot.
OS branches are unchanged: linux → -lX11 -lXi -lXcursor darwin → -framework Cocoa -framework QuartzCore windows → -lkernel32 -luser32 -lshell32 -lgdi32
Requires sigil-build 0.14.0+ (for target-os helper and procedural link-flags: dispatch in collect-native-link-flags).
Changed
CHANGELOG.md | 20 ++++++++++++++++++++
package.sgl | 20 +++++++++++++-------
2 files changed, 33 insertions(+), 7 deletions(-)Diff
CHANGELOG.mdmodified
@@ -7,6 +7,26 @@ All notable changes to this project will be documented in this file.
7
The format is based on [Keep a Changelog](https://keepachangelog.com/), 8
and this project adheres to [Semantic Versioning](https://semver.org/). 9
+10
## [0.8.4] - 2026-04-24+11
+12
### Fixed+13
+14
- `link-flags:` now uses `(lambda (ctx) (case (target-os ctx) ...))`+15
instead of a host-based `(case (host-os) ...)` expression. The+16
host-based form evaluated at package-load time on the host, so+17
Linux link flags (`-lX11 -lXi -lXcursor`) leaked into Windows+18
cross-compile builds; `sigil build --config windows-amd64` from a+19
Linux host would fail at the final link against zig's MinGW+20
sysroot. The procedural form re-evaluates at link time with the+21
target triple. Branches themselves are unchanged (`linux`:+22
`-lX11 -lXi -lXcursor`; `darwin`: `-framework Cocoa -framework+23
QuartzCore`; `windows`: `-lkernel32 -luser32 -lshell32 -lgdi32`).+24
+25
### Requires+26
+27
- `sigil-build` 0.14.0+ (for the `target-os` / `target-arch` helpers+28
and the procedural-link-flags dispatch in `collect-native-link-flags`).+29
30
## [0.7.0] - 2026-03-01 31
32
### Addedpackage.sglmodified
@@ -5,7 +5,7 @@
5
6
(package 7
name: "sigil-app"−8
version: "0.8.3"+8
version: "0.8.4" 9
description: "Application framework for Sigil (windowing, input, lifecycle)" 10
url: "https://codeberg.org/sigil/sigil-app" 11
license: "BSD-3-Clause"@@ -45,12 +45,18 @@
45
c-sources: '("src/c/sokol-app.c" "src/c/app.c") 46
c-include-dirs: '("vendor/sokol" "src/c") 47
native-init: "sigil__init_sigil_app_module"−48
;; Platform-specific linker flags for sokol_app−49
link-flags: (case (host-os)−50
((linux) '("-lX11" "-lXi" "-lXcursor"))−51
((darwin) '("-framework" "Cocoa" "-framework" "QuartzCore"))−52
((windows) '("-lkernel32" "-luser32" "-lshell32" "-lgdi32"))−53
(else '()))))+48
;; Platform-specific linker flags for sokol_app.+49
;;+50
;; Procedural (lambda ctx) form so cross-compile configs evaluate+51
;; the right branch at link time. (case (host-os) ...) was evaluated+52
;; once at package-load on the host, leaking Linux flags into+53
;; cross builds.+54
link-flags: (lambda (ctx)+55
(case (target-os ctx)+56
((linux) '("-lX11" "-lXi" "-lXcursor"))+57
((darwin) '("-framework" "Cocoa" "-framework" "QuartzCore"))+58
((windows) '("-lkernel32" "-luser32" "-lshell32" "-lgdi32"))+59
(else '()))))) 60
61
tasks: (list 62
(task