2007-10-22 06:14:02 -04:00
|
|
|
# $OpenBSD: python.port.mk,v 1.19 2007/10/22 10:14:02 steven Exp $
|
2003-07-31 03:01:21 -04:00
|
|
|
#
|
|
|
|
# python.port.mk - Xavier Santolaria <xavier@santolaria.net>
|
|
|
|
# This file is in the public domain.
|
2003-07-28 13:48:13 -04:00
|
|
|
|
2007-10-08 04:21:33 -04:00
|
|
|
MODPY_VERSION?= 2.5
|
2003-07-28 13:48:13 -04:00
|
|
|
|
2006-11-26 05:16:22 -05:00
|
|
|
MODPY_RUN_DEPENDS= :python-${MODPY_VERSION}*:lang/python/${MODPY_VERSION}
|
2007-10-22 06:14:02 -04:00
|
|
|
MODPY_LIB_DEPENDS= python${MODPY_VERSION}:python-${MODPY_VERSION}*:lang/python/${MODPY_VERSION}
|
2003-07-28 13:48:13 -04:00
|
|
|
_MODPY_BUILD_DEPENDS= :python-${MODPY_VERSION}*:lang/python/${MODPY_VERSION}
|
|
|
|
|
2007-10-22 06:14:02 -04:00
|
|
|
MODPY_RUNDEP?= Yes
|
2007-10-10 17:42:14 -04:00
|
|
|
|
2004-02-06 03:37:22 -05:00
|
|
|
.if ${NO_BUILD:L} == "no"
|
2003-07-28 13:48:13 -04:00
|
|
|
BUILD_DEPENDS+= ${_MODPY_BUILD_DEPENDS}
|
2004-02-06 03:37:22 -05:00
|
|
|
.endif
|
2007-10-22 06:14:02 -04:00
|
|
|
.if ${MODPY_RUNDEP:L} == "yes"
|
2006-11-26 05:16:22 -05:00
|
|
|
RUN_DEPENDS+= ${MODPY_RUN_DEPENDS}
|
2007-10-10 17:42:14 -04:00
|
|
|
.endif
|
2003-07-28 13:48:13 -04:00
|
|
|
|
2007-05-22 11:34:26 -04:00
|
|
|
.if defined(MODPY_SETUPTOOLS) && ${MODPY_SETUPTOOLS:U} == YES
|
2006-09-26 11:27:02 -04:00
|
|
|
# The setuptools module provides a package locator (site.py) that is
|
|
|
|
# required at runtime for the pkg_resources stuff to work
|
|
|
|
MODPY_SETUPUTILS_DEPEND?=:py-setuptools-*:devel/py-setuptools
|
2006-11-26 05:16:22 -05:00
|
|
|
MODPY_RUN_DEPENDS+= ${MODPY_SETUPUTILS_DEPEND}
|
2006-09-26 11:27:02 -04:00
|
|
|
BUILD_DEPENDS+= ${MODPY_SETUPUTILS_DEPEND}
|
2007-05-22 11:34:26 -04:00
|
|
|
# The setuptools uses test target
|
|
|
|
REGRESS_TARGET?= test
|
2006-09-26 11:27:02 -04:00
|
|
|
.endif
|
|
|
|
|
2004-08-06 03:33:19 -04:00
|
|
|
.if !defined(NO_SHARED_LIBS) || ${NO_SHARED_LIBS:U} != YES
|
|
|
|
MODPY_EXPAT_DEPENDS= :python-expat-${MODPY_VERSION}*:lang/python/${MODPY_VERSION},-expat
|
|
|
|
MODPY_TKINTER_DEPENDS= :python-tkinter-${MODPY_VERSION}*:lang/python/${MODPY_VERSION},-tkinter
|
|
|
|
.endif
|
|
|
|
|
2003-07-28 13:48:13 -04:00
|
|
|
MODPY_BIN= ${LOCALBASE}/bin/python${MODPY_VERSION}
|
2004-05-15 05:24:12 -04:00
|
|
|
MODPY_INCDIR= ${LOCALBASE}/include/python${MODPY_VERSION}
|
2003-08-12 16:23:20 -04:00
|
|
|
MODPY_LIBDIR= ${LOCALBASE}/lib/python${MODPY_VERSION}
|
2004-05-15 05:24:12 -04:00
|
|
|
MODPY_SITEPKG= ${MODPY_LIBDIR}/site-packages
|
2003-07-28 13:48:13 -04:00
|
|
|
|
|
|
|
# usually setup.py but Setup.py can be found too
|
|
|
|
MODPY_SETUP?= setup.py
|
|
|
|
|
|
|
|
# build or build_ext are commonly used
|
|
|
|
MODPY_DISTUTILS_BUILD?= build --build-base=${WRKSRC}
|
2006-09-26 11:27:02 -04:00
|
|
|
|
|
|
|
.if defined(MODPY_SETUPTOOLS) && ${MODPY_SETUPTOOLS:U} == YES
|
|
|
|
MODPY_DISTUTILS_INSTALL?= install --prefix=${LOCALBASE} \
|
|
|
|
--root=${DESTDIR} \
|
|
|
|
--single-version-externally-managed
|
|
|
|
.else
|
2003-07-28 13:48:13 -04:00
|
|
|
MODPY_DISTUTILS_INSTALL?= install --prefix=${PREFIX}
|
2006-09-26 11:27:02 -04:00
|
|
|
.endif
|
2003-07-28 13:48:13 -04:00
|
|
|
|
2004-06-21 19:25:07 -04:00
|
|
|
MAKE_ENV+= CC=${CC}
|
|
|
|
|
2003-08-12 16:23:20 -04:00
|
|
|
_MODPY_CMD= @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
|
2003-07-29 15:35:32 -04:00
|
|
|
${MODPY_BIN} ./${MODPY_SETUP}
|
2003-07-28 13:48:13 -04:00
|
|
|
|
|
|
|
SUBST_VARS+= MODPY_VERSION
|
|
|
|
|
|
|
|
# dirty way to do it with no modifications in bsd.port.mk
|
2006-01-27 12:50:54 -05:00
|
|
|
.if empty(CONFIGURE_STYLE)
|
|
|
|
. if !target(do-build)
|
2003-07-28 13:48:13 -04:00
|
|
|
do-build:
|
2003-08-12 16:23:20 -04:00
|
|
|
${_MODPY_CMD} ${MODPY_DISTUTILS_BUILD} ${MODPY_DISTUTILS_BUILDARGS}
|
2006-01-27 12:50:54 -05:00
|
|
|
. endif
|
2003-07-28 13:48:13 -04:00
|
|
|
|
|
|
|
# extra documentation or scripts should be installed via post-install
|
2006-01-27 12:50:54 -05:00
|
|
|
. if !target(do-install)
|
2003-07-28 13:48:13 -04:00
|
|
|
do-install:
|
2003-10-10 12:38:18 -04:00
|
|
|
${_MODPY_CMD} ${MODPY_DISTUTILS_BUILD} ${MODPY_DISTUTILS_BUILDARGS} \
|
|
|
|
${MODPY_DISTUTILS_INSTALL} ${MODPY_DISTUTILS_INSTALLARGS}
|
2006-01-27 12:50:54 -05:00
|
|
|
. endif
|
2006-09-26 11:27:02 -04:00
|
|
|
|
|
|
|
# setuptools supports regress testing from setup.py using a standard target
|
|
|
|
. if !target(do-regress) && \
|
|
|
|
defined(MODPY_SETUPTOOLS) && ${MODPY_SETUPTOOLS:U} == YES
|
|
|
|
do-regress:
|
2007-05-22 11:34:26 -04:00
|
|
|
${_MODPY_CMD} ${REGRESS_TARGET}
|
2006-09-26 11:27:02 -04:00
|
|
|
. endif
|
|
|
|
|
2003-07-28 13:48:13 -04:00
|
|
|
.endif
|