summaryrefslogtreecommitdiff
path: root/math/ocamlgsl/Makefile
blob: 75f259b9888383299212a9a9e4bc5e15c20935ae (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
45
46
47
48
49
50
51
52
53
54
PORTNAME=	ocaml-gsl
DISTVERSION=	1.25.1
CATEGORIES=	math

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Interface to GSL for the Objective Caml language
WWW=		https://mmottl.github.io/gsl-ocaml

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

NOT_FOR_ARCHS=		armv6
NOT_FOR_ARCHS_REASON=	architectures with double-word alignment for doubles are not supported

BUILD_DEPENDS=		ocaml-base>=0:devel/ocaml-base \
			ocaml-stdio>=0:devel/ocaml-stdio
LIB_DEPENDS=		libgsl.so:math/gsl

USES=			blaslapack:openblas ocaml:dune,ldconfig pkgconfig
OCAML_LDLIBS=		gsl
OCAML_PACKAGES=		gsl

USE_GITHUB=	yes
GH_ACCOUNT=	mmottl
GH_PROJECT=	gsl-ocaml

MAKE_ENV=	GSL_CBLAS_LIB="${BLASLIB}"
DOCSDIR=	${OCAML_DOCSDIR}/gsl
EXAMPLESDIR=	${OCAML_EXAMPLESDIR}/gsl

PORTDOCS=	CHANGES.md LICENSE.md README.md
PORTEXAMPLES=	*

OPTIONS_DEFINE=	DOCS EXAMPLES

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

post-install:
	@${STRIP_CMD} \
		${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/gsl/dllgsl_stubs.so \
		${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/gsl/gsl.cmxs
# cleanup from previous OCAML_LDLIBS
	@${ECHO_CMD} @postexec ${SED} -i "''" -e \
		"'/^${PREFIX:S#/#\/#g}\/${OCAML_SITELIBDIR:S#/#\/#g}\/ocaml-gsl$$/d'" \
		%D/${OCAML_LDCONF}  >> ${TMPPLIST}

post-install-EXAMPLES-on:
	(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . \
		${STAGEDIR}${EXAMPLESDIR})

.include <bsd.port.mk>