Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jun 2005 03:19:42 +0400
From:      Vsevolod Stakhov <vsevolod@highsecure.ru>
To:        FreeBSD-gnats-submit@freebsd.org, freebsd-ports-bugs@freebsd.org, vsevolod@highsecure.ru, perky@freebsd.org
Subject:   Re: ports/82445: Add PYTWISTED dependence line to bsd.python.mk
Message-ID:  <20050620231941.GA2394@spray.anyhost.ru>
In-Reply-To: <200506201430.j5KEULMO039524@freefall.freebsd.org>
References:  <E1DkN8i-000HII-0k@spray.anyhost.ru> <200506201430.j5KEULMO039524@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I have redesigned structure of twisted dependencies due to incompatible
component's lists in twisted 1.3 (that was just a single project) and
twisted 2.0 (that contains different subprojects). So, my suggestion is
to add USE_TWISTED macro that should specify version of twisted framework
needed and can specify specific components for twisted 2.0. Here is modified
patch.


--- bsd.python.mk.orig	Mon Jun 20 17:24:59 2005
+++ bsd.python.mk	Tue Jun 21 03:11:07 2005
@@ -115,6 +115,23 @@
 #
 # PYSETUP:		Name of the setup script used by the distutils package.
 #				default: setup.py
+#
+# USE_TWISTED:	Use twisted framework for port. If there is no version or 
+# 				components specified then 1.3 twisted is used. Version of 
+# 				twisted framework can be 13 or 20. If this option is 20 then
+# 				the dependence to twistedCore is added. Alternatively here
+# 				can be listed specific components of twisted framework, 
+# 				available components are: web, lore, news, words, pair,
+# 				mail, names, xish, runner, flow. Note that core component
+# 				is required for any of this optional components. 
+#
+# USE_ZOPE:		Use Zope - an object-based web application platform, this
+# 				also sets up ZOPEBASEDIR - relative base directory of zope 
+# 				server, SZOPEBASEDIR - absolute base directory of zope that
+# 				is ${LOCALBASE}/${SZOPEBASEDIR} by default, 
+# 				ZOPEPRODUCTDIR - directory, where products for zope can be 
+# 				found. Note that USE_ZOPE require python2.3
+#
 
 _PYTHON_PORTBRANCH=		2.4
 _PYTHON_ALLBRANCHES=	2.4 2.3 2.2 2.1 2.5 # preferred first
@@ -299,6 +316,7 @@
 
 PYDISTUTILS=	${PYTHON_LIBDIR}/distutils/core.py:${PYTHON_PORTSDIR}
 PYNUMERIC=		${PYTHON_SITELIBDIR}/Numeric/Numeric.py:${PORTSDIR}/math/py-numeric
+PYTWISTED=		${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted
 PYXML=			${PYTHON_SITELIBDIR}/_xmlplus/__init__.py:${PORTSDIR}/textproc/py-xml
 
 .if defined(PYTHON_REL) && ${PYTHON_REL} < 232
@@ -342,6 +360,65 @@
 PLIST_SUB+=		ZOPEBASEDIR=${SZOPEBASEDIR} \
 				ZOPEPRODUCTDIR=${SZOPEBASEDIR}/${ZOPEPRODUCTDIR}
 .endif
+
+# Twisted specific routines
+.if defined(USE_TWISTED)
+
+.if exists(${LOCALBASE}/bin/twistd)
+_TWISTED_VER!=	${LOCALBASE}/bin/twistd --version | ${SED} -e 's/.*daemon) \([0-9]\).\([0-9]\).*/\1\2/' -e '2,$$d' -e '$$d'
+.endif
+
+.if ${USE_TWISTED} == "20"
+USE_TWISTED_VER=	${USE_TWISTED}
+.	if defined(_TWISTED_VER) && ${_TWISTED_VER} == "13"
+BROKEN=	Twisted framework versions mismatch: want ${USE_TWISTED_VER} and installed ${_TWISTED_VER}
+.	else
+RUN_DEPENDS+=   ${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twistedCore
+.	endif
+
+.elif ${USE_TWISTED} == "13"
+USE_TWISTED_VER=	${USE_TWISTED}
+.	if defined(_TWISTED_VER) && ${_TWISTED_VER} == "20"
+BROKEN=	Twisted framework versions mismatch: want ${USE_TWISTED_VER} and installed ${_TWISTED_VER}
+.	else
+RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted
+.	endif
+
+.else
+USE_TWISTED_VER=	"20"
+# Components list is allowed only for version 20
+.if defined(_TWISTED_VER) && ${_TWISTED_VER} == "13"
+BROKEN=	Twisted framework versions mismatch: want ${USE_TWISTED_VER} and installed ${_TWISTED_VER}
+.else
+
+# Checking for twisted components 
+_TWISTED_COMPONENTS?=	web lore news words pair mail names xish runner flow
+
+# XXX Should be here other dependencies types?
+web_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/web/__init__.py:${PORTSDIR}/www/py-twistedWeb	
+lore_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/textproc/__init__.py:${PORTSDIR}/textproc/py-twistedLore
+news_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/news/__init__.py:${PORTSDIR}/news/py-twistedNews
+words_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/words/__init__.py:${PORTSDIR}/net/py-twistedWords
+pair_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/pair/__init__.py:${PORTSDIR}/net/py-twistedPair
+mail_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/mail/__init__.py:${PORTSDIR}/mail/py-twistedMail
+names_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/names/__init__.py:${PORTSDIR}/dns/py-twistedNames
+xish_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/xish/__init__.py:${PORTSDIR}/devel/py-twistedXish
+runner_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/runner/__init__.py:${PORTSDIR}/devel/py-twistedRunner
+flow_RUN_DEPENDS=	${PYTHON_SITELIBDIR}/twisted/flow/__init__.py:${PORTSDIR}/devel/py-twistedFlow
+
+. for component in ${_TWISTED_COMPONENTS}
+_COMP_TEST= ${USE_TWISTED:M${component}}
+.  if ${_COMP_TEST:S/${component}//}!=${_COMP_TEST:S/  / /g}
+RUN_DEPENDS+=	${${component}_RUN_DEPENDS}
+.	endif
+.endfor
+
+# Implicit dependence from core
+RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twistedCore
+.endif
+.endif
+
+.endif # defined(USE_TWISTED)
 
 # XXX Hm, should I export some of the variables above to *_ENV?
 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050620231941.GA2394>