PORTNAME=	tclcsv
DISTVERSIONPREFIX=	v
DISTVERSION=	2.4.3
CATEGORIES=	devel textproc tcl

MAINTAINER=	you@example.org
COMMENT=	Tcl extension for efficient CSV parsing
#WWW=		https://github.com/apnadkarni/tcl-csv

LICENSE=	TCL
LICENSE_NAME=	Tcl/Tk License
LICENSE_FILE=	${WRKSRC}/LICENSE
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

USES=		tcl:86+,tea compiler:c++11-lang

USE_GITHUB=	yes
GH_ACCOUNT=	apnadkarni
GH_PROJECT=	tcl-csv
# TODO: set to the real tag or commit hash (e.g. v2.5.1)
GH_TAGNAME=	v2.4.3

PLIST_SUB=      TCL_PKG_LIB_PREFIX=${TCL_PKG_LIB_PREFIX}
PLIST_SUB+=	PORTVERSION=${PORTVERSION}

GNU_CONFIGURE=	yes
CONFIGURE_ARGS+=--with-tcl=${TCL_LIBDIR} --with-tclinclude=${TCL_INCLUDEDIR}

# The release tarball ships a pre-generated configure script and a
# pre-built man page, so neither autoconf nor pandoc is needed.
# Upstream installs the man page as json.n, which collides with the
# tcllib json page; install it under the name upstream's meson build
# uses.
post-install:
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}${PORTVERSION}/lib${TCL_PKG_LIB_PREFIX}${PORTNAME}${PORTVERSION}.so

.include <bsd.port.mk>
