[Midnightbsd-cvs] [MidnightBSD/mports] b37c4c: games/devilutionX: fix build on MidnightBSD (isasc...

Lucas Holt noreply at github.com
Mon Sep 7 16:33:52 EDT 2026


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/mports
  Commit: b37c4caa6230a7b108a855f6e4eb57e525137313
      https://github.com/MidnightBSD/mports/commit/b37c4caa6230a7b108a855f6e4eb57e525137313
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-09-07 (Mon, 07 Sep 2026)

  Changed paths:
    M games/devilutionX/Makefile
    A games/devilutionX/files/patch-CMake_Platforms.cmake
    A games/devilutionX/files/patch-CMake_functions_devilutionx__library.cmake

  Log Message:
  -----------
  games/devilutionX: fix build on MidnightBSD (isascii undeclared) (#865)

Fixes #858.

## Root cause

Not a base-system header bug. Upstream's
`CMake/functions/devilutionx_library.cmake` adds
`-D_POSIX_C_SOURCE=200809L` on every non-Windows, non-Apple system
except FreeBSD. MidnightBSD reports its own `CMAKE_SYSTEM_NAME`, so the
define was applied. On BSD libc, defining `_POSIX_C_SOURCE` selects a
strict POSIX namespace in `sys/cdefs.h` and sets `__XSI_VISIBLE` to 0,
which hides `isascii()` from `<ctype.h>`. libc++'s `<__locale>` then
fails on any TU that reaches it via `<vector>` under `-std=c++20`.

## Fix

- `patch-CMake_functions_devilutionx__library.cmake`: skip the
`_POSIX_C_SOURCE` define on MidnightBSD as well as FreeBSD.
- `patch-CMake_Platforms.cmake`: include MidnightBSD in the BSD platform
branch so `_BSD_SOURCE` and the `stat64`/`off64_t` shims are set (the
`file_util.cpp` POSIX code paths key off `_BSD_SOURCE`).
- Add `*.cmake` to `DOS2UNIX_GLOB` so the new patches are free of CRLF.
- Bump `PORTREVISION` to 2.

## Validation

On MidnightBSD 4.0.6 amd64 from a clean work dir: `bmake patch`,
`bmake`, `bmake fake`, `bmake package` all succeed.
`compile_commands.json` no longer contains `_POSIX_C_SOURCE`. `portlint`
reports 0 fatal errors; the two remaining warnings (NLS knob, `file` in
the ZEROTIER_BROKEN message) are pre-existing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QppyajU21HE92jbfdUgLSv

## Summary by Sourcery

Restore DevilutionX compatibility with MidnightBSD builds.

Bug Fixes:
- Fix the DevilutionX build on MidnightBSD by preventing incompatible
POSIX namespace restrictions and enabling the required BSD compatibility
paths.

Build:
- Normalize CMake patch files during the port build and bump the port
revision.

Signed-off-by: Lucas Holt <luke at foolishgames.com>
Co-authored-by: Claude Fable 5.1 <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/mports/settings/notifications



More information about the Midnightbsd-cvs mailing list