summaryrefslogtreecommitdiff
path: root/dev-python/psycopg
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/psycopg
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/psycopg')
-rw-r--r--dev-python/psycopg/Manifest18
-rw-r--r--dev-python/psycopg/files/psycopg-2.4.2-setup.py.patch13
-rw-r--r--dev-python/psycopg/files/psycopg-2.7.3-avoid-mxdatetime.patch40
-rw-r--r--dev-python/psycopg/files/psycopg-2.7.3-sphinx-1.6.patch29
-rw-r--r--dev-python/psycopg/metadata.xml11
-rw-r--r--dev-python/psycopg/psycopg-1.1.21-r1.ebuild72
-rw-r--r--dev-python/psycopg/psycopg-2.5.3.ebuild67
-rw-r--r--dev-python/psycopg/psycopg-2.6.2.ebuild74
-rw-r--r--dev-python/psycopg/psycopg-2.7.3.1.ebuild74
-rw-r--r--dev-python/psycopg/psycopg-2.7.3.2.ebuild72
-rw-r--r--dev-python/psycopg/psycopg-2.7.3.ebuild74
-rw-r--r--dev-python/psycopg/psycopg-2.7.4.ebuild68
12 files changed, 612 insertions, 0 deletions
diff --git a/dev-python/psycopg/Manifest b/dev-python/psycopg/Manifest
new file mode 100644
index 000000000000..6367afcc7bc1
--- /dev/null
+++ b/dev-python/psycopg/Manifest
@@ -0,0 +1,18 @@
+AUX psycopg-2.4.2-setup.py.patch 568 BLAKE2B 820a8ab11084670b79d159dcdb75a30f157f740a8110370ab0ded41907dece280cc7095ec691b96f5288e82bd29d8b6a46f108faddde79c4ada709e52e489ad0 SHA512 9111df177d89559b0e397bc0ca9844636f981552d4bac3ae04abfdae5c68bc4f9efc553829da9c3a653536ddb18f01a3049e9ece746d0fe3328684a6ef6b6976
+AUX psycopg-2.7.3-avoid-mxdatetime.patch 1832 BLAKE2B dff21302f85dc05be27147d1a53ac525bca24cd9c2282edb92168ba38e73c38bad9f5a8b24910a690105bb4f98888e174f8d7c2a285e6e42efb36a45499ed02e SHA512 1c582abe153d73bd71cdfefff4293f2c497a5818fe2ea7e0deffe71d0acb89ccde8e20aaa33acf3d47900743c548eecbf01db24b01abe35b5ed60ca20bf4a658
+AUX psycopg-2.7.3-sphinx-1.6.patch 1164 BLAKE2B c8dc98f49f1070f7866b01a10bf779480a03620eea548f66e1f19c13d1e8ca72ea4761dcae857db5a350aa545d8b3dbb2695334a05496e6150853820a6105c1b SHA512 dd6438110f5a653236ba8e6efda0f6d5cb2baaa506398728990106a0fbcb1ff8d072716c48e7f14ec608fe0b7307b8f5c7c0076fe2921104e25f21c905c0f6a2
+DIST psycopg-1.1.21.tar.gz 213753 BLAKE2B 679b4ba810ad7821c781e169baae1f62b6f926e2c115c88f0055404ecd266ed69beaea6151643984ec2bc5696a79ac02f23adcec727afe4e6b6e657740a1692c SHA512 2681e8b3c4873f69a1a07aa4d3908a42f8e8be9392adbed189fe72c1a601699ac08643d24454622baf4b26153ef3a687f27a941308368e2227cb98ff948322eb
+DIST psycopg2-2.5.3.tar.gz 690689 BLAKE2B c1c070fc9acf5270f6bd711d457f162d2e5622a0cb40584d5b24cce441429c460aded278b67dbdf351605d710085c3e04ac63927d736c8d04ea27d21cccdea10 SHA512 88590c37be839e8cf5025b7ac40411c4682269700795c5f8f1b762966d906faf3f1ee85de35fc734a2d10c6a68d7fef569891bd96919bab809b9500625e2a41a
+DIST psycopg2-2.6.2.tar.gz 376348 BLAKE2B 279f2fb905c3e3034d89535a8c1de3114ef87cbd7f4b32a54b38150ef1cb845ae9811b3d6f57a5f46042db47e6d5f2563e87c986cdb8a8799fe6d60580180cc3 SHA512 614314b5ab7ab5fa7c5e9c4f861579f90bd73521a9964dcb5a0938f77a9d6dfbea689cef35ad399cda698a45bb736c315912cb5dca85a52132f011d79f4863ac
+DIST psycopg2-2.7.3.1.tar.gz 425069 BLAKE2B 4d34859c63217bad08374b0a8d03dbcba7711c1e8034eb106ba27211e85af148f51902e2d1b294e4c0ba4e798f4a64903d9d735605d09bbcb1d291ad23cfb4e0 SHA512 206d4cf62a091927daf4b734e0b3597399fc588cb738366711674fc06c39d68a682981bc4756c356d37c41caba49b5df2b915beace8670c190d7d41e374f1eb5
+DIST psycopg2-2.7.3.2.tar.gz 425107 BLAKE2B 47fe652d5e2e62c765150941d565b9ee896e221ae565e51745645f2723a0070481daf2f0d0d1a1fbd741b5b536c12cdf892becb4d5d4283a26cd324cd02c47c6 SHA512 38460369e339b16e433328e9bd6ccdbb4b03e41d40b9fb453a54513af4ec43f0a72dc795de6eb13d9618e1d5636991d3de7f619459b3f21d070798d497b2776f
+DIST psycopg2-2.7.3.tar.gz 425004 BLAKE2B df405ca5b5f5887fbd166523cafd5686a9148b313b7c30a85dbfc5dec42aff426505993f42a18d6d60569deb17a5748a858737a139d74943e66bce8bdd12beb3 SHA512 9e673f47190b12ab31e783a3d2b464231b933cc6ad4f12742c457020aab5db36b83829d84b4e63f793f5567e689081fd9479bfc4634b7bb08c7d873a3f42efc9
+DIST psycopg2-2.7.4.tar.gz 425331 BLAKE2B 9d256ea340e4bace53981596d9d42863ddc9c8c079579b0621d8043af34daade05b9cec5465c6b3990f537a4350d9cf60a43062a0aa34db1f39b336296b32d3f SHA512 e78db528a4d3b897e0d8d38755179082dacddfb2d10bda963fc3836548991eaa0d4c1b8f81b329b15f4e685046c39e6f2a352b6c47b1da42af3a262094233034
+EBUILD psycopg-1.1.21-r1.ebuild 1569 BLAKE2B 2bd03f117610681759be78e45636f721c16e2f8f54abfad2a985ab19d0e1c51ed5a878e3e7db810f03ed896a5b45a38155ca7c5debffc40c6065d71992d73588 SHA512 e69ba12412bc2d3d76fd3eeb4326bd33aec7ca8bf3f6830b6efdfd66640c7dfe036d7e09a8a0340a5b5fb448c57dd01cbb7b1a5a1810ca502ecd6796d285162e
+EBUILD psycopg-2.5.3.ebuild 1453 BLAKE2B 545c189cc95d636b8f817203e4b6a45bf51cdc0a1f586ecb266c90f4f9bbe0d6e4ffa896b500a3201472321871746859a22f688d14b5032ef7763f8139b89cc4 SHA512 1ccc7b12610034a51e354956edd11a858ad7e8a969ca6ed5f1851df97483cfd4c229d53c0652bb7ad40f152f2a627254113100150c12d99e461d9bc561d7e034
+EBUILD psycopg-2.6.2.ebuild 1963 BLAKE2B bc808d9db5b41744a0afc87de313e1ddd8cfd70081a3be4bfc2ad6ea5a564f259b3f2c6596eb8f6e2e8d3f20a7a0676148453ad92bcb89cf8a26fde603d673aa SHA512 22664eb84a45d59bd1f0527217068416ca6d94c2ebcfc60b64b00ea9fa4421df0aa4521ec938bac0aaab1c02e65ef18ad3f2383e00f24ce6e8e6db221388224e
+EBUILD psycopg-2.7.3.1.ebuild 1925 BLAKE2B 23ae799c7190d00b1f89ed0a5d56ffd6d087729aa14c9f9de5613f779e1bc1e4429caa0bcbb23c4e3916ed52201a778329c497169eef019a2c0eb9d71bf816e9 SHA512 a2aad512239cfa3c484ae4f60a8a2206581d3a4507b1c61f77c96433889b445a378bae56807ac083631fe80f5222f5e4861cb7be129033ce4ed99d6c83c5be7c
+EBUILD psycopg-2.7.3.2.ebuild 1676 BLAKE2B 7284bd0b9418c7447abb99cf8b54745e87d37216c96784159be742cb225b8221cd1339c627d355a04adfb246b6caf6bc03f5d7bda7cae3b7f7af3afc4566cd33 SHA512 cf7359219dffaf91a62eb4f367ee8060ba553dff76f59686045734b791f0bd14596175a6cd597ad027aa684f772232232506fcef5007b17118a41d09896e761a
+EBUILD psycopg-2.7.3.ebuild 1916 BLAKE2B 0aef9459837710da76e7a79c8b53bbef66273693015db9b845ec9249cba03cef3920f9f5759dc60d4d080793d2ce2b8b293efe8ae63b91073f2596541fec8b31 SHA512 5c8eae548f2435667f48fc996fe4be784ea2ab71fa86f9a91c423f15d9ad778107c70d7670de36d8cf00cc2bec1c46c9ba693feb3c10982dc17e008fd8bd6b1c
+EBUILD psycopg-2.7.4.ebuild 1563 BLAKE2B d738118105fc0e96eb3035ee68de880a5d8853495c77ba00499d75075c5bd873693722e3a5c3a74bf7b55b8946ba2a2395d9179e35e7e8b43a3e19c183a056e2 SHA512 6d303d53f407afb6cd2664444f96f9b99ce0692d352ea74a71d543501b26c1e539f175deb2cd46ebf8645afc12394c7483194e28ea65d714dd6b807af9f08c74
+MISC metadata.xml 321 BLAKE2B aff48bec04e34b92668aa18214d86ddbedef2376eeced4815118d35eebfb8e6af87234a9470828f465626f7d9ed56fe0fcb8f078c23945371248136533651ad3 SHA512 358b751b3a65f64ab5468bcf4022315f7069a2fb60709c2bb12ac02577866a3ff24ab2dd69577052070cf010a51428cb3ec385ca7cfe48640f4dd25ae478a966
diff --git a/dev-python/psycopg/files/psycopg-2.4.2-setup.py.patch b/dev-python/psycopg/files/psycopg-2.4.2-setup.py.patch
new file mode 100644
index 000000000000..a35502270e1f
--- /dev/null
+++ b/dev-python/psycopg/files/psycopg-2.4.2-setup.py.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index e03876a..f5ec2ac 100644
+--- a/setup.py
++++ b/setup.py
+@@ -461,7 +461,7 @@ if parser.has_option('build_ext', 'mx_include_dir'):
+ mxincludedir = parser.get('build_ext', 'mx_include_dir')
+ else:
+ mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
+-if os.path.exists(mxincludedir):
++if not use_pydatetime and os.path.exists(mxincludedir):
+ # Build the support for mx: we will check at runtime if it can be imported
+ include_dirs.append(mxincludedir)
+ define_macros.append(('HAVE_MXDATETIME', '1')) \ No newline at end of file
diff --git a/dev-python/psycopg/files/psycopg-2.7.3-avoid-mxdatetime.patch b/dev-python/psycopg/files/psycopg-2.7.3-avoid-mxdatetime.patch
new file mode 100644
index 000000000000..aab130c54500
--- /dev/null
+++ b/dev-python/psycopg/files/psycopg-2.7.3-avoid-mxdatetime.patch
@@ -0,0 +1,40 @@
+Index: psycopg2-2.7.3/setup.py
+===================================================================
+--- psycopg2-2.7.3.orig/setup.py
++++ psycopg2-2.7.3/setup.py
+@@ -527,20 +527,21 @@ have_pydatetime = True
+ have_mxdatetime = False
+ use_pydatetime = int(parser.get('build_ext', 'use_pydatetime'))
+
+-# check for mx package
+-mxincludedir = ''
+-if parser.has_option('build_ext', 'mx_include_dir'):
+- mxincludedir = parser.get('build_ext', 'mx_include_dir')
+-if not mxincludedir:
+- mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
+-if mxincludedir.strip() and os.path.exists(mxincludedir):
+- # Build the support for mx: we will check at runtime if it can be imported
+- include_dirs.append(mxincludedir)
+- define_macros.append(('HAVE_MXDATETIME', '1'))
+- sources.append('adapter_mxdatetime.c')
+- depends.extend(['adapter_mxdatetime.h', 'typecast_mxdatetime.c'])
+- have_mxdatetime = True
+- version_flags.append('mx')
++if not use_pydatetime:
++ # check for mx package
++ mxincludedir = ''
++ if parser.has_option('build_ext', 'mx_include_dir'):
++ mxincludedir = parser.get('build_ext', 'mx_include_dir')
++ if not mxincludedir:
++ mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
++ if mxincludedir.strip() and os.path.exists(mxincludedir):
++ # Build the support for mx: we will check at runtime if it can be imported
++ include_dirs.append(mxincludedir)
++ define_macros.append(('HAVE_MXDATETIME', '1'))
++ sources.append('adapter_mxdatetime.c')
++ depends.extend(['adapter_mxdatetime.h', 'typecast_mxdatetime.c'])
++ have_mxdatetime = True
++ version_flags.append('mx')
+
+ # now decide which package will be the default for date/time typecasts
+ if have_pydatetime and (use_pydatetime or not have_mxdatetime):
diff --git a/dev-python/psycopg/files/psycopg-2.7.3-sphinx-1.6.patch b/dev-python/psycopg/files/psycopg-2.7.3-sphinx-1.6.patch
new file mode 100644
index 000000000000..4052a14649ef
--- /dev/null
+++ b/dev-python/psycopg/files/psycopg-2.7.3-sphinx-1.6.patch
@@ -0,0 +1,29 @@
+--- psycopg-2.7.3.2/doc/src/tools/lib/dbapi_extension.py 2016-04-10 08:48:37.000000000 +0200
++++ psycopg-2.7.3.2/doc/src/tools/lib/dbapi_extension.py 2017-12-20 22:14:19.097225121 +0100
+@@ -12,7 +12,7 @@
+ from docutils import nodes
+
+ from sphinx.locale import _
+-from sphinx.util.compat import Directive, make_admonition
++from docutils.parsers.rst import Directive
+
+ class extension_node(nodes.Admonition, nodes.Element): pass
+
+@@ -29,12 +29,11 @@ class Extension(Directive):
+ option_spec = {}
+
+ def run(self):
+- nodes = make_admonition(extension_node,
+- self.name, [_('DB API extension')], self.options,
+- self.content, self.lineno, self.content_offset,
+- self.block_text, self.state, self.state_machine)
+- nodes[0]['classes'].append('dbapi-extension')
+- return nodes
++ node = extension_node('\n'.join(self.content))
++ node += nodes.title(_('DB API extension'), _('DB API extension'))
++ self.state.nested_parse(self.content, self.content_offset, node)
++ node['classes'].append('dbapi-extension')
++ return [node]
+
+
+ def visit_extension_node(self, node):
diff --git a/dev-python/psycopg/metadata.xml b/dev-python/psycopg/metadata.xml
new file mode 100644
index 000000000000..9263d11136c4
--- /dev/null
+++ b/dev-python/psycopg/metadata.xml
@@ -0,0 +1,11 @@
+<?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>
+ <upstream>
+ <remote-id type="pypi">psycopg2</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/psycopg/psycopg-1.1.21-r1.ebuild b/dev-python/psycopg/psycopg-1.1.21-r1.ebuild
new file mode 100644
index 000000000000..84902f8172ed
--- /dev/null
+++ b/dev-python/psycopg/psycopg-1.1.21-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools-utils python-r1
+
+DESCRIPTION="PostgreSQL database adapter for Python"
+HOMEPAGE="http://www.initd.org/software/psycopg"
+SRC_URI="http://initd.org/pub/software/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="examples"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND=">=dev-python/egenix-mx-base-2.0.3[${PYTHON_USEDEP}]
+ dev-db/postgresql:*
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # fix for bug #134873
+ sed -e '1245s/static //' -i cursor.c || die
+ sed -e 's:$(PY_MOD_DIR):$(D)&/$$mod:' \
+ -e '/^CFLAGS/s:-I:-I. &:' \
+ -i Makefile.pre.in || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ python_configure() {
+ local myeconfargs=(
+ --with-mxdatetime-includes="$(python_get_includedir)/mx"
+ --with-postgres-includes="/usr/include/postgresql/server"
+ )
+
+ autotools-utils_src_configure
+
+ sed -e 's:$(BLDSHARED):& $(LDFLAGS):' \
+ -i "${BUILD_DIR}"/Makefile || die
+ }
+ python_foreach_impl python_configure
+}
+
+src_compile() {
+ python_foreach_impl autotools-utils_src_compile \
+ OPT="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_test() {
+ :
+}
+
+src_install () {
+ python_install() {
+ dodir "$(python_get_sitedir)"
+ autotools-utils_src_install
+ }
+
+ python_foreach_impl python_install
+
+ dodoc RELEASE-1.0 SUCCESS doc/python-taylor.txt
+
+ if use examples; then
+ dodoc -r doc/examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}
diff --git a/dev-python/psycopg/psycopg-2.5.3.ebuild b/dev-python/psycopg/psycopg-2.5.3.ebuild
new file mode 100644
index 000000000000..ac8962ba17d1
--- /dev/null
+++ b/dev-python/psycopg/psycopg-2.5.3.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1 flag-o-matic
+
+MY_PN="${PN}2"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="PostgreSQL database adapter for Python"
+HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="2"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="debug doc examples"
+
+RDEPEND=">=dev-db/postgresql-8.1:*"
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
+
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_P}"
+
+python_compile() {
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+
+ [[ ${EPYTHON} != python3* ]] && append-flags -fno-strict-aliasing
+
+ distutils-r1_python_compile
+}
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}/${PN}-2.4.2-setup.py.patch"
+ )
+
+ if use debug; then
+ sed -i 's/^\(define=\)/\1PSYCOPG_DEBUG,/' setup.cfg || die
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C doc -j1 html text
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ dodoc doc/{HACKING,SUCCESS}
+
+ if use doc; then
+ dodoc doc/psycopg2.txt
+ dohtml -r doc/html/.
+ fi
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r examples/.
+ fi
+}
diff --git a/dev-python/psycopg/psycopg-2.6.2.ebuild b/dev-python/psycopg/psycopg-2.6.2.ebuild
new file mode 100644
index 000000000000..7ea236693333
--- /dev/null
+++ b/dev-python/psycopg/psycopg-2.6.2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1 flag-o-matic
+
+MY_PN="${PN}2"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="PostgreSQL database adapter for Python"
+HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="2"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="debug doc examples"
+
+RDEPEND=">=dev-db/postgresql-8.1:*"
+DEPEND="${RDEPEND}
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ >=dev-python/python-docs-2.7.6-r1:2.7
+ )"
+
+RESTRICT="test"
+# Remove py3.2 entry from intersphinx setting
+PATCHES=( "${FILESDIR}/"${PN}-2.4.2-setup.py.patch )
+
+S="${WORKDIR}/${MY_P}"
+
+python_compile() {
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+
+ ! python_is_python3 && append-flags -fno-strict-aliasing
+
+ distutils-r1_python_compile
+}
+
+python_prepare_all() {
+ if use debug; then
+ sed -i 's/^\(define=\)/\1PSYCOPG_DEBUG,/' setup.cfg || die
+ fi
+
+ # Source local copy of objects.inv
+ if use doc; then
+ local PYTHON_DOC_ATOM=$(best_version --host-root dev-python/python-docs:2.7)
+ local PYTHON_DOC_VERSION="${PYTHON_DOC_ATOM#dev-python/python-docs-}"
+ local PYTHON_DOC="/usr/share/doc/python-docs-${PYTHON_DOC_VERSION}/html"
+ local PYTHON_DOC_INVENTORY="${PYTHON_DOC}/objects.inv"
+ sed -e "s|'http://docs.python.org/', None|'${PYTHON_DOC}', '${PYTHON_DOC_INVENTORY}'|" \
+ -e "/^ 'py3':/d" -i doc/src/conf.py || die
+ einfo "conf.py patched"
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C doc/src -j1 html text
+}
+
+python_install_all() {
+ if use doc; then
+ dohtml -r doc/src/_build/html/.
+ fi
+
+ use examples && local EXAMPLES=( examples/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/psycopg/psycopg-2.7.3.1.ebuild b/dev-python/psycopg/psycopg-2.7.3.1.ebuild
new file mode 100644
index 000000000000..8a3497f27e7f
--- /dev/null
+++ b/dev-python/psycopg/psycopg-2.7.3.1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1 flag-o-matic
+
+MY_PN="${PN}2"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="PostgreSQL database adapter for Python"
+HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="debug doc examples"
+
+RDEPEND=">=dev-db/postgresql-8.1:*"
+DEPEND="${RDEPEND}
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ >=dev-python/python-docs-2.7.6-r1:2.7
+ )"
+
+RESTRICT="test"
+# Remove py3.2 entry from intersphinx setting
+PATCHES=( )
+
+S="${WORKDIR}/${MY_P}"
+
+python_compile() {
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+
+ ! python_is_python3 && append-flags -fno-strict-aliasing
+
+ distutils-r1_python_compile
+}
+
+python_prepare_all() {
+ if use debug; then
+ sed -i 's/^\(define=\)/\1PSYCOPG_DEBUG,/' setup.cfg || die
+ fi
+
+ # Source local copy of objects.inv
+ if use doc; then
+ local PYTHON_DOC_ATOM=$(best_version --host-root dev-python/python-docs:2.7)
+ local PYTHON_DOC_VERSION="${PYTHON_DOC_ATOM#dev-python/python-docs-}"
+ local PYTHON_DOC="/usr/share/doc/python-docs-${PYTHON_DOC_VERSION}/html"
+ local PYTHON_DOC_INVENTORY="${PYTHON_DOC}/objects.inv"
+ sed -e "s|'http://docs.python.org/', None|'${PYTHON_DOC}', '${PYTHON_DOC_INVENTORY}'|" \
+ -e "/^ 'py3':/d" -i doc/src/conf.py || die
+ einfo "conf.py patched"
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C doc/src -j1 html text
+}
+
+python_install_all() {
+ if use doc; then
+ dohtml -r doc/src/_build/html/.
+ fi
+
+ use examples && local EXAMPLES=( examples/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/psycopg/psycopg-2.7.3.2.ebuild b/dev-python/psycopg/psycopg-2.7.3.2.ebuild
new file mode 100644
index 000000000000..644e9d4faba6
--- /dev/null
+++ b/dev-python/psycopg/psycopg-2.7.3.2.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1 flag-o-matic
+
+MY_PN="${PN}2"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="PostgreSQL database adapter for Python"
+HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="debug doc examples"
+
+RDEPEND=">=dev-db/postgresql-8.1:*"
+DEPEND="${RDEPEND}
+ doc? (
+ >=dev-python/pygments-2.2[${PYTHON_USEDEP}]
+ >=dev-python/sphinx-1.6[${PYTHON_USEDEP}]
+ )"
+
+RESTRICT="test"
+
+# Avoid using mxdatetime: https://bugs.gentoo.org/452028
+# Fixes build error with sphinx: https://bugs.gentoo.org/634730
+PATCHES=(
+ "${FILESDIR}"/psycopg-2.7.3-avoid-mxdatetime.patch
+ "${FILESDIR}"/psycopg-2.7.3-sphinx-1.6.patch
+)
+
+S="${WORKDIR}/${MY_P}"
+
+python_compile() {
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+
+ ! python_is_python3 && append-flags -fno-strict-aliasing
+
+ distutils-r1_python_compile
+}
+
+python_prepare_all() {
+ if use debug; then
+ sed -i 's/^\(define=\)/\1PSYCOPG_DEBUG,/' setup.cfg || die
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C doc/src html text
+}
+
+python_install_all() {
+ if use doc; then
+ dodoc -r doc/src/_build/html
+ dodoc doc/src/_build/text/*
+ fi
+
+ if use examples ; then
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/psycopg/psycopg-2.7.3.ebuild b/dev-python/psycopg/psycopg-2.7.3.ebuild
new file mode 100644
index 000000000000..8e45da307aad
--- /dev/null
+++ b/dev-python/psycopg/psycopg-2.7.3.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1 flag-o-matic
+
+MY_PN="${PN}2"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="PostgreSQL database adapter for Python"
+HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="2"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="debug doc examples"
+
+RDEPEND=">=dev-db/postgresql-8.1:*"
+DEPEND="${RDEPEND}
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ >=dev-python/python-docs-2.7.6-r1:2.7
+ )"
+
+RESTRICT="test"
+# Remove py3.2 entry from intersphinx setting
+PATCHES=( )
+
+S="${WORKDIR}/${MY_P}"
+
+python_compile() {
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+
+ ! python_is_python3 && append-flags -fno-strict-aliasing
+
+ distutils-r1_python_compile
+}
+
+python_prepare_all() {
+ if use debug; then
+ sed -i 's/^\(define=\)/\1PSYCOPG_DEBUG,/' setup.cfg || die
+ fi
+
+ # Source local copy of objects.inv
+ if use doc; then
+ local PYTHON_DOC_ATOM=$(best_version --host-root dev-python/python-docs:2.7)
+ local PYTHON_DOC_VERSION="${PYTHON_DOC_ATOM#dev-python/python-docs-}"
+ local PYTHON_DOC="/usr/share/doc/python-docs-${PYTHON_DOC_VERSION}/html"
+ local PYTHON_DOC_INVENTORY="${PYTHON_DOC}/objects.inv"
+ sed -e "s|'http://docs.python.org/', None|'${PYTHON_DOC}', '${PYTHON_DOC_INVENTORY}'|" \
+ -e "/^ 'py3':/d" -i doc/src/conf.py || die
+ einfo "conf.py patched"
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C doc/src -j1 html text
+}
+
+python_install_all() {
+ if use doc; then
+ dohtml -r doc/src/_build/html/.
+ fi
+
+ use examples && local EXAMPLES=( examples/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/psycopg/psycopg-2.7.4.ebuild b/dev-python/psycopg/psycopg-2.7.4.ebuild
new file mode 100644
index 000000000000..afb10bbc3834
--- /dev/null
+++ b/dev-python/psycopg/psycopg-2.7.4.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1 flag-o-matic
+
+MY_PN="${PN}2"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="PostgreSQL database adapter for Python"
+HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="2"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="debug doc examples"
+
+RDEPEND=">=dev-db/postgresql-8.1:*"
+DEPEND="${RDEPEND}
+ doc? (
+ >=dev-python/pygments-2.2[${PYTHON_USEDEP}]
+ >=dev-python/sphinx-1.6[${PYTHON_USEDEP}]
+ )"
+
+RESTRICT="test"
+
+# Avoid using mxdatetime: https://bugs.gentoo.org/452028
+PATCHES=( "${FILESDIR}"/psycopg-2.7.3-avoid-mxdatetime.patch )
+
+S="${WORKDIR}/${MY_P}"
+
+python_compile() {
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+
+ ! python_is_python3 && append-flags -fno-strict-aliasing
+
+ distutils-r1_python_compile
+}
+
+python_prepare_all() {
+ if use debug; then
+ sed -i 's/^\(define=\)/\1PSYCOPG_DEBUG,/' setup.cfg || die
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C doc/src -j1 html text
+}
+
+python_install_all() {
+ if use doc; then
+ dodoc -r doc/src/_build/html
+ dodoc doc/src/_build/text/*
+ fi
+
+ if use examples ; then
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+
+ distutils-r1_python_install_all
+}