aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/vdr/Makefile
blob: 5358390a7612580a4c7a54a3460724c9a5770777 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Created by: Juergen Lock <nox@FreeBSD.org>
# $FreeBSD$

PORTNAME=   vdr
PORTVERSION=    1.7.29
PORTREVISION=   6
CATEGORIES= multimedia
MASTER_SITES=   ftp://ftp.tvdr.de/vdr/Developer/

MAINTAINER= ports@FreeBSD.org
COMMENT=    Video Disk Recorder - development version

LICENSE=    GPLv2+
LICENSE_FILE=   ${WRKSRC}/COPYING

BUILD_DEPENDS=  v4l_compat>=1.0.20120501:${PORTSDIR}/multimedia/v4l_compat
BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:${PORTSDIR}/x11-fonts/fontconfig
RUN_DEPENDS+=   ${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:${PORTSDIR}/x11-fonts/fontconfig \
        xorg-fonts-truetype>=0:${PORTSDIR}/x11-fonts/xorg-fonts-truetype

OPTIONS_DEFINE=     IPTVPATCH TTXPATCH STB0899_SIGNAL DOCS NLS
IPTVPATCH_DESC=     Stops EIT scans on IPTV channels
TTXPATCH_DESC=      Support patches for teletext subtitle plugin
DVBPATCH_DESC=      DVB audio patch for some countries
STB0899_SIGNAL_DESC=    STB0899 signal strength patch
OPTIONS_DEFAULT=    IPTVPATCH TTXPATCH

USES=       cpe gettext gmake iconv:wchar_t jpeg pkgconfig shebangfix tar:bzip2
CPE_VENDOR= tvdr
SHEBANG_FILES=  svdrpsend
DIST_SUBDIR=    vdr
PORTDOCS=   COPYING INSTALL MANUAL README HISTORY
CONFDIR=    $(ETCDIR)
USE_CSTD=   gnu89
MAKE_ARGS+= CC="${CC}"
MAKE_ARGS+= CXX="${CXX}"
MAKE_ARGS+= VDR_USER=${VDR_USER}
MAKE_ARGS+= CONFDIR=$(CONFDIR)
MAKE_ARGS+= OSTYPE=FreeBSD
MAKE_ARGS+= LIRC_DEVICE=/var/run/lirc/lircd
MAKE_ARGS+= LIBDIR=../../lib
MAKE_ARGS+= VDRDIR=${WRKSRC}
MAKE_ARGS+= TMPDIR=/tmp
MAKE_ARGS+= PREFIX=${PREFIX}
ALL_TARGET= all plugins

VIDEODIR=   /video
SUB_LIST+=  VIDEODIR=${VIDEODIR}
SUB_FILES+= vdr-waitdvb
USE_RC_SUBR=    vdr
VDR_USER=   vdr
VDR_GROUP=  vdr
USERS=      ${VDR_USER}
GROUPS=     ${VDR_GROUP}
PLIST_SUB=  VDR_USER=${VDR_USER}
PLIST_SUB+= VDR_GROUP=${VDR_GROUP}

.include <bsd.port.options.mk>

.if ${OPSYS} == DragonFly
IGNORE=     will not work due to lack of driver support
.endif

.if ${ARCH} == "i386"
USE_GCC=    any
.endif

EXTRA_PATCHES+= ${FILESDIR}/vdr-1.7.15-disable_ca_updates.patch
.if ${PORT_OPTIONS:MIPTVPATCH}
EXTRA_PATCHES+= ${FILESDIR}/vdr-1.7.15-disable_eitscan.patch
.endif
.if ${PORT_OPTIONS:MDVBPATCH}
EXTRA_PATCHES+= ${FILESDIR}/vdr-1.7.27-pat.diff
.endif

.if ${PORT_OPTIONS:MTTXPATCH}
PLIST_SUB+= TTXPATCH=""
.else
PLIST_SUB+= TTXPATCH="@comment "
.endif

.if ${PORT_OPTIONS:MNLS}
PLIST_SUB+= NLS=""
.else
PLIST_SUB+= NLS="@comment "
ALL_TARGET= vdr plugins
.endif

post-patch:
# clang doesn't know -MG:
    @${REINPLACE_CMD} -e '/^MAKEDEP.*-MM/s/-MG[[:space:]]*$$/# -MG/' \
        ${WRKSRC}/Makefile ${WRKSRC}/libsi/Makefile \
        ${WRKSRC}/PLUGINS/src/*/Makefile
    @[ ! -f ${WRKSRC}/s2apiwrapper.c ] || \
        ${REINPLACE_CMD} 's/__u32/uint32_t/' ${WRKSRC}/s2apiwrapper.c
.if ${PORT_OPTIONS:MTTXPATCH}
    @${PATCH} -d ${WRKSRC} --quiet -p1 <${FILESDIR}/vdr-1.7.21-ttxtsubs.patch-1
    @${PATCH} -d ${WRKSRC} --quiet -p1 <${FILESDIR}/vdr-1.7.21-ttxtsubs.patch-2
.endif
.if ${PORT_OPTIONS:MSTB0899_SIGNAL}
# This fixes signal strength display for e.g. pctv452e-based tuners.
# (like TT S2-36?0.)
    @${PATCH} -d ${WRKSRC} --quiet -p1 <${FILESDIR}/stb0899-signalstrength.patch
.endif
    @${SED} \
        -e '/^PREFIX/d' \
        -e 's|^\(VIDEODIR[[:space:]]*\)[?]*\(=[[:space:]]*\).*|\1\2${VIDEODIR}|' \
        ${WRKSRC}/Make.config.template >${WRKSRC}/Make.config
    @${REINPLACE_CMD} -e 's|%%CONFDIR%%|${CONFDIR}|' ${WRKSRC}/vdr.1
# We don't support this yet:
    @${RM} -r ${WRKSRC}/PLUGINS/src/dvbhddevice

post-install:
.if ${PORT_OPTIONS:MNLS}
    @(cd ${WRKSRC} && ${COPYTREE_SHARE} locale ${STAGEDIR}${PREFIX}/share/)
.endif
    ${MKDIR} ${STAGEDIR}${CONFDIR}/plugins
    ${INSTALL_DATA} ${FILESDIR}/remote.conf ${STAGEDIR}${CONFDIR}/remote.conf.sample
    for i in $$(cd ${WRKSRC} && ls *.conf); do \
        ${MV} -i ${STAGEDIR}${CONFDIR}/$$i \
            ${STAGEDIR}${CONFDIR}/$$i.sample; \
    done
    ${INSTALL_SCRIPT} ${WRKDIR}/vdr-waitdvb ${STAGEDIR}${PREFIX}/bin
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    (cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})
.endif

.include <bsd.port.mk>