aboutsummaryrefslogtreecommitdiffstats
path: root/math/ocaml-ocamlgraph/Makefile
blob: f49a94d2f891b8c66ab34b1062870662876e828a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
PORTNAME=	ocamlgraph
DISTVERSION=	2.1.0
CATEGORIES=	math
PKGNAMEPREFIX=	ocaml-

MAINTAINER=	freebsd@dev.thsi.be
COMMENT=	Graph manipulation library for OCaml
WWW=		https://github.com/backtracking/ocamlgraph

LICENSE=	LGPL21 # with a special exception to clause 6
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=			ocaml:dune
USE_GITHUB=		yes
GH_ACCOUNT=		backtracking
DUNE_INSTALL_TARGETS=	ocamlgraph

ALL_TARGET=	ocamlgraph.install
DOCSDIR=	${OCAML_DOCSDIR}/${PORTNAME}
PORTDOCS=	*

OPTIONS_DEFINE=	DOCS

.include <bsd.port.options.mk>

.if ${ARCH} == powerpc
USE_BINUTILS=	yes
.endif

post-patch:
	@${REINPLACE_CMD} \
		-e "s/(name ${PORTNAME})/&\n (version ${PORTVERSION})/" \
		${WRKSRC}/dune-project
	@${REINPLACE_CMD} -e 's/ stdlib-shims//' ${WRKSRC}/src/dune

post-install:
	@${STRIP_CMD} \
		${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/${PORTNAME}/graph.cmxs
	# USES=ocaml:ldconfig cleanup
	@${ECHO_CMD} @postexec ${SED} -i "''" -e \
		"'/^${PREFIX:S#/#\/#g}\/${OCAML_SITELIBDIR:S#/#\/#g}\/ocamlgraph$$/d'" \
		%D/${OCAML_LDCONF}  >> ${TMPPLIST}

.include <bsd.port.mk>