media-video/pipewire-0.3.39 has added a meson option named 'pipewire-v4l2', enabled by default. pipewire-v4l2 is a separate option from v4l2 in meson_options.txt.
I suggest to add:
$(meson_native_use_feature pipewire-v4l pipewire-v4l2)
to emesonargs, along with the associated USE flag and depends.
Steps to Reproduce:
1. # USE="bluetooth doc extra gstreamer pipewire-alsa systemd -echo-cancel -jack-client -jack-sdk -test -v4l" emerge "=media-video/pipewire-0.3.39"
Unexpected v4l integration added.
No v4l integration or dependencies needed.
emerge --info | head -n1
Portage 3.0.28 (python 3.8.12-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-11.2.0, glibc-2.33-r7, linux-5.10.40 x86_64)
When using custom *FLAGS to build, pipewire-v4l2 fails to build. Won't open a separate issue for this since it should be sent to upstream. There are also many compiler warnings when using the Gentoo default *FLAGS.
Created attachment 746553 [details]
Build log of pipewire-0.3.39 showing pipewire-v4l2 being built
Created attachment 746556 [details]
Build log with pipewire-v4l2 disabled
Created attachment 746559 [details]
-O3 -flto -fno-semantic-interposition
The first two logs show the package configuring, so no action to take. ;)
The third log is failure that's almost certainly due to weird flags and may not even count as a bug but I don't know since you're using some _weird_ flags.
It is not imppossible that I have missed one of the pw-v4l2 source files including a V4L2 specific header but a quick glance only finds /usr/include/linux/videodev2.h which belongs to sys-kernel/linux-headers package. If you could provide a log that showed a missing include or library, that would help to pinpoint and fix the issue (if there is such). ;)
Furthermore I checked the Portage recorded dependencies and I'm not seeing any dynamic linking with anything V4L2:
pw-v4l2 is a very small program that has no perceivable impact on compile time and is currently not known to have anything but the most common and trivial dependencies that are always satisfied - therefore per Gentoo guidelines it should not be controlled by a USE flag. You can use `MYMESONARGS="-Dpipewire-v4l2=disabled" emerge -v1 media-video/pipewire` to work around that (untested but seems like I got the syntax right) but it looks like you already knew that.
Because v4l IUSE is already present, it would be okay to add it under that but the two features are actually orthogonal to one another (PipeWire can in theory use libcamera while exposing emulated v4l2 interface to clients). As far as I'm concerned, you'll need to find an actual reason why we should not follow upstream choice and always build pw-v4l2.
Therefore I recommend closing this as NEEDINFO (or straight to NOTABUG).
Sorry the early typo, I meant the logs show the package building and passing all the tests not configuring. ;)