Skip to content

Fixes for OpenBSD port - #1825

Merged
TheJJ merged 3 commits into
SFTtech:masterfrom
ligurio:ligurio/gh-xxxx-openbsd-port
Oct 15, 2026
Merged

TheJJ merged 3 commits into
SFTtech:masterfrom
ligurio:ligurio/gh-xxxx-openbsd-port

Conversation

@ligurio

@ligurio ligurio commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

openage with its dependencies (nyan and toml11) was ported to OpenBSD 1

Footnotes

  1. https://github.com/ligurio/openbsd-wip/pull/5 ↩

@TheJJ TheJJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fixes! i'll wait to merge if you want to fixup the commit adding you to mailmap, which is unneeded.

Comment thread .mailmap Resolved
TheJJ

This comment was marked as duplicate.

On OpenBSD include <util.h> (for forkpty()/openpty(), provided by
the already-linked libutil), <termios.h>, <sys/types.h> and
<sys/ioctl.h> instead of the missing <pty.h>.

Implement self_exec_filename() on OpenBSD via
sysctl(KERN_PROC_ARGS) argv[0]. OpenBSD has neither
/proc/self/exe nor KERN_PROC_PATHNAME, so the previous code hit a
static_assert; include <sys/sysctl.h> for it.

Define `typedef sig_t` as `sighandler_t` on OpenBSD, which has no
sighandler_t.
Do not link libopenage with '-Wl,--no-undefined' on OpenBSD.
Shared libraries on OpenBSD are not linked against libc, so the
strict undefined-symbol check fails on libc symbols; the flag
setup is reworked so the Apple and other-ELF cases are unchanged.
@ligurio
ligurio force-pushed the ligurio/gh-xxxx-openbsd-port branch from dd35673 to 6bad51e Compare October 15, 2026 06:19
@TheJJ
TheJJ merged commit 8c7d630 into SFTtech:master Oct 15, 2026
14 checks passed
ligurio added a commit to ligurio/openbsd-wip that referenced this pull request Oct 23, 2026
Upstream has no release newer than 0.6.0, but the OpenBSD fixes
were merged to master (PR #1825, merge 8c7d6306), so track that
snapshot. Current master requires C++26 modules and clang >= 21,
which OpenBSD 7.9 does not ship, so stay at the last C++20 commit.

All porting patches are in upstream now and were removed:

- 'codegen' -> 'cppgen' target rename;
- no '-Wl,--no-undefined' for shared libraries on OpenBSD;
- define sig_t as sighandler_t on OpenBSD;
- <util.h>/<termios.h> includes in util/pty.h;
- self_exec_filename() via sysctl(KERN_PROC_ARGS);
- pathfinder no longer initialises entry_sector with NULL.

Upstream still calls find_library(RT_LIB rt) unconditionally on
non-Apple/non-Windows systems, and OpenBSD has no librt; pass
-DRT_LIB= so that CMake does not leave RT_LIB set to
RT_LIB-NOTFOUND.

Dependencies follow upstream 8c7d6306: Python >= 3.12 and Cython
>= 3.1, tomli_w replaces toml, jinja2 is no longer used, and
lz4/mako are now runtime dependencies.  The packing list picks up
the renamed openage/util/toml.py and the new demo_7 shaders.

CI installs py3-tomli_w instead of py3-toml and py3-jinja2.

Follows up SFTtech/openage#1825
ligurio added a commit to ligurio/openbsd-wip that referenced this pull request Oct 23, 2026
Upstream has no release newer than 0.6.0, but the OpenBSD fixes
were merged to master (PR #1825, merge 8c7d6306), so track that
snapshot. Current master requires C++26 modules and clang >= 21,
which OpenBSD 7.9 does not ship, so stay at the last C++20 commit.

All porting patches are in upstream now and were removed:

- 'codegen' -> 'cppgen' target rename;
- no '-Wl,--no-undefined' for shared libraries on OpenBSD;
- define sig_t as sighandler_t on OpenBSD;
- <util.h>/<termios.h> includes in util/pty.h;
- self_exec_filename() via sysctl(KERN_PROC_ARGS);
- pathfinder no longer initialises entry_sector with NULL.

Upstream still calls find_library(RT_LIB rt) unconditionally on
non-Apple/non-Windows systems, and OpenBSD has no librt; pass
-DRT_LIB= so that CMake does not leave RT_LIB set to
RT_LIB-NOTFOUND.

Dependencies follow upstream 8c7d6306: Python >= 3.12 and Cython
>= 3.1, tomli_w replaces toml, jinja2 is no longer used, and
lz4/mako are now runtime dependencies.  The packing list picks up
the renamed openage/util/toml.py and the new demo_7 shaders.

CI installs py3-tomli_w instead of py3-toml and py3-jinja2.

Follows up SFTtech/openage#1825
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.

2 participants