ports/math/py-matplotlib/Makefile
Ruslan Makhmatkhanov 965bb4f692 Change USE_PYTHON to yes. Since version 1.2.0 matplotlib adding python3 support.
But please note that it still can't be built from ports with python3 without user
intervention, because a) it depends on pygtk2 by default and b) we have no
suitable py-dateutil version that works with python3.

Requested by:	demon (at developers@)
2013-01-11 20:05:48 +00:00

115 lines
2.9 KiB
Makefile

# Created by: ijliao
# $FreeBSD$
PORTNAME= matplotlib
PORTVERSION= 1.2.0
CATEGORIES= math python
MASTER_SITES= http://cloud.github.com/downloads/matplotlib/matplotlib/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= mainland@apeiron.net
COMMENT= Plotting library uses a syntax familiar to MATLAB users
BUILD_DEPENDS= ${PYNUMPY} \
${PYTHON_PKGNAMEPREFIX}dateutil>=1.4:${PORTSDIR}/devel/py-dateutil \
${PYTHON_PKGNAMEPREFIX}pytz>=0:${PORTSDIR}/devel/py-pytz
LIB_DEPENDS= freetype:${PORTSDIR}/print/freetype2 \
png15:${PORTSDIR}/graphics/png
RUN_DEPENDS:= ${BUILD_DEPENDS}
USE_PYTHON= yes
USE_PYDISTUTILS=yes
CFLAGS+= -I${LOCALBASE}/include
OPTIONS= GTKBACKEND "GTK backend support" ON \
GTKAGGBACKEND "GTKAgg backend support" ON \
TKAGGBACKEND "TKAgg backend support" ON \
WXAGGBACKEND "WXAgg backend support" OFF
UNIQUENAME= ${PORTNAME}
.include <bsd.port.options.mk>
.if defined(PACKAGE_BUILDING) && \
(defined(WITH_GTKBACKEND) || defined(WITH_GTKAGGBACKEND) || \
defined(WITH_TKAGGBACKEND) || defined(WITH_WXAGGBACKEND))
BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT}
.endif
.if defined(WITH_GTKBACKEND) || defined(WITH_GTKAGGBACKEND)
USE_GNOME= gtk20 pygtk2
.endif
.if defined(WITH_GTKBACKEND) && !defined(WITHOUT_GTKBACKEND)
GTK_BACKEND= True
PLIST_SUB+= GTKBACKEND=""
.else
GTK_BACKEND= False
PLIST_SUB+= GTKBACKEND="@comment "
.endif
.if defined(WITH_GTKAGGBACKEND)
GTKAGG_BACKEND= True
PLIST_SUB+= GTKAGGBACKEND=""
.else
GTKAGG_BACKEND= False
PLIST_SUB+= GTKAGGBACKEND="@comment "
.endif
.if defined(WITH_TKAGGBACKEND)
BUILD_DEPENDS+= ${PYTHON_SITELIBDIR}/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
USE_TCL_RUN= yes
USE_TK_RUN= yes
TKAGG_BACKEND= True
PLIST_SUB+= TKAGGBACKEND=""
.else
TKAGG_BACKEND= False
PLIST_SUB+= TKAGGBACKEND="@comment "
.endif
.if defined(WITH_WXAGGBACKEND)
USE_WX= 2.8+
WX_COMPS= python:lib
CONFIGURE_ENV+= WX_CONFIG="${WX_CONFIG}"
WXAGG_BACKEND= True
.else
WXAGG_BACKEND= False
.endif
EXAMPLESDIR= ${PREFIX}/share/examples/py-${PORTNAME}
post-extract:
${CHMOD} -R ga+r ${WRKDIR}
# bsd.tcl.mk doesn't set TK_VER, so we use TCL_VER instead
post-patch:
${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
-e 's|%%TCL_INCLUDEDIR%%|${TCL_INCLUDEDIR}|g' \
-e 's|%%TK_INCLUDEDIR%%|${TK_INCLUDEDIR}|g' \
-e 's|%%TCL_LIBDIR%%|${TCL_LIBDIR}|g' \
-e 's|%%TK_LIBDIR%%|${TK_LIBDIR}|g' \
-e 's|%%TCL_VER%%|${TCL_VER:S/.//}|g' \
-e 's|%%TK_VER%%|${TCL_VER:S/.//}|g' \
${WRKSRC}/setupext.py
${REINPLACE_CMD} -e 's|%%GTK_BACKEND%%|${GTK_BACKEND}|g' \
-e 's|%%GTKAGG_BACKEND%%|${GTKAGG_BACKEND}|g' \
-e 's|%%TKAGG_BACKEND%%|${TKAGG_BACKEND}|g' \
-e 's|%%WXAGG_BACKEND%%|${WXAGG_BACKEND}|g' \
${WRKSRC}/setup.cfg
.if !defined(NOPORTEXAMPLES)
post-install:
@${MKDIR} ${EXAMPLESDIR}
${CP} -R ${WRKSRC}/examples/ ${EXAMPLESDIR}
.endif
.include <bsd.port.mk>