aboutsummaryrefslogtreecommitdiff
path: root/math/cgal/Makefile
blob: 9e9020b68541165d5b01da33987b85d6bfc51cb3 (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
# New ports collection makefile for:	cgal
# Date created:				10 Apr 2006
# Whom:					Jean-Yves Lefort <jylefort@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	cgal
PORTVERSION=	3.1
CATEGORIES=	math
MASTER_SITES=	ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/
DISTNAME=	CGAL-${PORTVERSION}
DISTFILES=	${DISTNAME}${EXTRACT_SUFX} ${DISTNAME}-doc_html${EXTRACT_SUFX}

MAINTAINER=	jylefort@FreeBSD.org
COMMENT=	A computational geometry library

BUILD_DEPENDS=	${LOCALBASE}/include/boost/tuple/tuple.hpp:${PORTSDIR}/devel/boost
RUN_DEPENDS=	${LOCALBASE}/include/boost/tuple/tuple.hpp:${PORTSDIR}/devel/boost

USE_LDCONFIG=	yes
SHLIB_VERSION=	0

HAS_CONFIGURE=		yes
CONFIGURE_SCRIPT=	install_cgal
CONFIGURE_ENV=		SHLIB_VERSION="${SHLIB_VERSION}"
CONFIGURE_ARGS=		-ni "${CXX}" --CUSTOM_CXXFLAGS "${CXXFLAGS} -I${LOCALBASE}/include"

PLIST=		${WRKDIR}/pkg-plist
PLIST_FILES=	lib/libCGAL.a lib/libCGAL.so lib/libCGAL.so.${SHLIB_VERSION}
PORTDOCS=	*

INVOKE=		cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS}

post-patch:
	@for d in ${WRKSRC}/include/CGAL ${WRKSRC}/examples ${WRKDIR}/doc_html/cgal_manual; do \
		${FIND} $$d -name '*.orig' -delete; \
	done

do-build:
.for t in lib sharedlib
	@cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} makefile_${t} ${MAKE_ARGS}
.endfor

pre-install:
	@${RM} -f ${PLIST}
	@${INVOKE} cgal-plist SRC=include/CGAL DST=include/CGAL
	@${INVOKE} cgal-plist SRC=examples DST=%%EXAMPLESDIR%%

do-install:
	${INSTALL_DATA} ${WRKSRC}/src/libCGAL.a ${PREFIX}/lib
	${INSTALL_PROGRAM} ${WRKSRC}/src/libCGAL.so.${SHLIB_VERSION} ${PREFIX}/lib
	${LN} -sf libCGAL.so.${SHLIB_VERSION} ${PREFIX}/lib/libCGAL.so
	@${INVOKE} cgal-install SRC=${WRKSRC}/include/CGAL DST=${PREFIX}/include/CGAL
	@${INVOKE} cgal-install SRC=${WRKSRC}/examples DST=${EXAMPLESDIR}
.if !defined(NOPORTDOCS)
	@${INVOKE} cgal-install SRC=${WRKDIR}/doc_html/cgal_manual DST=${DOCSDIR}
.endif

cgal-plist:
	@cd ${WRKSRC}/${SRC} && \
	${FIND} * -type f | ${SORT} \
		| ${SED} -e 's|^|${DST}/|' >> ${PLIST} && \
	${FIND} * -type d | ${SORT} -r \
		| ${SED} -e 's|^|@dirrm ${DST}/|' >> ${PLIST}
	@${ECHO_CMD} '@dirrm ${DST}' >> ${PLIST}

cgal-install:
	cd ${SRC} && \
	${FIND} * -type d -exec ${MKDIR} "${DST}/{}" \; && \
	${FIND} * -type f -exec ${INSTALL_DATA} "{}" "${DST}/{}" \;

.include <bsd.port.mk>