Tweak multimedia/mlt version 6.4.1_2
[dports.git] / multimedia / libv4l / Makefile
1 # Created by: Andrew Thompson <thompsa@FreeBSD.org>
2 # $FreeBSD$
3 # Check v4l_compat and v4l-utils slave ports
4
5 PORTNAME?=      libv4l
6 PORTVERSION=    1.6.3
7 PORTREVISION?=  2
8 CATEGORIES=     multimedia
9 MASTER_SITES=   http://linuxtv.org/downloads/v4l-utils/:master \
10                 LOCAL/kwm:local
11 DISTFILES+=     v4l-utils-${PORTVERSION}.tar.bz2:master \
12                 linux-3.16.7-dvb-headers.tar.xz:local
13
14 MAINTAINER=     multimedia@FreeBSD.org
15 COMMENT?=       Video4Linux library
16
17 LICENSE=        GPLv2 LGPL21
18 LICENSE_COMB=   dual
19
20 LIBV4L_SLAVE?=  no
21
22 USES=           tar:bzip2
23 WRKSRC=         ${WRKDIR}/v4l-utils-${PORTVERSION}
24
25 .if ${LIBV4L_SLAVE} != compat
26 BUILD_DEPENDS+= v4l_compat>=${PORTVERSION}:multimedia/v4l_compat
27
28 GNU_CONFIGURE=  yes
29 CPPFLAGS+=      -I${LOCALBASE}/include
30 LDFLAGS+=       -L${LOCALBASE}/lib
31 USES+=          gmake iconv jpeg libtool pathfix pkgconfig
32 USE_LDCONFIG=   yes
33 CONFIGURE_ARGS= --enable-libdvbv5 \
34                 --disable-qv4l2 \
35                 --without-libudev
36 INSTALL_TARGET= install-strip
37
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
45 . else
46 CONFIGURE_ARGS+=--disable-v4l-utils --enable-libv4l
47 EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure
48 . endif
49 .endif
50
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
55
56 post-patch:
57         @${REINPLACE_CMD} -e 's|$$libdir/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \
58                 ${WRKSRC}/configure
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}
70 .endfor
71 .endif
72
73 .include <bsd.port.mk>