PORTNAME=	oyo
DISTVERSIONPREFIX=	v
DISTVERSION=	0.1.57
PORTREVISION=	0
CATEGORIES=	textproc

MAINTAINER=	nivit@FreeBSD.org
COMMENT=	Step-through diff viewer
WWW=		https://oyo.victorare.mu/

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE.md

LIB_DEPENDS=	libonig.so:devel/oniguruma

USES=		cargo
USE_GITHUB=	yes
GH_ACCOUNT=	ahkohd

CARGO_INSTALL_PATH=	crates/oyo

OPTIONS_DEFINE=	DOCS

post-patch-DOCS-on:
	${REINPLACE_CMD} -e 's|\.\./\(assets/\)|${DOCSDIR}/\1|g' \
		${WRKSRC}/docs/DIFF_PREVIEWS.md

post-install-DOCS-on:
	${MKDIR} ${STAGEDIR}${DOCSDIR}/assets
	(cd ${WRKSRC}/docs && \
	${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} "! -name *\.bak" && \
	${COPYTREE_SHARE} ../assets ${STAGEDIR}${DOCSDIR}/assets)

.include <bsd.port.mk>
