[Midnightbsd-cvs] [MidnightBSD/mports] 9c80d1: devel/electron40: make the port buildable on Midni...
Lucas Holt
noreply at github.com
Tue Aug 4 23:17:56 EDT 2026
Branch: refs/heads/master
Home: https://github.com/MidnightBSD/mports
Commit: 9c80d16dd969ab229dfafd2b13d943456b243d0e
https://github.com/MidnightBSD/mports/commit/9c80d16dd969ab229dfafd2b13d943456b243d0e
Author: Lucas Holt <luke at foolishgames.com>
Date: 2026-08-04 (Tue, 04 Aug 2026)
Changed paths:
M devel/electron40/Makefile
M devel/electron40/files/patch-build_config_linux_pkg-config.py
A devel/electron40/files/patch-build_landmine__utils.py
M devel/electron40/files/patch-media_ffmpeg_scripts_robo__lib_config.py
M devel/electron40/files/patch-third__party_blink_renderer_bindings_scripts_bind__gen_style__format.py
M devel/electron40/files/patch-third__party_node_node.py
M devel/electron40/files/patch-tools_gn_build_gen.py
Log Message:
-----------
devel/electron40: make the port buildable on MidnightBSD (#684)
`devel/electron40` has never been build-ported: it carried **no
`midnightbsd` patches at all**. #671 fixed its fetch, which only got it
as far as *starting* a build — configure then failed immediately on the
first Python platform check.
This applies the same set of changes that make #672/#682's
`devel/electron41` build.
## MidnightBSD portability (6 patches)
Only Python is affected. C and C++ are carried by the base compiler
defining `__FreeBSD__` alongside `__MidnightBSD__`, and GN reports
`host_os=freebsd` via `OS_FREEBSD`.
| File | Failure |
|---|---|
| `build/config/linux/pkg-config.py` | early-returned on any platform
not matching linux/openbsd/freebsd, so **every** `pkg_config` lookup
silently produced empty results |
| `tools/gn/build/gen.py` | `KeyError: 'midnightbsd4'` during GN
bootstrap |
| `media/ffmpeg/scripts/robo_lib/config.py` | `ValueError: Unsupported
platform: MidnightBSD` |
| `third_party/node/node.py` | `KeyError` on the node binary path lookup
|
| `bind_gen/style_format.py` | `AssertionError: Unknown platform:
midnightbsd4` |
| `build/landmine_utils.py` | `IsLinux()` returned False (new patch) |
All six were dry-run against the Chromium 144 sources before use — the
relevant lines are unchanged between 144 and 146, so they transfer
directly from electron41.
## Port defects (3, shared with electron41)
**Base clang instead of `devel/llvm21`.** GN's `clang_toolchain`
template hardcodes `cc`/`c++` from PATH and ignores `clang_base_path`,
so `BINARY_ALIAS` is the only way to select a compiler — setting
`CC`/`CXX` alone only affects the GN bootstrap. The port declared
`LLVM_DEFAULT=21` and build-depended on `devel/llvm21` while not
actually using it.
The `cc`/`c++` aliases were presumably dropped because Chromium builds
with `-no-canonical-prefixes`, making clang derive its resource
directory from `argv[0]` and resolve it through the alias symlink to a
nonexistent path. Fix: restore the aliases and pass `-resource-dir`
explicitly.
**Allocator GN args.** `use_allocator_shim=false`,
`use_partition_alloc=true`, `use_partition_alloc_as_malloc=false` and
`enable_backup_ref_ptr_support=false` had been removed. Without them the
allocator shim is compiled, and it does not build here:
`/usr/include/stdlib.h` declares `malloc`/`free`/`realloc` without
`__THROW`.
**Staging.** `do-install` used FreeBSD's `${STAGEDIR}${PREFIX}`; in
mports `${PREFIX}` already has `FAKE_DESTDIR` prepended during
`do-install`, so every path was staged twice over.
`PORTREVISION` 3 → 4.
## Validation
Configures from a clean tree — **28489 targets from 4367 files** —
verified using **clang 21.1.8** with the allocator arguments and
`-resource-dir` confirmed present in `args.gn`.
**Not verified:** the full build. `devel/electron41` builds and packages
with the identical set of changes, but electron40 was not compiled end
to end. Given electron40 is EOL upstream, that seemed a poor use of ~5
hours of machine time — happy to run it if you'd rather have the
confirmation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary by Sourcery
Make electron40 buildable with the same MidnightBSD support and
toolchain configuration as electron41, and correct staging behaviour in
mports.
Bug Fixes:
- Ensure GN and related Python helpers treat MidnightBSD as FreeBSD so
configuration and landmine checks succeed.
- Fix node binary path resolution on MidnightBSD by mapping it to the
FreeBSD node bundle.
- Allow pkg-config, FFmpeg config scripts, and Blink bind_gen to run
correctly on MidnightBSD instead of failing or returning empty results.
- Correct allocator-related GN arguments to avoid building the
unsupported allocator shim on this platform.
- Fix do-install and post-install staging paths to avoid
double-prefixing under mports.
Enhancements:
- Reinstate LLVM clang via BINARY_ALIAS and pass an explicit clang
resource directory so Chromium builds use the intended compiler without
missing intrinsics headers.
Chores:
- Bump PORTREVISION from 3 to 4 to reflect the MidnightBSD and port
build fixes.
Signed-off-by: Lucas Holt <luke at foolishgames.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