# Created by: Hendrik Scholz <hendrik@scholz.net>
# $FreeBSD$
#   $MCom: ports/multimedia/totem/Makefile,v 1.151 2010/09/27 19:04:37 kwm Exp $

PORTNAME=	totem
PORTVERSION=	2.32.0
PORTREVISION?=	2
CATEGORIES=	multimedia gnome
MASTER_SITES=	GNOME
DIST_SUBDIR=	gnome2

MAINTAINER?=	gnome@FreeBSD.org
COMMENT?=	Gstreamer-based video player for the GNOME 2 Desktop

BUILD_DEPENDS=	${LOCALBASE}/libdata/pkgconfig/iso-codes.pc:${PORTSDIR}/misc/iso-codes
LIB_DEPENDS=	gdata.7:${PORTSDIR}/devel/libgdata \
		unique-1.0.2:${PORTSDIR}/x11-toolkits/unique \
		totem-plparser.17:${PORTSDIR}/multimedia/totem-pl-parser
RUN_DEPENDS=	${LOCALBASE}/libdata/pkgconfig/iso-codes.pc:${PORTSDIR}/misc/iso-codes \
		${LOCALBASE}/libexec/gnome-settings-daemon:${PORTSDIR}/sysutils/gnome-settings-daemon \
		${PYTHON_SITELIBDIR}/atom/__init__.py:${PORTSDIR}/devel/py-gdata

CONFLICTS=	totem-3.[0-9]*

USE_PYTHON=	yes
USE_BZIP2=	yes
USES=		pathfix gettext desktop-file-utils pkgconfig
USE_GNOME=	gnomeprefix intlhack nautilus2 \
		ltverhack pygtk2 gnomehier
USE_GSTREAMER=	core gconf hal good mpeg2dec soup ugly python gio
INSTALLS_ICONS=	yes
USE_GMAKE=	yes
USE_AUTOTOOLS=	libtool
USE_LDCONFIG=	yes
INSTALLS_OMF=	yes
PKGMESSAGE=	${WRKDIR}/pkg-message
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
CONFIGURE_ENV=	LIBS="-lXrandr" \
		BROWSER_PLUGIN_DIR="${WEBPLUGINS_DIR}"
CONFIGURE_ARGS=	--with-plugins="${TOTEM_PLUGINS}"

MAN1=		totem.1 totem-video-thumbnailer.1
GCONF_SCHEMAS=	totem-handlers.schemas totem-video-thumbnail.schemas \
		totem.schemas

OPTIONS_DEFINE=	LIRC GALAGO BROWSER_PLUGINS PUBLISH TRACKER
GALAGO_DESC=	Galago support
BROWSER_PLUGINS_DESC=	Plugins for gecko browser
PUBLISH_DESC=	Publish (network playlist) plugin
TRACKER_DESC=	Tracker local search plugin

OPTIONS_DEFAULT=	BROWSER_PLUGINS
# check configure script for allowed_plugins="..." for new plugins
TOTEM_PLUGINS=	thumbnail screensaver ontop gromit media-player-keys \
		properties skipto youtube opensubtitles screenshot \
		brasero-disc-recorder coherence_upnp dbus-service iplayer

NO_STAGE=	yes
# Not using:
# TOTEM_PLUGINS= mythtv bemused jamendo

.include <bsd.port.options.mk>
.include <bsd.port.pre.mk>

.if defined(WITH_PUBLISH)
LIB_DEPENDS+=	epc-1.0.2:${PORTSDIR}/www/libepc
PLIST_SUB+=	PUBLISH=""
TOTEM_PLUGINS:=	${TOTEM_PLUGINS} publish
.else
PLIST_SUB+=	PUBLISH="@comment "
.endif

#.if defined(WITH_TRACKER)
#LIB_DEPENDS+=	tracker-gtk.0:${PORTSDIR}/sysutils/tracker-libtrackergtk
#TOTEM_PLUGINS:=	${TOTEM_PLUGINS} tracker
#PLIST_SUB+=	TRACKER=""
#.else
PLIST_SUB+=	TRACKER="@comment "
#.endif

.if ${PORT_OPTIONS:MLIRC}
LIB_DEPENDS+=	lirc_client.2:${PORTSDIR}/comms/lirc
PLIST_SUB+=	LIRC=""
TOTEM_PLUGINS:=	${TOTEM_PLUGINS} lirc
.else
PLIST_SUB+=	LIRC="@comment "
.endif

.if ${PORT_OPTIONS:MGALAGO}
LIB_DEPENDS+=	galago.3:${PORTSDIR}/devel/libgalago
PLIST_SUB+=	GALAGO=""
TOTEM_PLUGINS:=	${TOTEM_PLUGINS} galago
.else
PLIST_SUB+=	GALAGO="@comment "
.endif

