Skip to content

Fix Sndio backend & cleanup compilation on OpenBSD#8407

Merged
rubiefawn merged 4 commits into
LMMS:masterfrom
rubiefawn:fix/openbsd
Jul 2, 2026
Merged

Fix Sndio backend & cleanup compilation on OpenBSD#8407
rubiefawn merged 4 commits into
LMMS:masterfrom
rubiefawn:fix/openbsd

Conversation

@rubiefawn

@rubiefawn rubiefawn commented May 25, 2026

Copy link
Copy Markdown
Contributor

Compiling on OpenBSD requires a bunch of extra command-line configuration and troubleshooting, none of which was documented when I first tried to do so. This is an attempt to remedy that and bring the compilation experience in line with Linux: cmake -B build && cmake --build build -j4 should just work, provided dependencies are installed and whatnot.

  • Sets Qt[5-6]_DIR and Qt[5-6]Test_DIR automatically, similar to how this is handled for macOS
  • Add LOCALBASE and X11BASE to include and link paths
  • Explicitly disable several features by default, as is done in the OpenBSD ports tree
  • Fixes sndio backend regression introduced in Remove the FIFO thread #7568 (resolves sndio backend is broken #8406)

Regarding disabled features in the OpenBSD port

Latest revision, rev 1.29

  • -DWANT_OSS=OFF since rev 1.1, -DLMMS_HAVE_OSS=FALSE since rev 1.15: Rationale is given in the patch notes, "don't link deprecated ossaudio on OpenBSD". Disabling this is desirable.
  • -DWANT_SDL=OFF since rev 1.1: No rationale is given in the patch notes for why this is excluded. LMMS finds SDL and compiles fine with it enabled, but it doesn't appear as an option when choosing an audio backend in settings. Disabling this is probably desirable, but it may just be hiding a fixable issue. Further testing is required.
  • -DWANT_PULSEAUDIO=OFF since rev 1.5: Rationale is given in the patch notes, "explicitly disable pulseaudio in these ports so they won't pick it up when it becomes available." PulseAudio also throws compile errors so disabling this is desirable.
  • -DWANT_VST=OFF: OpenBSD does not (and likely will never) have WINE, Windows VSTs are justifiably disabled. (TODO: What about Linux VSTs?)
  • -DWANT_CARLA=OFF, -DWANT_GIG=OFF, -DWANT_STK=OFF: OpenBSD does not have carla, libgig, or libstk. Disabling these is desirable, but I'll leave that to the ports maintainers since they're more likely to know if any of these packages become available than we are.
  • -DWANT_CALF=OFF, -DWANT_CAPS=OFF, -DWANT_CMT=OFF, -DWANT_SWH=OFF, -DWANT_TAP=OFF: OpenBSD has ports for these (audio/calf audio/caps-plugins audio/cmt audio/swh-plugins audio/tap-plugins), and they work fine in LMMS when enabled. I'm not sure why these are disabled in the OpenBSD port; I won't be disabling them here and the port maintainers can decide if they want to continue disabling these.

@rubiefawn rubiefawn added compatibility master branch This issue predominantly affects the active development (master) branch labels May 25, 2026
@rubiefawn rubiefawn marked this pull request as ready for review May 30, 2026 00:43
@rubiefawn rubiefawn added the needs code review A functional code review is currently required for this PR label May 30, 2026

@JohannesLorenz JohannesLorenz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From looking over it, I don't see how this could break anything. The CTYPE_H and STRING_H macros are not being used anyways, the rest looks good.

Since I don't have OpenBSD, this can only count as functional code check approval.

ENDIF()

IF(LMMS_BUILD_OPENBSD)
SET(Qt5_DIR "${OPENBSD_LOCALBASE}/lib/qt5/cmake/Qt5/")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a use case where a user specifies this on command line? If so, this would overwrite it?

IIRC, find_package logic is to only set those ...DIR variables if they are not set yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a use case where a user specifies this on command line?

OpenBSD is a bit more predictable than Linux as the kernel and userland are developed in the same project, there is exactly one distro, there is exactly one package manager, etc. If the user has installed Qt through pkg_add, this location will be correct. If the user was compiling against a local build of Qt they self-compiled, this might be a problem, but there is no precedent for compiling LMMS against a custom Qt that I am aware of.

As far as not overwriting variables provided on invocation, CMake actually accounts for this with SET(CACHE{foo} ...). However, it was added in CMake 4.2, and I'm not interested in bumping the minimum required in this PR, especially

@rubiefawn rubiefawn linked an issue Jul 1, 2026 that may be closed by this pull request
1 task
@rubiefawn rubiefawn added the bug label Jul 1, 2026
@rubiefawn rubiefawn changed the title Make compilation smoother on OpenBSD Fix Sndio backend & cleanup compilation on OpenBSD Jul 1, 2026
@rubiefawn rubiefawn added this to the 1.3-alpha.2 milestone Jul 1, 2026
Comment thread src/core/audio/AudioSndio.cpp Outdated
Comment thread src/core/audio/AudioSndio.cpp
Comment thread src/core/audio/AudioSndio.cpp Outdated
Comment thread CMakeLists.txt

@messmerd messmerd 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.

LGTM

@rubiefawn rubiefawn merged commit 1d04b4e into LMMS:master Jul 2, 2026
11 checks passed
@rubiefawn rubiefawn deleted the fix/openbsd branch July 2, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug compatibility master branch This issue predominantly affects the active development (master) branch needs code review A functional code review is currently required for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sndio backend is broken

3 participants