Fix Sndio backend & cleanup compilation on OpenBSD#8407
Conversation
JohannesLorenz
left a comment
There was a problem hiding this comment.
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/") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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 -j4should just work, provided dependencies are installed and whatnot.Qt[5-6]_DIRandQt[5-6]Test_DIRautomatically, similar to how this is handled for macOSLOCALBASEandX11BASEto include and link pathsRegarding disabled features in the OpenBSD port
Latest revision, rev 1.29
-DWANT_OSS=OFFsince rev 1.1,-DLMMS_HAVE_OSS=FALSEsince rev 1.15: Rationale is given in the patch notes, "don't link deprecated ossaudio on OpenBSD". Disabling this is desirable.-DWANT_SDL=OFFsince 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=OFFsince 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/calfaudio/caps-pluginsaudio/cmtaudio/swh-pluginsaudio/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.