# $OpenBSD$

COMMENT =	python 2/3 compatibility layer for C extensions

GH_ACCOUNT =	encukou
GH_PROJECT =	py3c
GH_TAGNAME =	v1.1

CATEGORIES =	devel

HOMEPAGE =	https://py3c.readthedocs.io/

MAINTAINER =	Stefan Sperling <stsp@openbsd.org>

# This is a header-only library.
WANTLIB =	

# MIT
PERMIT_PACKAGE =	Yes

CONFIGURE_STYLE =	none

# Upstream's default make target just prints a list of available targets.
# All we need upstream's Makefile to do is produce a pkg-config .pc file
# which we can ship in our package. The Makefile's "prefix" variable ends
# up in the generated .pc file. So use LOCALBASE instead of use PREFIX:
MAKE_FLAGS =		prefix=${LOCALBASE}
ALL_TARGET =		py3c.pc

USE_GMAKE =		Yes

# Upstream Makefile 'make install' doesn't respect DESTDIR.
# We replicate the entire install target here:
do-install:
	${INSTALL_DATA} ${WRKSRC}/include/py3c.h ${PREFIX}/include/py3c.h
	${INSTALL_DATA_DIR} ${PREFIX}/include/py3c
.for _f in capsulethunk comparison compat fileshim py3shims tpflags
	${INSTALL_DATA} ${WRKSRC}/include/py3c/${_f}.h ${PREFIX}/include/py3c/
.endfor
	${INSTALL_DATA} ${WRKSRC}/py3c.pc ${PREFIX}/share/pkgconfig/

.include <bsd.port.mk>
