PORTNAME=	aqualung
DISTVERSION=	1.2
PORTREVISION=	4
CATEGORIES=	audio

MAINTAINER=	portmaster@BSDforge.com
COMMENT=	Music player with rich features
WWW=		https://aqualung.jeremyevans.net/

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

LIB_DEPENDS=	libFLAC.so:audio/flac \
		libmp3lame.so:audio/lame \
		libmad.so:audio/libmad \
		libmodplug.so:audio/libmodplug \
		libogg.so:audio/libogg \
		liboggz.so:audio/liboggz \
		libsamplerate.so:audio/libsamplerate \
		libsndfile.so:audio/libsndfile \
		libvorbis.so:audio/libvorbis \
		libmac.so:audio/mac \
		libspeex.so:audio/speex \
		libwavpack.so:audio/wavpack \
		libavcodec.so:multimedia/ffmpeg \
		libfreetype.so:print/freetype2 \
		libharfbuzz.so:print/harfbuzz \
		libcdio.so:sysutils/libcdio \
		libcdio_paranoia.so:sysutils/libcdio-paranoia \
		liblrdf.so:textproc/liblrdf \
		libfontconfig.so:x11-fonts/fontconfig

USES=		autoreconf compiler:c++11-lang cpe gettext gnome localbase lua:52 pkgconfig
USE_GNOME=	cairo gdkpixbuf2 gtk20 libxml2 libxslt

USE_GITHUB=	yes
GH_ACCOUNT=	jeremyevans

GNU_CONFIGURE=	yes

CONFIGURE_ARGS=	--with-cddb=no \
		--with-ifp=no \
		--with-mpc=no

DESKTOP_ENTRIES="Aqualung" "" "${DATADIR}/general.png" "aqualung" \
		"Audio;AudioVideo;GTK;" ""

OPTIONS_DEFINE=		ALSA DOCS JACK PULSEAUDIO SNDIO

ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
ALSA_CONFIGURE_ON=	--with-alsa=yes
ALSA_CONFIGURE_OFF=	--with-alsa=no
JACK_LIB_DEPENDS=	libjack.so:audio/jack
JACK_CONFIGURE_ON=	--with-jack=yes
JACK_CONFIGURE_OFF=	--with-jack=no
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
PULSEAUDIO_CONFIGURE_ON=	--with-pulse=yes
PULSEAUDIO_CONFIGURE_OFF=	--with-pulse=no
SNDIO_LIB_DEPENDS=	libsndio.so:audio/sndio
SNDIO_CONFIGURE_ON=	--with-sndio=yes
SNDIO_CONFIGURE_OFF=	--with-sndio=no

post-patch:
# Remove unused duplicate global symbols (-fno-common)
	@${REINPLACE_CMD} -E '/^g?char command/d' \
		${WRKSRC}/src/gui_main.c

.include <bsd.port.mk>
