PORTNAME=	tclcurl
DISTVERSIONPREFIX=	v
DISTVERSION=	7.22.0
CATEGORIES=	devel textproc tcl

MAINTAINER=	you@example.org
COMMENT=	Tcl extension for curl library
WWW=		https://github.com/flightawere/tclcurl-fa

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

USES=		tcl:86+,tea

PLIST_SUB=      PORTVERSION=${PORTVERSION}

GH_ACCOUNT=	flightaware
GH_PROJECT=	tclcurl-fa
# TODO: set to the real tag or commit hash (e.g. v2.5.1)
GH_TAGNAME=	v7.22.1

USE_GITHUB=	yes

CPPFLAGS+= -DCONST=const
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/TclCurl${PORTVERSION}/libTclCurl${PORTVERSION}.so

.include <bsd.port.mk>
