blob: 5471cea918768cdbd90c704c592a6a1f9f6a0aa2 (
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
|
# Created by: nemysis <nemysis@gmx.ch>
# $FreeBSD$
PORTNAME= gtk-youtube-viewer
PORTVERSION= 3.0.7
PORTREVISION= 1
CATEGORIES= multimedia perl5
MAINTAINER= nemysis@gmx.ch
COMMENT= GTK Search and play YouTube videos streaming in MPlayer
LICENSE= GPLv3
# According to Build.PL
BUILD_DEPENDS= p5-Data-Dump>=0:${PORTSDIR}/devel/p5-Data-Dump \
p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
p5-Term-ANSIColor>=0:${PORTSDIR}/devel/p5-Term-ANSIColor \
p5-URI>=0:${PORTSDIR}/net/p5-URI \
p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser \
p5-LWP-Protocol-https>=0:${PORTSDIR}/www/p5-LWP-Protocol-https \
p5-Term-ReadKey>=0:${PORTSDIR}/devel/p5-Term-ReadKey \
p5-ReadLine-Gnu>=0:${PORTSDIR}/devel/p5-ReadLine-Gnu \
p5-XML-Fast>=0:${PORTSDIR}/net/p5-XML-Fast
RUN_DEPENDS:= ${BUILD_DEPENDS} \
mplayer:${PORTSDIR}/multimedia/mplayer
TEST_DEPENDS= p5-Test-More-UTF8>=0:${PORTSDIR}/devel/p5-Test-More-UTF8
CONFLICTS= youtube-viewer-[0-9]*
USE_GITHUB= yes
GH_ACCOUNT= trizen
GH_PROJECT= youtube-viewer
GH_COMMIT= c26d9a7
WRKSRC= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT}/WWW-YoutubeViewer
CONFIGURE_ARGS+=${DATADIR}
PERL_MODBUILD= yes
MAN3= WWW::YoutubeViewer::RegularExpressions.3 \
WWW::YoutubeViewer.3 \
WWW::YoutubeViewer::Itags.3 \
WWW::YoutubeViewer::Utils.3 \
WWW::YoutubeViewer::GetCaption.3 \
WWW::YoutubeViewer::ParseXML.3
PORTDOCS= Changes README
OPTIONS_DEFINE= GCAP
OPTIONS_MULTI= USER_INTERFACE
OPTIONS_MULTI_USER_INTERFACE= CLI GTK2
OPTIONS_DEFAULT= GTK2 GCAP
CLI_DESC= Enable CLI version
GCAP_DESC= Enable YouTube captions support
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MCLI}
MAN1= youtube-viewer.1
PLIST_SUB+= CLI=""
.else
PLIST_SUB+= CLI="@comment "
.endif
.if ${PORT_OPTIONS:MGTK2}
BUILD_DEPENDS+= p5-Gtk2>=0:${PORTSDIR}/x11-toolkits/p5-Gtk2
RUN_DEPENDS+= p5-Gtk2>=0:${PORTSDIR}/x11-toolkits/p5-Gtk2
CONFIGURE_ARGS+=--gtk-youtube-viewer
PLIST_SUB+= GTK2=""
.else
PLIST_SUB+= GTK2="@comment "
.endif
.if ${PORT_OPTIONS:MGCAP}
RUN_DEPENDS+= ${LOCALBASE}/bin/gcap:${PORTSDIR}/multimedia/gcap
.endif
post-extract:
.if ! exists(${LOCALBASE}/bin/per5.16.2)
@${ECHO_CMD}
@${ECHO_MSG} "GTK Youtube Viewer 3.07 requires lang/perl5.16 to use CLI version"
@${ECHO_MSG}
@${ECHO_MSG} "Please read /usr/ports/UPDATING"
@${ECHO_MSG}
@${ECHO_MSG} "Hit ^c now if you don't wish to do this."
@${ECHO_MSG}
.endif
post-patch:
@${REINPLACE_CMD} -n '1,/create_build_script()/p' \
${WRKSRC}/Build.PL
@${REINPLACE_CMD} \
-e 's|5.016|0|' \
${WRKSRC}/Build.PL
@cd ${WRKSRC}/bin && ${REINPLACE_CMD} -e 's|/usr|${PREFIX}|g' \
gtk-youtube-viewer youtube-viewer
.if ! ${PORT_OPTIONS:MCLI}
@${REINPLACE_CMD} -e "s|'bin/youtube-viewer',||" \
${WRKSRC}/Build.PL
@${REINPLACE_CMD} -i '' -e '/copy(catfile($$main_dir, qw(bin youtube-viewer))/,+1d' \
${WRKSRC}/Build.PL
.endif
post-install:
.if ${PORT_OPTIONS:MGTK2}
@${MKDIR} ${PREFIX}/share/applications
${INSTALL_DATA} ${WRKSRC}/share/gtk-youtube-viewer.desktop ${PREFIX}/share/applications
@${MKDIR} ${DATADIR}/icons
${INSTALL_DATA} ${WRKSRC}/share/gtk-youtube-viewer.glade ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/share/gtk-youtube-viewer-icons/* ${DATADIR}/icons
${INSTALL_DATA} ${WRKSRC}/share/icons/gtk-youtube-viewer.png ${PREFIX}/share/pixmaps
.endif
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR}
.endif
regression-test: build
cd ${WRKSRC} && ${PERL} ./Build test
.include <bsd.port.mk>
|