Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**

Saturday, May 2, 2026

Truly avoiding wayland

I agree with Eugene Andrienko about removing linuxisms from my primary box.  I followed the idea that poudriere would build customized ports that left out the WAYLAND option and other things.  The small problem with this technique is that there are hidden dependencies that might pull-in wayland without an option to configure.

There is a relatively simple way to avoid every hidden dependency with nearly perfect precision.  Of course this method also requires possible periodic updates because things in ports change from time to time, due to name changes or because new items get added.  The solution is an extension of the /etc/make.conf option technique.  First use a search to find all ports with wayland in the name.

#locate wayland | grep Makefile$ | grep ^/usr/ports
@
/usr/ports/deskutils/dmenu-wayland/Makefile
/usr/ports/devel/hyprwayland-scanner/Makefile
/usr/ports/graphics/egl-wayland/Makefile
/usr/ports/graphics/egl-wayland2/Makefile
/usr/ports/graphics/glew-wayland/Makefile
/usr/ports/graphics/linux-c7-wayland/Makefile
/usr/ports/graphics/linux-rl9-qt5-qtwayland/Makefile
/usr/ports/graphics/linux-rl9-wayland/Makefile
/usr/ports/graphics/qt5-wayland/Makefile
/usr/ports/graphics/qt6-wayland/Makefile
/usr/ports/graphics/wayland/Makefile
/usr/ports/graphics/wayland-protocols/Makefile
/usr/ports/graphics/wayland-utils/Makefile
/usr/ports/graphics/waylandpp/Makefile
/usr/ports/x11/kf5-kwayland/Makefile
/usr/ports/x11/plasma-wayland-protocols/Makefile
/usr/ports/x11/plasma6-kwayland/Makefile
/usr/ports/x11/plasma6-kwayland-integration/Makefile
/usr/ports/x11/wayland-logout/Makefile
/usr/ports/x11/xwayland-run/Makefile
/usr/ports/x11/xwayland-satellite/Makefile
/usr/ports/x11-servers/xwayland/Makefile
/usr/ports/x11-wm/lxqt-wayland-session/Makefile

The adjustments to the /etc/make.conf file are the second part of this.  The same can be done for pulseaudio or any other linuxism from ports that you wish to avoid.

OPTIONS_UNSET+=SNDIO JACK PIPEWIRE PULSEAUDIO WAYLAND
OPTIONS_SET+=OSS X11 XLIBRE

# Easier to automate than remember every time
.if ${.CURDIR:M*/ports/audio/sndio}
BROKEN= sndio causes firefox audio to fail
.endif

# disrupt all wayland installs
.if ${.CURDIR:M*/ports/deskutils/dmenu-wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/devel/hyprwayland-scanner}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/egl-wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/egl-wayland2}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/glew-wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/linux-c7-wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/linux-rl9-qt5-qtwayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/linux-rl9-wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/qt5-wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/qt6-wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/wayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/wayland-protocols}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/wayland-utils}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/graphics/waylandpp}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11/kf5-kwayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11/plasma-wayland-protocols}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11/plasma6-kwayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11/plasma6-kwayland-integration}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11/wayland-logout}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11/xwayland-run}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11/xwayland-satellite}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11-servers/xwayland}
BROKEN= Wayland is a scourge to deny
.endif
.if ${.CURDIR:M*/ports/x11-wm/lxqt-wayland-session}
BROKEN= Wayland is a scourge to deny
.endif

# Deny pulseaudio
.if ${.CURDIR:M*/ports/audio/linux-c7-alsa-plugins-pulseaudio}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/linux-c7-pulseaudio-libs}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/linux-c7-pulseaudio-utils}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/linux-rl9-alsa-plugins-pulseaudio}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/linux-rl9-pulseaudio-libs}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/linux-rl9-pulseaudio-utils}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/pulseaudio}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/pulseaudio-module-sndio}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/pulseaudio-module-xrdp}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/pulseaudio-qt}
BROKEN= Pulseaudio is just no good
.endif
.if ${.CURDIR:M*/ports/audio/xfce4-pulseaudio-plugin}
BROKEN= Pulseaudio is just no good
.endif

This recently saved me from a secret wayland dependency hidden within multimedia/qt6-multimedia in its Makefile.  I was building games/openmw because I noticed it was updated and was curious how it looked.  The qt6-multimedia port is one among many others that needed to be built, but when the BROKEN signal was triggered I could investigate why.

PORTNAME=	multimedia
DISTVERSION=	${QT6_VERSION}
CATEGORIES=	multimedia
PKGNAMEPREFIX=	qt6-

MAINTAINER=	kde@FreeBSD.org
COMMENT=	Qt audio, video, radio and camera support module

BUILD_DEPENDS=	vulkan-headers>0:graphics/vulkan-headers
LIB_DEPENDS=	libxkbcommon.so:x11/libxkbcommon

USES=		cmake compiler:c++17-lang gl localbase:ldflags pkgconfig qt-dist:6
USE_GL=		opengl
USE_QT=		base declarative shadertools:build
USE_LDCONFIG=	${PREFIX}/${QT_LIBDIR_REL}

CFLAGS_powerpc=		-DPFFFT_SIMD_DISABLE
CXXFLAGS_powerpc64=	-mvsx

