summaryrefslogtreecommitdiff
path: root/cad/py-ocp/Makefile
blob: 4236a23050853808d40d1a5cc1db11e208223422 (plain)
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

PORTNAME=	ocp
DISTVERSION=	7.4-RC2
PORTREVISION=	1
CATEGORIES=	cad
# Direct access to github is needed because the release added an extra archive which
# we need to build from, rather than the initial release.
MASTER_SITES=	https://github.com/CadQuery/OCP/releases/download/${DISTVERSION}/
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
DISTNAME=	OCP_src_Linux

MAINTAINER=	ports@nicandneal.net
COMMENT=	Python wrapper for OCCT generated using pywrap

LICENSE=	APACHE20

PATCH_DEPENDS=	${LOCALBASE}/include/OpenCASCADE/OpenGl_HaltonSampler.hxx:cad/opencascade
LIB_DEPENDS=	libTKernel.so:cad/opencascade
BUILD_DEPENDS=	${LOCALBASE}/share/cmake/pybind11/pybind11Config.cmake:devel/pybind11 \
		${PYTHON_SITELIBDIR}/pybind11:devel/py-pybind11@${PY_FLAVOR}

USES=		cmake compiler:c++11-lang gl python:3.6+ zip
USE_GL=		gl glu glut

WRKSRC=		${WRKDIR}/OCP_src_Ubuntu-16.04

OCCT=		${LOCALBASE}/include/OpenCASCADE
OCCT_LOCAL=	${WRKSRC}/OCCT

CMAKE_ARGS=	-DOPENCASCADE_INCLUDE_DIR=${OCCT} \
		-DPYTHON_EXECUTABLE=${PYTHON_CMD}

USE_PYTHON=	flavors

PLIST_FILES=	${PYTHON_SITELIBDIR}/OCP.so

pre-patch:
# Copy and patch a header file with a troublesome C++ standard mismatch.
	${MKDIR} ${OCCT_LOCAL}
	${CP} ${OCCT}/OpenGl_HaltonSampler.hxx ${OCCT_LOCAL}

do-install:
	@${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/
	${INSTALL_LIB} ${BUILD_WRKSRC}/OCP.so ${STAGEDIR}${PYTHON_SITELIBDIR}

.include <bsd.port.mk>