diff options
author | nox <nox@FreeBSD.org> | 2011-05-08 23:04:17 +0800 |
---|---|---|
committer | nox <nox@FreeBSD.org> | 2011-05-08 23:04:17 +0800 |
commit | e93f9aae23cce678aa10ca5c20b7ea4036a2f601 (patch) | |
tree | 872b1c16fadee217dfbabe393436fc80c687f93d | |
parent | 7693c6d9b3a225ebcec0297c5a93c951020450f8 (diff) | |
download | freebsd-ports-gnome-e93f9aae23cce678aa10ca5c20b7ea4036a2f601.tar.gz freebsd-ports-gnome-e93f9aae23cce678aa10ca5c20b7ea4036a2f601.tar.zst freebsd-ports-gnome-e93f9aae23cce678aa10ca5c20b7ea4036a2f601.zip |
This kld adds V4L2 ioctl handling to the Linux compatibility layer
so that Linux apps like Skype or Flash can talk to V4L2 devices
(like webcams) via /dev/videoX. The patches this kld is based on
have been committed to FreeBSD 9.0-current now (r221426) so this
port is only needed on eaerlier versions.
Note this port does not contain actual V4L2 drivers, those are
provided by e.g. the multimedia/webcamd port.
WWW: http://people.freebsd.org/~nox/dvb/
-rw-r--r-- | multimedia/Makefile | 1 | ||||
-rw-r--r-- | multimedia/linux_v4l2wrapper-kmod/Makefile | 59 | ||||
-rw-r--r-- | multimedia/linux_v4l2wrapper-kmod/distinfo | 2 | ||||
-rw-r--r-- | multimedia/linux_v4l2wrapper-kmod/files/patch-Makefile | 16 | ||||
-rw-r--r-- | multimedia/linux_v4l2wrapper-kmod/files/patch-linux_v4l2.c | 30 | ||||
-rw-r--r-- | multimedia/linux_v4l2wrapper-kmod/pkg-descr | 10 |
6 files changed, 118 insertions, 0 deletions
diff --git a/multimedia/Makefile b/multimedia/Makefile index 92596df70139..aea387cd30ab 100644 --- a/multimedia/Makefile +++ b/multimedia/Makefile @@ -181,6 +181,7 @@ SUBDIR += linux-tsmuxer SUBDIR += linux-xmovie SUBDIR += linux_dvbwrapper-kmod + SUBDIR += linux_v4l2wrapper-kmod SUBDIR += lives SUBDIR += lsdvd SUBDIR += lxdvdrip diff --git a/multimedia/linux_v4l2wrapper-kmod/Makefile b/multimedia/linux_v4l2wrapper-kmod/Makefile new file mode 100644 index 000000000000..31666ea2daa0 --- /dev/null +++ b/multimedia/linux_v4l2wrapper-kmod/Makefile @@ -0,0 +1,59 @@ +# New ports collection makefile for: linux_v4l2wrapper-kmod +# Date created: Fri May 6 22:30:00 CEST 2011 +# Whom: nox@FreeBSD.org +# +# $FreeBSD$ +# + +PORTNAME= linux_v4l2wrapper-kmod +PORTVERSION= 1.0 +CATEGORIES= multimedia kld +MASTER_SITES= LOCAL/nox \ + http://people.freebsd.org/~ae/ +DISTNAME= linux_v4l2_kld +EXTRACT_SUFX= .tgz + +MAINTAINER= nox@FreeBSD.org +COMMENT= Linux compatibility layer - V4L2 ioctl handler + +ONLY_FOR_ARCHS= i386 amd64 +PATCH_STRIP= -p1 +WRKSRC= ${WRKDIR}/linux_v4l2 + +.include <bsd.port.pre.mk> + +PLIST_FILES+= "@cwd /" +PLIST_FILES+= ${KMODDIR:C,^/,,}/linux_v4l2wrapper.ko +PLIST_FILES+= "@exec kldxref ${KMODDIR}" +PLIST_FILES+= "@unexec kldxref ${KMODDIR}" + +# install where x11/nvidia-driver does also: +KMODDIR= /boot/modules + +MAKE_ENV+= KMODDIR="${KMODDIR}" + +SYSDIR?= ${SRC_BASE}/sys +MAKE_ENV+= SYSDIR="${SYSDIR}" + +CFLAGS+= ${DEBUG_FLAGS} + +# try to avoid child processes when finding out if already in the kernel +.if ${OSVERSION} > 900036 +INBASE= 1 +.else +.if ${OSVERSION} == 900036 +INBASE!= ($(SYSCTL) -n kern.features.linuxulator_v4l2 2>/dev/null || true) +.else +INBASE= 0 +.endif +.endif + +.if ${INBASE} == "1" +IGNORE= is already in kernel +.else +.if !exists(${SYSDIR}/Makefile) +IGNORE= requires kernel source to be installed +.endif +.endif + +.include <bsd.port.post.mk> diff --git a/multimedia/linux_v4l2wrapper-kmod/distinfo b/multimedia/linux_v4l2wrapper-kmod/distinfo new file mode 100644 index 000000000000..0f5857863ba1 --- /dev/null +++ b/multimedia/linux_v4l2wrapper-kmod/distinfo @@ -0,0 +1,2 @@ +SHA256 (linux_v4l2_kld.tgz) = 1d8d4fad58bc829f85541d41d5e29425e1453375d6b25848c20eea677119ee32 +SIZE (linux_v4l2_kld.tgz) = 22170 diff --git a/multimedia/linux_v4l2wrapper-kmod/files/patch-Makefile b/multimedia/linux_v4l2wrapper-kmod/files/patch-Makefile new file mode 100644 index 000000000000..85ed11c8a222 --- /dev/null +++ b/multimedia/linux_v4l2wrapper-kmod/files/patch-Makefile @@ -0,0 +1,16 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,11 +1,11 @@ + # $FreeBSD$ + +-.if ${MACHINE_CPUARCH} == "amd64" ++.if ${MACHINE_ARCH} == "amd64" + SFX= 32 + CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 + .endif + +-KMOD= linux_v4l2 ++KMOD= linux_v4l2wrapper + SRCS= linux_v4l2.c + + .include <bsd.kmod.mk> diff --git a/multimedia/linux_v4l2wrapper-kmod/files/patch-linux_v4l2.c b/multimedia/linux_v4l2wrapper-kmod/files/patch-linux_v4l2.c new file mode 100644 index 000000000000..fc0ca6cd29d9 --- /dev/null +++ b/multimedia/linux_v4l2wrapper-kmod/files/patch-linux_v4l2.c @@ -0,0 +1,30 @@ +--- a/linux_v4l2.c ++++ b/linux_v4l2.c +@@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); + #endif + + #include <compat/linux/linux_ioctl.h> +-#include <compat/linux/linux_videodev.h> +-#include <compat/linux/linux_videodev_compat.h> + + #include "linux_v4l2_ioctl.h" + #include "linux_videodev2.h" +@@ -71,14 +69,14 @@ linux_v4l2_modevent(module_t mod __unuse + } + + static moduledata_t v4l2_mod = { +- "linux_v4l2", ++ "linux_v4l2wrapper", + linux_v4l2_modevent, + 0 + }; + +-DECLARE_MODULE(linux_v4l2, v4l2_mod, SI_SUB_SYSCALLS, SI_ORDER_ANY); +-MODULE_VERSION(linux_v4l2, 1); +-MODULE_DEPEND(linux_v4l2, linux, 1, 1, 1); ++DECLARE_MODULE(linux_v4l2wrapper, v4l2_mod, SI_SUB_SYSCALLS, SI_ORDER_ANY); ++MODULE_VERSION(linux_v4l2wrapper, 1); ++MODULE_DEPEND(linux_v4l2wrapper, linux, 1, 1, 1); + + static int + linux_to_bsd_v4l2_standard(struct l_v4l2_standard *lvstd, struct v4l2_standard *vstd) diff --git a/multimedia/linux_v4l2wrapper-kmod/pkg-descr b/multimedia/linux_v4l2wrapper-kmod/pkg-descr new file mode 100644 index 000000000000..5a42923f0150 --- /dev/null +++ b/multimedia/linux_v4l2wrapper-kmod/pkg-descr @@ -0,0 +1,10 @@ +This kld adds V4L2 ioctl handling to the Linux compatibility layer +so that Linux apps like Skype or Flash can talk to V4L2 devices +(like webcams) via /dev/videoX. The patches this kld is based on +have been committed to FreeBSD 9.0-current now (r221426) so this +port is only needed on eaerlier versions. + +Note this port does not contain actual V4L2 drivers, those are +provided by e.g. the multimedia/webcamd port. + +WWW: http://people.freebsd.org/~nox/dvb/ |