OPTIONS_DEFINE=		FFMPEG GSTREAMER PIPEWIRE Q3D V4L VAAPI X11
OPTIONS_DEFAULT=	FFMPEG GSTREAMER PIPEWIRE PULSEAUDIO Q3D V4L VAAPI X11
AUDIO_DESC=		Low-level audio backend
OPTIONS_SINGLE=		AUDIO
OPTIONS_SINGLE_AUDIO=	ALSA PULSEAUDIO
OPTIONS_SUB=		yes

ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
ALSA_RUN_DEPENDS=	alsa-plugins>=0:audio/alsa-plugins
ALSA_CMAKE_BOOL=	FEATURE_alsa

FFMPEG_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
FFMPEG_CMAKE_BOOL=	FEATURE_ffmpeg

GSTREAMER_LIB_DEPENDS=	libdrm.so:graphics/libdrm \
			libwayland-client.so:graphics/wayland
# As of 2024-09-29, Mk/Uses/xorg.mk freaks out if no modules are defined
# via USE_XORG, so FTTB, we must duplicate USES=xorg in the GSTREAMER
# and X11 options and cannot hoist it to the main USES declaration as a
# noop.
GSTREAMER_USES=		gnome gstreamer:1 xorg
GSTREAMER_USE=		GL=egl \
			GNOME=glib20 \
			GSTREAMER=bad,gl,good,ugly,${"${PORT_OPTIONS:MALSA}":?alsa:pulse} \
			XORG=xcb
GSTREAMER_CMAKE_BOOL=	FEATURE_gstreamer \
			FEATURE_gstreamer_1_0 \
			FEATURE_gstreamer_app \
			FEATURE_gstreamer_gl \
			FEATURE_gstreamer_photography

PIPEWIRE_LIB_DEPENDS=	libpipewire-0.3.so:multimedia/pipewire
PIPEWIRE_CMAKE_BOOL=	FEATURE_pipewire
PIPEWIRE_IMPLIES=	FFMPEG

PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
PULSEAUDIO_CMAKE_BOOL=	FEATURE_pulseaudio

Q3D_DESC=		Spatial audio support via QtQuick3D
Q3D_USE=		QT=quick3d,shadertools
Q3D_CMAKE_BOOL=		FEATURE_spatialaudio_quick3d

V4L_BUILD_DEPENDS=	v4l_compat>0:multimedia/v4l_compat
V4L_CMAKE_BOOL=		FEATURE_linux_v4l
V4L_IMPLIES=		${"${PORT_OPTIONS:MFFMPEG}":?FFMPEG:GSTREAMER}

VAAPI_LIB_DEPENDS=	libva.so:multimedia/libva
VAAPI_USE=		GL=egl
VAAPI_CMAKE_BOOL=	FEATURE_vaapi
VAAPI_IMPLIES=		FFMPEG

# We assume that the Qt stack has been built with consistent X11 options.
# QT_FEATURE_xlib is defined globally by devel/qt6-base based upon whether
# the X11 option was enabled in that port.
X11_USES=		xorg
X11_USE=		XORG=x11,xext,xrandr
X11_IMPLIES=		FFMPEG

.include 

.if ${ARCH} == "i386" && ${MACHINE_CPU:Nsse}
CXXFLAGS+=	-DDISABLE_SIMD \
		-DPFFFT_SIMD_DISABLE
.endif

.include 
                             ┌──────────────────┤qt6-multimedia-6.10.2├─────────────────┐
                             │ 'Help' button for port info, 'F1' for Ports Collection   │  
                             │ help.                                                    │  
                             │ ┌──────────────────────────────────────────────────────┐ │  
                             │ │[X] FFMPEG     FFmpeg support (WMA, AIFF, AC3, APE...)│ │  
                             │ │[ ] GSTREAMER  Multimedia support via GStreamer       │ │  
                             │ │[X] PIPEWIRE   PipeWire multimedia server support     │ │  
                             │ │[X] Q3D        Spatial audio support via QtQuick3D    │ │  
                             │ │[X] V4L        Video 4 Linux support                  │ │  
                             │ │[X] VAAPI      VAAPI (GPU video acceleration) support │ │  
                             │ │[X] X11        X11 (graphics) support                 │ │  
                             │ │──── Low-level audio backend [select at least one] ───│ │  
                             │ │(*) ALSA       ALSA audio architecture support        │ │  
                             │ │( ) PULSEAUDIO PulseAudio sound server support        │ │  
                             │ └──────────────────────────────────────────────────────┘ │  
                             ├──────────────────────────────────────────────────────────┤  
                             │            [  OK  ]     [Cancel]     [ Help ]            │  
                             └──────────────────────────────────────────────────────────┘  
                                                                                           

The beauty of this method, whether if it is used via poudriere or when directly building ports, is that you will get a message and the build process will stop as long as "TRY_BROKEN" is not used.  Any port that gets built among potential dozens which has a dependency you do not desire will halt until you adjust the configuration.  Maybe you will need to look at the Makefile to find which option is causing it, but this is simple and easy to adjust.

Hidden dependencies and unexposed build options are likely very common across the whole of our ports tree. We can do better to identify associated dependencies or avoid including an unnamed dependency by adding a configuration option to toggle it.  There are tools and methods to assist with verifying build or run or library dependencies when ports are developed or updated.  We can use this make.conf method to enforce our desires whether our ports tree becomes flawless and consistent or not.

Frequently viewed this week