.if ${PORT_OPTIONS:MBROWSER_PLUGINS}
CONFIGURE_ARGS+=--enable-browser-plugins \
		--enable-gmp-plugin \
		--enable-narrowspace-plugin
PLIST_SUB+=	BROWSER_PLUGINS=""

USE_WEBPLUGINS=		gecko19 webkit-gtk2
WEBPLUGINS_FILES=	libtotem-cone-plugin.so libtotem-gmp-plugin.so \
			libtotem-mully-plugin.so \
			libtotem-narrowspace-plugin.so
.include "${PORTSDIR}/www/firefox/Makefile.webplugins"
.else
CONFIGURE_ARGS+=--disable-browser-plugins \
		--disable-basic-plugin \
		--disable-gmp-plugin \
		--disable-narrowspace-plugin
PLIST_SUB+=	BROWSER_PLUGINS="@comment "
.endif

.if defined(WITH_DVD_DEVICE)
DEFAULT_DVD_DEVICE=${WITH_DVD_DEVICE}
.else
DEFAULT_DVD_DEVICE=/dev/acd0
.endif

pre-everything::
	@${ECHO_MSG} "===> The default DVD device is ${DEFAULT_DVD_DEVICE}"
	@${ECHO_MSG} "===> Define WITH_DVD_DEVICE if you want to change the default"
	@${ECHO_MSG} "===> For example, 'make WITH_DVD_DEVICE=\"/dev/somedevice\"'"

post-patch:
	@${CP} -f ${FILESDIR}/pkg-message.in ${PKGMESSAGE}
	@${REINPLACE_CMD} -e 's|/dev/dvd|${DEFAULT_DVD_DEVICE}|' \
		${WRKSRC}/src/backend/bacon-video-widget-gst-0.10.c

post-install:
	${MKDIR} ${PREFIX}/share/vala/vapi
	${INSTALL_DATA} ${WRKSRC}/bindings/vala/totem.vapi ${PREFIX}/share/vala/vapi
	${INSTALL_DATA} ${WRKSRC}/bindings/vala/totem.deps ${PREFIX}/share/vala/vapi
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>
'gnome-3.32'>gnome-3.32</option>
<option value='gnome-3.36'>gnome-3.36</option>
<option value='gstreamer'>gstreamer</option>
<option value='gstreamer-1.16'>gstreamer-1.16</option>
<option value='gstreamer0.10-removal'>gstreamer0.10-removal</option>
<option value='main'>main</option>
<option value='master'>master</option>
<option value='mate-1.16' selected='selected'>mate-1.16</option>
<option value='mate-1.18'>mate-1.18</option>
<option value='mate-1.20'>mate-1.20</option>
<option value='mate-1.22'>mate-1.22</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/about/?h=mate-1.16'>about</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/?h=mate-1.16'>summary</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/refs/?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325'>refs</a><a class='active' href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/net/dbeacon?h=mate-1.16'>log</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/tree/net/dbeacon?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325'>tree</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/net/dbeacon?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325'>commit</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/diff/net/dbeacon?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325'>diff</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/stats/net/dbeacon?h=mate-1.16'>stats</a></td><td class='form'><form class='right' method='get' action='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/net/dbeacon'>
<input type='hidden' name='h' value='mate-1.16'/><input type='hidden' name='id' value='5c9bf1b6168b52b5002be77e2f5846157fc23325'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/net?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325'>net</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/net/dbeacon?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325'>dbeacon</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/net/dbeacon?h=mate-1.16&amp;id=5c9bf1b6168b52b5002be77e2f5846157fc23325&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/net/dbeacon?h=mate-1.16&amp;id=b4e99b4b8cc5c4f960204eb19d0eac39f0e1474a'>net/dbeacon: Unbreak port</a></td><td>feld</td><td><span title='2016-03-18 05:04:58 +0800'>2016-03-18</span></td><td>3</td><td><span class='deletions'>-9</span>/<span class='insertions'>+41</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/net/dbeacon?h=mate-1.16&amp;id=f5c820f44ef3ac0da915aa0f52b5b54fddedf017'>Convert LICENSE= "GPLxx # or later" to "GPLxx+"</a></td><td>amdmi3</td><td><span title='2016-01-13 00:20:31 +0800'>2016-01-13</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/net/dbeacon?h=mate-1.16&amp;id=22f7514ac919166ba72b426b3e50500eb7045feb'>Mark a few ports BROKEN: unfetchable</a></td><td>antoine</td><td><span title='2015-11-09 20:59:03 +0800'>2015-11-09</span>