summaryrefslogtreecommitdiff
path: root/math/coq/Makefile
blob: 31de7f54df6f453d3f3ba8e6aab9e603f56f9135 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
PORTNAME=	coq
PORTVERSION=	8.19
PORTREVISION=	4
PORTEPOCH=	3
CATEGORIES=	math
DISTVERSIONPREFIX=	V
DISTVERSIONSUFFIX=	.0
PKGNAMESUFFIX=	${EMACS_PKGNAMESUFFIX}

MAINTAINER=	hrs@FreeBSD.org
COMMENT=	Theorem prover based on lambda-C
WWW=		https://coq.inria.fr/

LICENSE=	LGPL21
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	${SA_DIR}/num/META:math/ocaml-num \
		${SA_DIR}/zarith/META:math/ocaml-zarith \
		bash:shells/bash \
		camlp5:devel/ocaml-camlp5
LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
		libfreetype.so:print/freetype2 \
		libgmp.so:math/gmp \
		libharfbuzz.so:print/harfbuzz
RUN_DEPENDS=	${SA_DIR}/num/META:math/ocaml-num \
		${SA_DIR}/zarith/META:math/ocaml-zarith

USES=		emacs gettext-runtime gmake gnome ocaml:dune python:env shebangfix tex
SHEBANG_FILES=	tools/*.py
USE_GITHUB=	yes
USE_GNOME=	cairo gdkpixbuf2 gtk30 gtksourceview3
USE_LDCONFIG=	${PREFIX}/lib/coq
USE_OCAML=	yes
USE_OCAML_CAMLP4=	yes
USE_OCAML_LDCONFIG=	yes
OCAML_LDLIBS=		${OCAML_SITELIBDIR}/coq-core
OCAML_PACKAGES=		coq-core coq-stdlib coq

HAS_CONFIGURE=	yes
CONFIGURE_ARGS=	-prefix ${PREFIX} \
		-mandir ${PREFIX}/share/man \
		-docdir ${OCAML_DOCSDIR} \
		-bytecode-compiler yes \
		-native-compiler yes

CONFLICTS_INSTALL=	coq coq-emacs_* # bin/coq-tex bin/coq_makefile bin/coqc bin/coqchk bin/coqdep bin/coqdoc bin/coqide bin/coqmktop bin/coqtop bin/coqtop.byte bin/coqwc bin/coqworkmgr bin/gallina

OPTIONS_DEFINE=		DOCS IDE
OPTIONS_DEFAULT=	IDE
OPTIONS_SUB=		yes
IDE_DESC=		Include desktop environment (coqide)
IDE_BUILD_DEPENDS=	${SA_DIR}/lablgtk3/META:x11-toolkits/ocaml-lablgtk3
IDE_RUN_DEPENDS=	${SA_DIR}/lablgtk3/META:x11-toolkits/ocaml-lablgtk3
IDE_VARS=		ocaml_packages+=coqide-server ocaml_packages+=coqide
# IDE_CONFIGURE_OFF=	-coqide no
# XXX needs fixing
# DOCS_USES=		tex python:env
# DOCS_USE=		TEX=latex:build,dvipsk:build
# DOCS_BUILD_DEPENDS=	hevea:textproc/hevea \
# 			sphinx-build:textproc/py-sphinx \
# 			${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme@${PY_FLAVOR} \
# 			${PYTHON_PKGNAMEPREFIX}sphinxcontrib-bibtex>0:textproc/py-sphinxcontrib-bibtex@${PY_FLAVOR}
# DOCS_VARS=		ocaml_packages+=coq-doc
#DOCS_CONFIGURE_OFF=	-with-doc no

SA_DIR=		${LOCALBASE}/${OCAML_SITELIBDIR}

pre-build:
	@${MAKE_CMD} -C ${WRKSRC} dunestrap

# XXX to keep dune-install happy, until DOCS build gets fixed
post-build:
	@${TOUCH} ${WRKSRC}/${DUNE_BUILD_DIR}/default/coq-doc.install

post-install:
	@(cd ${STAGEDIR}${PREFIX} ; \
		${FIND} ${OCAML_SITELIBDIR} -type f '(' -name '*.cmxs' -o -name '*_stubs.so' ')' ; \
		${FIND} bin -type f -not -name '*.byte' ; \
	) | while read f; \
		do \
			${STRIP_CMD} ${STAGEDIR}${PREFIX}/$$f ; \
		done

post-install-IDE-on:
	@${MKDIR} -p ${STAGEDIR}${PREFIX}/etc/xdg/coq

.include <bsd.port.mk>