Skip to content

Conversation

@sgharms
Copy link

@sgharms sgharms commented Jan 8, 2026

@trunkmaster

Per our other conversations, here's the first script running in a way that's consistent with FreeBSD design and practice. Let's iron out any design conflicts on one script and then use those conventions to carry through the rest of the installer.

sgharms added 14 commits January 7, 2026 21:36
Replace hardcoded sudo references with PRIV_CMD variable in:
- INSTALL_CMD: handles FreeBSD (no -E flag) vs Linux (with -E flag)
- RM_CMD, LN_CMD, MV_CMD, CP_CMD, MKDIR_CMD: use PRIV_CMD prefix

This allows these commands to adapt to the detected privilege
escalation method (root, doas, or sudo).
Add print_WARN() helper function for displaying warning messages
with yellow/red formatting, consistent with other print helpers.
…handling

Refactor prepare_freebsd_environment() to intelligently handle privilege
escalation:
- Detect if running as root and skip privilege escalation
- Try doas first (with config validation) if not root
- Fall back to sudo if doas unavailable or unconfigured
- Provide clear error if neither is available

This replaces the previous approach that only checked for sudo and
failed if it wasn't installed.
Add *.sw? pattern to ignore vim swap files (.swp, .swo, etc).
Introduce PRIV_CMD variable that detects the appropriate privilege
escalation command based on the environment:
- Running as root: no escalation needed (empty string)
- FreeBSD: prefer doas (if configured), fall back to sudo
- Linux: use sudo

This provides a single point of configuration for all privilege
escalation needs across the build scripts.
Add cmake to CORE_SYSTEM_DEPS for FreeBSD 15. This package is
required for building CoreFoundation and should be installed
alongside the other build dependencies.
Replace hardcoded sudo calls with PRIV_CMD variable:
- pkg install command for FreeBSD dependencies
- ldconfig command after installation

This allows the script to work when running as root or with doas.
On FreeBSD, create a dedicated ldconfig drop-in file at
/usr/local/libdata/ldconfig/nextspace containing the NextSpace
library path, then run 'ldconfig -R' to rebuild hints from all
configured paths.

This follows FreeBSD conventions for package-specific library paths
and ensures the libraries are properly registered in the system.
Introduce NEXTSPACE_ROOT variable to define the installation root:
- FreeBSD: /usr/local/NextSpace (third-party software convention)
- Linux: /usr/NextSpace (existing convention)

This allows the NextSpace project to follow FreeBSD filesystem
hierarchy standards while maintaining compatibility with existing
Linux installations.
Replace hardcoded /usr/NextSpace paths with NEXTSPACE_ROOT variable
throughout the CoreFoundation build script:
- CMake configuration flags (install prefix, library paths, include paths)
- CFNetwork configuration (Linux only)
- Install directory paths
- ldconfig configuration path

This allows the script to adapt to the correct installation location
for each OS (FreeBSD: /usr/local/NextSpace, Linux: /usr/NextSpace).
Move PRIV_CMD definition earlier and remove duplicated privilege
escalation logic from prepare_freebsd_environment().
Reduce three-way branch to two-way: sudo needs -E flag, everything
else (doas or root) doesn't.
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