1PORTNAME=	gnash
2PORTVERSION=	0.8.10
3PORTREVISION=	5
4CATEGORIES=	graphics
5MASTER_SITES=	http://git.savannah.gnu.org/cgit/gnash.git/snapshot/
6DISTNAME=	gnash-2b3bdede0305c4fc3ad21a0a4197330606c9b880
7
8MAINTAINER=	ports@MidnightBSD.org
9COMMENT=	GNU Flash movie player
10WWW=		https://www.gnu.org/software/gnash/
11
12LICENSE=	gpl3
13
14BUILD_DEPENDS=	${LOCALBASE}/ffmpeg4/lib/libavcodec.so.58:multimedia/ffmpeg4
15RUN_DEPENDS=	${LOCALBASE}/ffmpeg4/lib/libavcodec.so.58:multimedia/ffmpeg4
16LIB_DEPENDS=	libltdl.so:devel/libltdl \
17		libnspr4.so:devel/nspr \
18		libgif.so:graphics/giflib \
19		libpng.so:graphics/png \
20		libcurl.so:ftp/curl \
21		libspeex.so:audio/speex \
22		libspeexdsp.so:audio/speexdsp \
23		libboost_thread.so:devel/boost-libs \
24		libfreetype.so:print/freetype2 \
25		libfontconfig.so:x11-fonts/fontconfig \
26		libtheora.so:multimedia/libtheora \
27		libogg.so:audio/libogg \
28		libvorbis.so:audio/libvorbis \
29		libdca.so:multimedia/libdca \
30		libgsm.so:audio/gsm \
31		libdc1394.so:multimedia/libdc1394
32
33CONFLICTS=	gnash-devel-[0-9]*
34
35USES=		cpe tar:bzip2 compiler:c++11-lang autoreconf gmake libtool \
36		pkgconfig jpeg gnome gl sdl desktop-file-utils xorg localbase:ldflags
37CPE_VENDOR=	gnu
38USE_CSTD=	gnu11
39USE_CXXSTD=	c++11
40USE_XORG=	x11 xau xdmcp xext xi xinerama ice sm xv
41USE_GNOME=	atk gdkpixbuf gtk20 libxml2 pango
42USE_GL=		egl
43USE_SDL=	sdl
44GNU_CONFIGURE=	yes
45
46SYSCONFIGDIR=	${PREFIX}/etc
47
48# jemalloc leads to infinite recursion on BSD
49CFLAGS+=	-I${LOCALBASE}/ffmpeg4/include
50CPPFLAGS+=	-I${LOCALBASE}/ffmpeg4/include
51LDFLAGS+=	-L${LOCALBASE}/ffmpeg4/lib
52CONFIGURE_ARGS=	--with-boost-incl="${LOCALBASE}/include" \
53		--with-boost-lib="${LOCALBASE}/lib" \
54		--with-plugins-install=prefix \
55		--sysconfdir="${SYSCONFIGDIR}" \
56		--enable-gui=gtk \
57		--enable-media=ffmpeg \
58		--with-ffmpeg-incl="${LOCALBASE}/ffmpeg4/include/libavcodec" \
59		--with-ffmpeg-lib=${LOCALBASE}/ffmpeg4/lib \
60		--disable-testsuite \
61		--disable-kparts3 \
62		--disable-jemalloc \
63		--without-gconf
64GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
65#MAKE_ARGS+=	INCLUDES="-I${LOCALBASE}/include/ffmpeg"
66
67GNASHVER=	0.8.11dev
68CONFIG_FILES=	gnashpluginrc gnashrc
69
70WRKSRC=		${WRKDIR}/${DISTNAME}
71PLIST_SUB+=	GNASHVER="${GNASHVER}"
72
73USE_LDCONFIG=	${PREFIX}/lib/gnash
74
75OPTIONS_DEFINE=	CYGNAL VAAPI DOCS NLS
76OPTIONS_SINGLE=	MEDIA RENDERER
77OPTIONS_SINGLE_RENDERER=AGG OPENGL CAIRO
78OPTIONS_DEFAULT=AGG VAAPI
79
80NO_OPTIONS_SORT=yes
81OPTIONS_SUB=	yes
82CYGNAL_DESC=	Cygnal media server
83AGG_DESC=	AGG renderer
84OPENGL_DESC=	OpenGL renderer (experimental)
85CAIRO_DESC=	Cairo renderer
86VAAPI_DESC=	VAAPI support
87
88CYGNAL_CONFIGURE_ENABLE=	cygnal
89VAAPI_CPPFLAGS=	-I../libdevice/vaapi
90
91.include <bsd.mport.options.mk>
92
93# Cygnal option processing
94.if ${PORT_OPTIONS:MCYGNAL}
95CONFIG_FILES+=	cygnalrc
96.endif
97
98# NLS option processing (not sure if --disable-nls actually has any effect)
99.if ${PORT_OPTIONS:MNLS}
100USES+=		gettext
101PLIST_SUB+=	NLS=""
102.else
103CONFIGURE_ARGS+=	--disable-nls
104PLIST_SUB+=	NLS="@comment "
105.endif
106
107CONFIGURE_ARGS+=	--disable-npapi --disable-kparts4
108
109#
110# Renderer options processing
111#
112GNASH_RENDERERS=
113
114.if ${PORT_OPTIONS:MAGG}
115LIB_DEPENDS+=		libagg.so:graphics/agg
116GNASH_RENDERERS+=	agg
117.endif
118
119.if ${PORT_OPTIONS:MOPENGL}
120IGNORE=		support for OpenGL is currently broken, use option AGG
121GNASH_RENDERERS+=	ogl
122LIB_DEPENDS+=		libgdkglext-x11-1.0.so:x11-toolkits/gtkglext
123.endif
124
125.if ${PORT_OPTIONS:MCAIRO}
126LIB_DEPENDS+=		libcairo.so:graphics/cairo
127GNASH_RENDERERS+=	cairo
128.endif
129
130.if ${GNASH_RENDERERS} == ""
131IGNORE=			needs at least one renderer enabled. Please rerun 'make config' and enable AGG, OPENGL or CAIRO
132.endif
133
134CONFIGURE_ARGS+=	--enable-renderer=${GNASH_RENDERERS:S/^ //W:S/ /,/gW}
135
136#
137# Hardware acceleration options processing
138#
139.if ${PORT_OPTIONS:MVAAPI}
140LIB_DEPENDS+=		libva.so:multimedia/libva
141CONFIGURE_ARGS+=	--enable-device=egl,x11,vaapi
142.else
143CONFIGURE_ARGS+=	--enable-hwaccel=none # XVideo
144CONFIGURE_ARGS+=	--enable-device=egl,x11
145.endif
146
147.include <bsd.port.pre.mk>
148
149post-patch:
150	${REINPLACE_CMD} -e 's|lib64|lib|g' -e 's|lib32|lib|g' \
151		${WRKSRC}/macros/libslist
152	${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
153			-e 's|/usr/X11R6|${LOCALBASE}|g' \
154		${WRKSRC}/macros/incllist
155	${REINPLACE_CMD} -e 's|CODEC_ID_|AV_CODEC_ID_|' \
156		${WRKSRC}/libmedia/ffmpeg/VideoDecoderFfmpegVaapi.cpp
157
158post-install:
159	# eglinfo conflicts with mesa-demos
160	${MV} /${PREFIX}/bin/eglinfo /${PREFIX}/bin/eglinfo-gnash
161.for conf in ${CONFIG_FILES}
162	${MV} /${SYSCONFIGDIR}/${conf} ${SYSCONFIGDIR}/${conf}.dist
163.endfor
164
165.include <bsd.port.post.mk>
166