COMMENT =	metadata extraction library
DISTNAME =	libextractor-1.13

CATEGORIES =	devel
HOMEPAGE =	https://www.gnu.org/software/libextractor/
MAINTAINER =	Stepan Zolotuev <poopenfarten@dismail.de>

SHARED_LIBS +=	extractor                 0.0 # 4.8
SHARED_LIBS +=	extractor_common          0.0 # 1.0

SITES = ${SITE_GNU:=libextractor/}

# GPLv3 or later
PERMIT_PACKAGE = Yes
DPB_PROPERTIES = parallel

WANTLIB += FLAC INIReader Lerc archive b2 brotlicommon brotlidec bz2 c c++
WANTLIB += c++abi crypto execinfo exiv2 expat ffi gdk_pixbuf-2.0 gif gio-2.0
WANTLIB += glib-2.0 gmodule-2.0 gobject-2.0 gsf-1 gstapp-1.0 gstaudio-1.0
WANTLIB += gstbase-1.0 gstpbutils-1.0 gstreamer-1.0 gsttag-1.0 gstvideo-1.0
WANTLIB += iconv inih intl jpeg ltdl lz4 lzma m magic mpeg2 ogg orc-0.4
WANTLIB += pcre2-8 png pthread tidy tiff vorbis vorbisfile xml2 z zstd

COMPILER = base-clang ports-gcc base-gcc

BUILD_DEPENDS += devel/gettext,-tools\
		 devel/libtool

RUN_DEPENDS += devel/gettext,-runtime

# Libextractor actually supports more:
# 	libmp4v2 is currently broken upstream
# 	libsmf and librpm are not in ports
LIB_DEPENDS += archivers/bzip2\
	       archivers/libarchive\
	       audio/flac\
	       audio/libogg\
	       audio/libvorbis\
	       converters/libiconv\
	       devel/glib2\
	       devel/libgsf\
	       devel/libmagic\
	       devel/libtool,-ltdl\
	       graphics/exiv2\
	       graphics/gdk-pixbuf2\
	       graphics/giflib\
	       graphics/jpeg\
	       graphics/libmpeg2\
	       graphics/tiff\
	       multimedia/gstreamer1/plugins-base\
	       www/tidy

CONFIGURE_STYLE = gnu
# Most libs aren't picked up without this
CONFIGURE_ENV += LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS += --with-ltdl=${LOCALBASE}\
		  --with-gstreamer

TEST_TARGET = check

.include <bsd.port.mk>
