aboutsummaryrefslogtreecommitdiff
path: root/math/plplot/Makefile
blob: fcf4f066b86bd508dcee156c413df69a1aba257a (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# New ports collection makefile for:    plplot
# Date created:         03 Oct 1997
# Whom:                 Thomas Gellekum <tg@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	plplot
PORTVERSION=	5.9.7
PORTREVISION=	1
CATEGORIES=	math science
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}%20Source

MAINTAINER=	ports@FreeBSD.org
COMMENT=	A scientific plotting package

BUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash	\
		${LOCALBASE}/lib/X11/fonts/freefont-ttf/FreeMono.ttf:${PORTSDIR}/x11-fonts/freefont-ttf
LIB_DEPENDS=	unicode.0:${PORTSDIR}/devel/libunicode \
		freetype.9:${PORTSDIR}/print/freetype2 \
		gd.4:${PORTSDIR}/graphics/gd \
		qhull.5:${PORTSDIR}/math/qhull5
RUN_DEPENDS=	bash:${PORTSDIR}/shells/bash	\
		${LOCALBASE}/lib/X11/fonts/freefont-ttf/FreeMono.ttf:${PORTSDIR}/x11-fonts/freefont-ttf

USE_AUTOTOOLS=	libltdl
USE_CMAKE=	yes
USE_PERL5_BUILD=yes
USE_GNOME=	pango
USE_GHOSTSCRIPT=yes
CONFIGURE_ENV+=	WITH_FREETYPE=ON
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
CMAKE_ARGS+=	-DENABLE_java:BOOL=OFF -DENABLE_octave:BOOL=OFF	\
		-DENABLE_ada:BOOL=OFF -DENABLE_d:BOOL=OFF	\
		-DPLD_plmeta=ON

USE_LDCONFIG=	yes

MAN1=		plm2gif.1 plpr.1 pltek.1 plrender.1

.if !defined(WITHOUT_PTHREAD)
CMAKE_ARGS+=	-DTHREADS_HAVE_PTHREAD_ARG:BOOL=OFF
.endif

.if defined(WITHOUT_X11)
PKGNAMESUFFIX=	-nox11
PLIST_SUB+=	X11="@comment "
.else
USE_XORG=	x11
LIB_DEPENDS+=	LASi.0:${PORTSDIR}/devel/lasi
PLIST_SUB+=	X11=""
.endif

.if defined(WITH_FORTRAN)
PKGNAMESUFFIX=	-fortran
USE_FORTRAN=	yes
CONFIGURE_ENV+=	CMAKE_Fortran_COMPILER=${FC}
PLIST_SUB+=	FORTRAN=""
.else
CMAKE_ARGS+=	-DENABLE_f95:BOOL=OFF -DENABLE_f77:BOOL=OFF
PLIST_SUB+=	FORTRAN="@comment "
.endif

.if defined(WITH_PYTHON)
BUILD_DEPENDS+=	swig:${PORTSDIR}/devel/swig13	\
		f2py:${PORTSDIR}/math/py-numpy
RUN_DEPENDS+=	f2py:${PORTSDIR}/math/py-numpy
USE_PYTHON=	yes
PLIST_SUB+=	PYTHON=""
CONFIGURE_ENV+=	PYTHON_VERSION="${PYTHON_VERSION}"
.else
CMAKE_ARGS+=	-DENABLE_python:BOOL=OFF
PLIST_SUB+=	PYTHON="@comment "
.endif

.if defined(WITH_TCLTK)
.undef WITHOUT_X11
PKGNAMESUFFIX=	-tcltk
LIB_DEPENDS+=	itk.3:${PORTSDIR}/x11-toolkits/itk
USE_TK=		84
ITCL_VER=	3.3
CONFIGURE_ENV+=	ENABLE_tcl=TRUE ENABLE_tk=TRUE		\
		ENABLE_itcl=TRUE ENABLE_itk=TRUE
MAN1+=		plserver.1 pltcl.1
PLIST_SUB+=	TCLTK=""
.else
CMAKE_ARGS+=	-DENABLE_tk:BOOL=OFF
PLIST_SUB+=	TCLTK="@comment "
.endif

.if defined(WITH_QT)
.undef WITHOUT_X11
PKGNAMESUFFIX=	-qt
USE_QT_VER=	4
QT_COMPONENTS=	assistant assistantclient clucene corelib dbus	\
		designer doc gui help help-tools linguist moc	\
		network opengl phonon qmake qt3support qtestlib	\
		rcc script scripttools sql svg uic uic3 webkit	\
		xml xmlpatterns
PLIST_SUB+=	QT=""
.else
CMAKE_ARGS+=	-DENABLE_qt:BOOL=OFF -DDEFAULT_NO_QT_DEVICES:BOOL=ON
PLIST_SUB+=	QT="@comment "
.endif

.include <bsd.port.pre.mk>

pre-everything::
	@${ECHO_MSG} ""
	@${ECHO_MSG} "PLplot has the following tunable options:"
	@${ECHO_MSG} ""
	@${ECHO_MSG} "	WITHOUT_PTHREAD=yes	Turns off pthread support"
	@${ECHO_MSG} "	WITHOUT_X11=yes		Turns off X11 support"
	@${ECHO_MSG} "	WITH_FORTRAN=yes	Turns on Fortran support"
	@${ECHO_MSG} "	WITH_PYTHON=yes		Turns on Python support"
	@${ECHO_MSG} "	WITH_QT=yes		Turns on Qt4 support"
	@${ECHO_MSG} "	WITH_TCLTK=yes		Turns on Tcl/Tk support"
	@${ECHO_MSG} ""

pre-configure:
	${REINPLACE_CMD} -e 's|/usr/share/fonts/truetype/freefont|${LOCALBASE}/lib/X11/fonts/freefont-ttf|'\
		${WRKSRC}/cmake/modules/freetype.cmake
.if defined(WITHOUT_X11)
	${REINPLACE_CMD} -e 's|^find_package(X11)|SET(X11_FOUND "FALSE")|' \
		${WRKSRC}/cmake/modules/plplot.cmake
.endif
.if defined(WITH_TCLTK)
	${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|; \
		s|/usr/include|${LOCALBASE}/include|'		\
		${WRKSRC}/cmake/modules/FindTCL.cmake
	${REINPLACE_CMD} -e 's|%%ITCL_VER%%|${ITCL_VER}|'	\
		${WRKSRC}/cmake/modules/tcl-related.cmake
# To be removed when x11-toolkits/itk will be compatible with tk-8.5
. for fc in TCL Tclsh
	${REINPLACE_CMD} -e 's|8.5||g;s|85||g'	\
		${WRKSRC}/cmake/modules/Find${fc}.cmake
. endfor
.endif

.include <bsd.port.post.mk>