COMMENT =	command line interface for Nitrokey Devices

GH_ACCOUNT =	d-e-s-o
GH_PROJECT =	nitrocli
GH_TAGNAME =	v0.4.1
REVISION =	0

CATEGORIES =	security

MAINTAINER =	Ruben Llorente <porting@use.startmail.com>

# GPL-3.0-or-later
PERMIT_PACKAGE =	Yes

MODULES =	devel/cargo

WANTLIB += c++ c++abi c pthread hidapi-libusb m

LIB_DEPENDS =	comms/libhidapi

RUN_DEPENDS =	security/gnupg

COMPILER =	base-clang ports-gcc

CONFIGURE_STYLE =	cargo

MODCARGO_RUSTFLAGS =	-L ${LOCALBASE}/lib

.include "modules.inc"

MY_REPLACE_CMD =	sed -i s/hid_init/hidapi_hid_init/g
MY_HEADER =	/nitrokey-sys-*/libnitrokey-*/libnitrokey/hidapi/hidapi.h

post-patch:
	${MY_REPLACE_CMD} ${MODCARGO_VENDOR_DIR}${MY_HEADER}

post-install:
	mv ${PREFIX}/bin/shell-complete \
	${PREFIX}/bin/nitrocli-shell-complete

.include <bsd.port.mk>
