summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2016-10-05 16:07:02 -0700
committerBrian Dolbec <dolsen@gentoo.org>2016-10-07 11:11:12 -0700
commit7b38d796995f1976adaee32425c058d2bdfcb312 (patch)
treed4df4a19092bb868a04ac4c67769b42e32f04dff /dev-python/twisted
parentdev-python/priority: New package, new dep of twisted (diff)
downloadgentoo-7b38d796995f1976adaee32425c058d2bdfcb312.tar.gz
gentoo-7b38d796995f1976adaee32425c058d2bdfcb312.tar.bz2
gentoo-7b38d796995f1976adaee32425c058d2bdfcb312.zip
dev-python/twisted: New monolithic release twisted package
Twisted has changed to a single release pkg. This new pkg. now has python3 support. Package-Manager: portage-2.3.1_p8
Diffstat (limited to 'dev-python/twisted')
-rw-r--r--dev-python/twisted/Manifest2
-rw-r--r--dev-python/twisted/files/twistd.conf7
-rw-r--r--dev-python/twisted/files/twistd.init25
-rw-r--r--dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch11
-rw-r--r--dev-python/twisted/metadata.xml36
-rw-r--r--dev-python/twisted/twisted-16.2.0.ebuild126
-rw-r--r--dev-python/twisted/twisted-16.3.2.ebuild134
7 files changed, 341 insertions, 0 deletions
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
new file mode 100644
index 00000000000..61d1a6e0c33
--- /dev/null
+++ b/dev-python/twisted/Manifest
@@ -0,0 +1,2 @@
+DIST Twisted-16.2.0.tar.bz2 2942537 SHA256 a090e8dc675e97fb20c3bb5f8114ae94169f4e29fd3b3cbede35705fd3cdbd79 SHA512 a1942c15a84946e8bd4833801fffe7be01443560209972e10043262fd17a73c5d0c50592bd037130b6a1de08d7223cbdc1e2398c8c67f559d42e3e8ec81df840 WHIRLPOOL f847d57b833f7fbd9135c4a07af163afaa1e7a821d3aa657b34b2b465540bdce6472682ec20d7f8244117e99a4301e485afe6a765c07b7b64ac9bc90a9592af4
+DIST Twisted-16.3.2.tar.bz2 2916410 SHA256 22c32e68feb6be7ea68bcbc8f89184f06b5693a9f1b59d052927d19597645967 SHA512 6ddca880a06087717487d8a5cc128da81f1acbc97e5c372b1ba51eaeb87390ae7f91925e8e4cc90f29df21692bc11b6e0fe3772341b8488940895e57942e5149 WHIRLPOOL ad381b36f94351c15713e35d6312bae35c78ff90eb485892131f7db8c89168ccf5ddbc9d486bfeb47db695e75280bc73401194c6b36815c5859cc945d0191a7b
diff --git a/dev-python/twisted/files/twistd.conf b/dev-python/twisted/files/twistd.conf
new file mode 100644
index 00000000000..53788cd0017
--- /dev/null
+++ b/dev-python/twisted/files/twistd.conf
@@ -0,0 +1,7 @@
+
+# These are passed to twistd.
+# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -y /etc/twistd.tac"
+# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -f /etc/twistd.tap"
+
+# Make any additions to PYTHONPATH the twistd needs here.
+# PYTHONPATH="/path/to/extra/python/modules"
diff --git a/dev-python/twisted/files/twistd.init b/dev-python/twisted/files/twistd.init
new file mode 100644
index 00000000000..b031b0020c6
--- /dev/null
+++ b/dev-python/twisted/files/twistd.init
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+
+depend() {
+ need net
+}
+
+start() {
+ if [ -z "${TWISTD_OPTS}" ]; then
+ eerror "TWISTD_OPTS is not set!"
+ eerror "You need to configure twistd in /etc/conf.d/twistd."
+ return 1
+ fi
+ export PYTHONPATH
+ ebegin "Starting twistd"
+ start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \
+ --exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \
+ ${TWISTD_OPTS}
+ eend $? "Failed to start twistd"
+}
+
+stop() {
+ ebegin "Stopping twistd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid
+ eend $? "Failed to stop twistd"
+}
diff --git a/dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch b/dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
new file mode 100644
index 00000000000..2fe22f1640b
--- /dev/null
+++ b/dev-python/twisted/files/twisted-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch
@@ -0,0 +1,11 @@
+--- twisted/plugin.py
++++ twisted/plugin.py
+@@ -174,7 +174,7 @@
+ if pluginKey not in existingKeys:
+ del dropinDotCache[pluginKey]
+ needsWrite = True
+- if needsWrite:
++ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None:
+ try:
+ dropinPath.setContent(pickle.dumps(dropinDotCache))
+ except:
diff --git a/dev-python/twisted/metadata.xml b/dev-python/twisted/metadata.xml
new file mode 100644
index 00000000000..bb89489913f
--- /dev/null
+++ b/dev-python/twisted/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>dol-sen@gentoo.org</email>
+ <description>maintainer</description>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>twisted-python@twistedmatrix.com</email>
+ <name>Twisted Matrix Laboratories</name>
+ </maintainer>
+ <remote-id type="pypi">Twisted</remote-id>
+ </upstream>
+ <use>
+ <flag name="conch">include Twisted SSHv2 implementation</flag>
+ <flag name="http2">include http2 support</flag>
+ <flag name="serial">include serial port support</flag>
+ </use>
+ <longdescription>Twisted is an event-based framework for internet
+ applications, supporting Python 2.7 and Python 3.3+. It includes
+ modules for many different purposes, including the following:
+
+twisted.web: HTTP clients and servers, HTML templating, and a WSGI server
+twisted.conch: SSHv2 and Telnet clients and servers and terminal emulators
+twisted.words: Clients and servers for IRC, XMPP, and other IM protocols
+twisted.mail: IMAPv4, POP3, SMTP clients and servers
+twisted.positioning: Tools for communicating with NMEA-compatible GPS receivers
+twisted.names: DNS client and tools for making your own DNS servers
+twisted.trial: A unit testing framework that integrates well with Twisted-based code.
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-python/twisted/twisted-16.2.0.ebuild b/dev-python/twisted/twisted-16.2.0.ebuild
new file mode 100644
index 00000000000..7f47bfc43ef
--- /dev/null
+++ b/dev-python/twisted/twisted-16.2.0.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 python3_{4,5})
+PYTHON_REQ_USE="threads(+)"
+TWISTED_PN="Twisted"
+
+inherit eutils flag-o-matic twisted-r1
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
+SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
+
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~x86"
+IUSE="conch crypt serial +soap test"
+
+RDEPEND=">=dev-python/zope-interface-3.6.0[${PYTHON_USEDEP}]
+ conch? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ )
+ crypt? (
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ )
+ serial? ( dev-python/pyserial[${PYTHON_USEDEP}] )
+ soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
+"
+DEPEND="
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+ test? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7)
+ )
+"
+
+PATCHES=(
+ # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
+ "${FILESDIR}/${PN}-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
+)
+
+python_prepare_all() {
+ # Remove some tests known to fail due to the network sandbox
+ rm -R twisted/pair/test/test_*.py || die "rm twisted/pair/test/test_*.py FAILED"
+ # Possibly due to over taxing of the distutils_install_for_testing function
+ rm twisted/python/test/test_release.py || die "rm twisted/python/test/test_release.py FAILED"
+ if [[ "${EUID}" -eq 0 ]]; then
+ # Disable tests failing with root permissions.
+ sed \
+ -e "s/test_newPluginsOnReadOnlyPath/_&/" \
+ -e "s/test_deployedMode/_&/" \
+ -i twisted/test/test_plugin.py
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if ! python_is_python3; then
+ # Needed to make the sendmsg extension work
+ # (see http://twistedmatrix.com/trac/ticket/5701 )
+ local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_test() {
+ distutils_install_for_testing
+
+ pushd "${TEST_DIR}"/lib > /dev/null || die
+
+ if ! "${TEST_DIR}"/scripts/trial twisted; then
+ die "Tests failed with ${EPYTHON}"
+ fi
+
+ popd > /dev/null || die
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ cd "${D%/}$(python_get_sitedir)" || die
+
+ # create 'Twisted' egg wrt bug #299736
+ #local egg=( Twisted_Core*.egg-info )
+ #[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found"
+ #ln -s "${egg[0]}" "${egg[0]/_Core/}" || die
+
+ # own the dropin.cache so we don't leave orphans
+ touch twisted/plugins/dropin.cache || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}/twistd.conf" twistd
+ newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+pkg_postinst(){
+ einfo "Install complete"
+}
+
+pkg_postrm(){
+ einfo ""
+}
diff --git a/dev-python/twisted/twisted-16.3.2.ebuild b/dev-python/twisted/twisted-16.3.2.ebuild
new file mode 100644
index 00000000000..59abe7727b9
--- /dev/null
+++ b/dev-python/twisted/twisted-16.3.2.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 python3_{4,5})
+PYTHON_REQ_USE="threads(+)"
+TWISTED_PN="Twisted"
+
+inherit eutils flag-o-matic twisted-r1
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}"
+SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2"
+
+# Dropped keywords due to new deps not keyworded
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~amd64 ~x86"
+IUSE="conch crypt http2 serial +soap test"
+
+RDEPEND=">=dev-python/zope-interface-3.6.0[${PYTHON_USEDEP}]
+ conch? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ )
+ crypt? (
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ )
+ serial? ( dev-python/pyserial[${PYTHON_USEDEP}] )
+ soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) )
+ http2? (
+ >=dev-python/hyper-h2-2.3.0[${PYTHON_USEDEP}]
+ <dev-python/hyper-h2-3.0[${PYTHON_USEDEP}]
+ >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+ <dev-python/priority-2.0[${PYTHON_USEDEP}]
+ )
+ !dev-python/twisted-core
+ !dev-python/twisted-conch
+ !dev-python/twisted-lore
+ !dev-python/twisted-mail
+ !dev-python/twisted-names
+ !dev-python/twisted-news
+ !dev-python/twisted-pair
+ !dev-python/twisted-runner
+ !dev-python/twisted-words
+ !dev-python/twisted-web
+"
+DEPEND="
+ test? (
+ dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable.
+ "${FILESDIR}/${PN}-core-9.0.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch"
+)
+
+python_prepare_all() {
+ # Remove some tests known to fail due to the network sandbox
+ rm -R twisted/pair/test/test_*.py || die "rm twisted/pair/test/test_*.py FAILED"
+ # Possibly due to over taxing of the distutils_install_for_testing function
+ rm twisted/python/test/test_release.py || die "rm twisted/python/test/test_release.py FAILED"
+ if [[ "${EUID}" -eq 0 ]]; then
+ # Disable tests failing with root permissions.
+ sed \
+ -e "s/test_newPluginsOnReadOnlyPath/_&/" \
+ -e "s/test_deployedMode/_&/" \
+ -i twisted/test/test_plugin.py
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if ! python_is_python3; then
+ # Needed to make the sendmsg extension work
+ # (see http://twistedmatrix.com/trac/ticket/5701 )
+ local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_test() {
+ distutils_install_for_testing
+
+ pushd "${TEST_DIR}"/lib > /dev/null || die
+
+ if ! "${TEST_DIR}"/scripts/trial twisted; then
+ die "Tests failed with ${EPYTHON}"
+ fi
+
+ popd > /dev/null || die
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ cd "${D%/}$(python_get_sitedir)" || die
+
+ # create 'Twisted' egg wrt bug #299736
+ #local egg=( Twisted_Core*.egg-info )
+ #[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found"
+ #ln -s "${egg[0]}" "${egg[0]/_Core/}" || die
+
+ # own the dropin.cache so we don't leave orphans
+ touch twisted/plugins/dropin.cache || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}/twistd.conf" twistd
+ newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+pkg_postrm(){
+ # pre portage-2.3.2 release workaround for bug 595028
+ cd "${HOME}"
+ _distutils-r1_run_foreach_impl twisted-r1_update_plugin_cache
+}