Files
Paul Spooren eeb50d1052 v4l2loopback: build through KERNEL_MAKE
kmod-v4l2loopback differs between builds, e.g. on apm821xx/nand, as
v4l2loopback.ko carries the absolute path of the kernel tree:

  /builder/shared-workdir/build/build_dir/.../linux-6.18.52/include/linux/ucopysize.h

The module is built by calling make -C $(LINUX_DIR) directly, so none
of the OpenWrt prefix maps apply, and since Linux 6.13 kbuild includes
the kernel headers of external modules by their absolute path.

Build through $(KERNEL_MAKE), which passes KERNEL_MAKE_FLAGS and with
them the prefix maps of the build and staging directories, like the
kernel packages of the main repository do. ARCH and CROSS_COMPILE come
with KERNEL_MAKE_FLAGS as well.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-09-30 11:40:34 +02:00

50 lines
1.3 KiB
Makefile

# This software is in the public domain, furnished "as is", without technical
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=v4l2loopback
PKG_VERSION:=0.15.3
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/umlaeute/v4l2loopback
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_MIRROR_HASH:=34a9b7d58c42be0b6f7b60c960df4bdf26f34a97c360bd9819057dc0732beca6
PKG_MAINTAINER:=Michel Promonet <michel.promonet@free.fr>
PKG_CPE_ID:=cpe:/o:v4l2loopback_project:v4l2loopback
include $(INCLUDE_DIR)/package.mk
define KernelPackage/v4l2loopback
SUBMENU:=Video Support
TITLE:=v4l2loopback kernel module
FILES:=$(PKG_BUILD_DIR)/v4l2loopback.ko
DEPENDS:=+kmod-video-core
AUTOLOAD:=$(call AutoProbe,v4l2loopback)
endef
define KernelPackage/v4l2loopback/description
This module allows you to create "virtual video devices".
Normal (v4l2) applications will read these devices as if
they were ordinary video devices, but the video will not be
read from e.g. a capture card but instead it is generated
by another application.
endef
MAKE_OPTS:= \
M="$(PKG_BUILD_DIR)"
define Build/Compile
$(KERNEL_MAKE) \
$(MAKE_OPTS) \
CONFIG_PACKAGE_kmod-v4l2loopback=m \
modules
endef
$(eval $(call KernelPackage,v4l2loopback))