all: add OpenBSD (X11) support#36
Merged
Merged
Conversation
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).
c576363 to
a08f40f
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 tohotkey_x11.*because the_linuxfilename suffix carries an implicit linux-only build constraint that a//go:buildline cannot widen; constraints then widen tolinux || openbsd, andmainthread/os.gois widened somainthread.Init/Callexist 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.