2006-09-26 15:27:02 +00:00
|
|
|
# $OpenBSD: python.port.mk,v 1.13 2006/09/26 15:27:02 djm Exp $
|
2003-07-31 07:01:21 +00:00
|
|
|
#
|
|
|
|
|
# python.port.mk - Xavier Santolaria <xavier@santolaria.net>
|
|
|
|
|
# This file is in the public domain.
|
2003-07-28 17:48:13 +00:00
|
|
|
|
2006-06-03 09:14:04 +00:00
|
|
|
MODPY_VERSION?= 2.4
|
2003-07-28 17:48:13 +00:00
|
|
|
|
|
|
|
|
_MODPY_BUILD_DEPENDS= :python-${MODPY_VERSION}*:lang/python/${MODPY_VERSION}
|
|
|
|
|
|
2004-02-06 08:37:22 +00:00
|
|
|
.if ${NO_BUILD:L} == "no"
|
2003-07-28 17:48:13 +00:00
|
|
|
BUILD_DEPENDS+= ${_MODPY_BUILD_DEPENDS}
|
2004-02-06 08:37:22 +00:00
|
|
|
.endif
|
2003-07-28 17:48:13 +00:00
|
|
|
RUN_DEPENDS+= ${_MODPY_BUILD_DEPENDS}
|
|
|
|
|
|
2006-09-26 15:27:02 +00:00
|
|
|
# The setuptools module provides a package locator (site.py) that is
|
|
|
|
|
# required at runtime for the pkg_resources stuff to work
|
|
|
|
|
.if defined(MODPY_SETUPTOOLS) && ${MODPY_SETUPTOOLS:U} == YES
|
|
|
|
|
MODPY_SETUPUTILS_DEPEND?=:py-setuptools-*:devel/py-setuptools
|
|
|
|
|
RUN_DEPENDS+= ${MODPY_SETUPUTILS_DEPEND}
|
|
|
|
|
BUILD_DEPENDS+= ${MODPY_SETUPUTILS_DEPEND}
|
|
|
|
|
.endif
|
|
|
|
|
|
2004-08-06 07:33:19 +00: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 17:48:13 +00:00
|
|
|
MODPY_BIN= ${LOCALBASE}/bin/python${MODPY_VERSION}
|
2004-05-15 09:24:12 +00:00
|
|
|
MODPY_INCDIR= ${LOCALBASE}/include/python${MODPY_VERSION}
|
2003-08-12 20:23:20 +00:00
|
|
|
MODPY_LIBDIR= ${LOCALBASE}/lib/python${MODPY_VERSION}
|
2004-05-15 09:24:12 +00:00
|
|
|
MODPY_SITEPKG= ${MODPY_LIBDIR}/site-packages
|
2003-07-28 17:48:13 +00: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 15:27:02 +00: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 17:48:13 +00:00
|
|
|
MODPY_DISTUTILS_INSTALL?= install --prefix=${PREFIX}
|
2006-09-26 15:27:02 +00:00
|
|
|
.endif
|
2003-07-28 17:48:13 +00:00
|
|
|
|
2004-06-21 23:25:07 +00:00
|
|
|
MAKE_ENV+= CC=${CC}
|
|
|
|
|
|
2003-08-12 20:23:20 +00:00
|
|
|
_MODPY_CMD= @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
|
2003-07-29 19:35:32 +00:00
|
|
|
${MODPY_BIN} ./${MODPY_SETUP}
|
2003-07-28 17:48:13 +00:00
|
|
|
|
|
|
|
|
SUBST_VARS+= MODPY_VERSION
|
|
|
|
|
|
|
|
|
|
# dirty way to do it with no modifications in bsd.port.mk
|
2006-01-27 17:50:54 +00:00
|
|
|
.if empty(CONFIGURE_STYLE)
|
|
|
|
|
. if !target(do-build)
|
2003-07-28 17:48:13 +00:00
|
|
|
do-build:
|
2003-08-12 20:23:20 +00:00
|
|
|
${_MODPY_CMD} ${MODPY_DISTUTILS_BUILD} ${MODPY_DISTUTILS_BUILDARGS}
|
2006-01-27 17:50:54 +00:00
|
|
|
. endif
|
2003-07-28 17:48:13 +00:00
|
|
|
|
|
|
|
|
# extra documentation or scripts should be installed via post-install
|
2006-01-27 17:50:54 +00:00
|
|
|
. if !target(do-install)
|
2003-07-28 17:48:13 +00:00
|
|
|
do-install:
|
2003-10-10 16:38:18 +00:00
|
|
|
${_MODPY_CMD} ${MODPY_DISTUTILS_BUILD} ${MODPY_DISTUTILS_BUILDARGS} \
|
|
|
|
|
${MODPY_DISTUTILS_INSTALL} ${MODPY_DISTUTILS_INSTALLARGS}
|
2006-01-27 17:50:54 +00:00
|
|
|
. endif
|
2006-09-26 15:27:02 +00: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:
|
|
|
|
|
${_MODPY_CMD} test
|
|
|
|
|
. endif
|
|
|
|
|
|
2003-07-28 17:48:13 +00:00
|
|
|
.endif
|