1 # Created by: Andrew Thompson <thompsa@FreeBSD.org>
3 # Check v4l_compat and v4l-utils slave ports
9 MASTER_SITES= http://linuxtv.org/downloads/v4l-utils/:master \
11 DISTFILES+= v4l-utils-${PORTVERSION}.tar.bz2:master \
12 linux-3.16.7-dvb-headers.tar.xz:local
14 MAINTAINER= multimedia@FreeBSD.org
15 COMMENT?= Video4Linux library
23 WRKSRC= ${WRKDIR}/v4l-utils-${PORTVERSION}
25 .if ${LIBV4L_SLAVE} != compat
26 BUILD_DEPENDS+= v4l_compat>=${PORTVERSION}:multimedia/v4l_compat
29 CPPFLAGS+= -I${LOCALBASE}/include
30 LDFLAGS+= -L${LOCALBASE}/lib
31 USES+= gmake iconv jpeg libtool pathfix pkgconfig
33 CONFIGURE_ARGS= --enable-libdvbv5 \
36 INSTALL_TARGET= install-strip
38 . if ${LIBV4L_SLAVE} == utils
39 BUILD_DEPENDS+= libv4l>=${PORTVERSION}:multimedia/libv4l
40 LIB_DEPENDS+= libargp.so:devel/argp-standalone \
41 libv4l2.so:multimedia/libv4l
42 # Disabling building libv4l in the utils slave is too much hackery
43 # Lets wait for subpackages
44 CONFIGURE_ARGS+=--enable-v4l-utils
46 CONFIGURE_ARGS+=--disable-v4l-utils --enable-libv4l
47 EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure
51 HEADER_PATCHES= extra-linux_dvb_ca.h \
52 extra-linux_dvb_osd.h \
53 patch-include_linux_dvb_frontend.h \
54 patch-include_linux_dvb_video.h
57 @${REINPLACE_CMD} -e 's|$$libdir/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \
59 # fix weird types, except a few headers which have compat code for these types.
60 @${FIND} ${WRKDIR} -type f \( -iname "*.h" ! -iname "input.h" ! -iname "videodev2.h" \) | \
61 ${XARGS} -n 10 ${REINPLACE_CMD} \
62 -e 's|linux/types.h|sys/types.h|g; s|__user||g; \
63 s|__u8|uint8_t|g; s|__s8|int8_t|g; \
64 s|__u16|uint16_t|g; s|__s16|int16_t|g; \
65 s|__u32|uint32_t|g; s|__s32|int32_t|g; \
66 s|__u64|uint64_t|g; s|__s64|int64_t|g'
67 .if ${LIBV4L_SLAVE} == compat
68 .for patch in ${HEADER_PATCHES}
69 @cd ${WRKDIR}/linux && ${PATCH} -p2 < ${FILESDIR}/${patch}
73 .include <bsd.port.mk>