PORTNAME=	rl_json
DISTVERSIONPREFIX=	v
DISTVERSION=	0.17.6
CATEGORIES=	devel textproc tcl
MASTER_SITES=	https://github.com/RubyLane/${PORTNAME}/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/
PKGNAMEPREFIX=	tcl-

MAINTAINER=	you@example.org
COMMENT=	Tcl extension for efficient JSON parsing and manipulation
WWW=		https://github.com/RubyLane/rl_json

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

BUILD_DEPENDS=	${LOCALBASE}/bin/pandoc:textproc/hs-pandoc

USES=		gmake tcl:86+,tea

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:
	${MV} ${STAGEDIR}${PREFIX}/share/man/mann/json.n \
		${STAGEDIR}${PREFIX}/share/man/mann/${PORTNAME}.n
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}${PORTVERSION}/lib${TCL_PKG_LIB_PREFIX}${PORTNAME}${PORTVERSION}.so

.include <bsd.port.mk>
