Skip to content

all: add OpenBSD (X11) support#36

Merged
changkun merged 2 commits into
mainfrom
feat/openbsd-x11
Jun 6, 2026
Merged

all: add OpenBSD (X11) support#36
changkun merged 2 commits into
mainfrom
feat/openbsd-x11

Conversation

@changkun

@changkun changkun commented Jun 6, 2026

Copy link
Copy Markdown
Member

OpenBSD exposes the same Xlib API as Linux, so the X11 backend works there with the right cgo include/lib paths (/usr/X11R6).

hotkey_linux.{go,c,_test.go} are renamed to hotkey_x11.* because the _linux filename suffix carries an implicit linux-only build constraint that a //go:build line cannot widen; constraints then widen to linux || openbsd, and mainthread/os.go is widened so mainthread.Init/Call exist on OpenBSD.

Adapted from #32 by @sdassow (overlaps that PR intentionally; attribution to be settled at merge). One fix, one PR (split out of #34).

Note: the X11 cgo path is validated locally via build-tag wiring + cross-compile; a real OpenBSD runtime CI job (vmactions) is a sensible follow-up once this lands.

OpenBSD ships the same X11/Xlib API as Linux, so the existing X11
backend works there with the right cgo include/lib paths
(/usr/X11R6). Rename hotkey_linux.* to hotkey_x11.* because the
_linux filename suffix carries an implicit linux-only build
constraint that a //go:build line cannot widen, then extend the
constraints to "linux || openbsd". Also widen mainthread/os.go so
mainthread.Init/Call are available on OpenBSD.

Adapted from #32 by Simon Dassow (@sdassow).
@changkun changkun force-pushed the feat/openbsd-x11 branch from c576363 to a08f40f Compare June 6, 2026 12:19
The CGO_ENABLED=0 cross-build only compiles the nocgo stub for
openbsd. Add a vmactions OpenBSD VM that builds and vets with cgo
enabled, validating the X11 backend's openbsd cgo flags (/usr/X11R6)
and link against libX11.
@changkun changkun merged commit 25a95c8 into main Jun 6, 2026
19 checks passed
@changkun changkun deleted the feat/openbsd-x11 branch June 6, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant