public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-lzo/files/, dev-python/python-lzo/
@ 2020-02-05 20:47 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-02-05 20:47 UTC (permalink / raw
  To: gentoo-commits

commit:     d4c86f3cbfbca1480046fc19bac0aba56975f276
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  5 20:22:50 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb  5 20:47:00 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4c86f3c

dev-python/python-lzo: Remove old (py2)

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/python-lzo/Manifest                  |  2 --
 dev-python/python-lzo/files/lzo2compat.patch    | 13 ---------
 dev-python/python-lzo/python-lzo-1.08-r1.ebuild | 28 -------------------
 dev-python/python-lzo/python-lzo-1.11.ebuild    | 34 -----------------------
 dev-python/python-lzo/python-lzo-1.12.ebuild    | 36 -------------------------
 5 files changed, 113 deletions(-)

diff --git a/dev-python/python-lzo/Manifest b/dev-python/python-lzo/Manifest
index 221e08149a2..c07bc18d739 100644
--- a/dev-python/python-lzo/Manifest
+++ b/dev-python/python-lzo/Manifest
@@ -1,3 +1 @@
-DIST python-lzo-1.08.tar.gz 13046 BLAKE2B ce4e2d2b1497ed93cdc15d157228bd7b3b6395b19808ac9c91ebfc3da6506a0af4d4e770f6e13a23e6ffd6f38cb2fd6e91f949d44680a6ea236e4c3704fb43aa SHA512 94b33e3b0e62b9c8a97147507f4516706d25d62c63ea938f0748e520a3e27760f0e3be142cb3e68aea132ae06759c91b3a4dac8e5010cdfab633e6c8d5904d8c
-DIST python-lzo-1.11.tar.gz 13823 BLAKE2B 4be60c85aae64e8837f7f8ec332c16f8c86d2e8b2e965e783cb9b0c6c942aa13750dc194679b71a6a0d733bee66313b8ca376853cee7063a46567222f80daa7e SHA512 580c68d2a5fdc43f6cb904507795c25b686c42074f217d067f51b336afa75d3eea10fcb7925c84aea352ce4383c591ff70583bef6c2fbc74116487ae87e1f87f
 DIST python-lzo-1.12.tar.gz 14042 BLAKE2B 7375e9b200a17cc1ad2c4dfdbe6491082af8d120b2b659b1e9bbff00eaae568e04dc12e5c13de3a028267a1e8e02bd1522a9335db73fa6a5a4ebc7ca4b341fff SHA512 811bdb282cfaf33427ad641d0342900c5af1f17b7033d76593288c3846b0feefe6ef93253152add97b2d6420f937de2745c8e7508dadf33e72b11545cac3be4d

diff --git a/dev-python/python-lzo/files/lzo2compat.patch b/dev-python/python-lzo/files/lzo2compat.patch
deleted file mode 100644
index 6ce728753df..00000000000
--- a/dev-python/python-lzo/files/lzo2compat.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- setup.py
-+++ setup.py
-@@ -24,8 +24,8 @@
-     include_dirs.append(os.path.join(CURL_DIR, "include"))
-     extra_objects.append(os.path.join(CURL_DIR, "lzo.lib"))
- else:
--    libraries = ["lzo"]
--    ##include_dirs.append("/usr/local/include")
-+    libraries = ["lzo2"]
-+    include_dirs.append("/usr/include/lzo")
-     ##library_dirs.append("/usr/local/lib")
-     ##runtime_library_dirs.append("/usr/local/lib")
- 

diff --git a/dev-python/python-lzo/python-lzo-1.08-r1.ebuild b/dev-python/python-lzo/python-lzo-1.08-r1.ebuild
deleted file mode 100644
index 2c2c9210601..00000000000
--- a/dev-python/python-lzo/python-lzo-1.08-r1.ebuild
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-PYTHON_COMPAT=( python2_7 )
-
-inherit distutils-r1 eutils prefix
-
-DESCRIPTION="Python interface to lzo"
-HOMEPAGE="http://www.oberhumer.com/opensource/lzo/"
-SRC_URI="http://www.oberhumer.com/opensource/lzo/download/LZO-v1/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 x86"
-IUSE=""
-
-DEPEND="dev-libs/lzo:2"
-RDEPEND="${DEPEND}"
-
-python_test() {
-	"${PYTHON}" tests/test.py || die "tests failed"
-}
-
-src_prepare() {
-	epatch "$(PREFIX_LINE_MATCH='/##/!' \
-		prefixify_ro "${FILESDIR}"/lzo2compat.patch)"
-}

diff --git a/dev-python/python-lzo/python-lzo-1.11.ebuild b/dev-python/python-lzo/python-lzo-1.11.ebuild
deleted file mode 100644
index a335c433c10..00000000000
--- a/dev-python/python-lzo/python-lzo-1.11.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python{2_7,3_6} )
-
-inherit distutils-r1 prefix
-
-DESCRIPTION="Python interface to lzo"
-HOMEPAGE="https://github.com/jd-boyd/python-lzo"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="dev-libs/lzo:2"
-DEPEND="${RDEPEND}
-	dev-python/setuptools[${PYTHON_USEDEP}]
-	test? ( dev-python/nose[${PYTHON_USEDEP}] )
-"
-
-src_prepare() {
-	distutils-r1_src_prepare
-	hprefixify setup.py
-}
-
-python_test() {
-	distutils_install_for_testing
-	PYTHONPATH="${TEST_DIR}"/lib nosetests -v || die "tests failed"
-}

diff --git a/dev-python/python-lzo/python-lzo-1.12.ebuild b/dev-python/python-lzo/python-lzo-1.12.ebuild
deleted file mode 100644
index de8b68f68bb..00000000000
--- a/dev-python/python-lzo/python-lzo-1.12.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python{2_7,3_6} )
-
-inherit distutils-r1 prefix
-
-DESCRIPTION="Python interface to lzo"
-HOMEPAGE="https://github.com/jd-boyd/python-lzo"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
-	dev-libs/lzo:2"
-
-DEPEND="
-	${RDEPEND}
-	dev-python/setuptools[${PYTHON_USEDEP}]
-	test? ( dev-python/nose[${PYTHON_USEDEP}] )"
-
-src_prepare() {
-	distutils-r1_src_prepare
-	hprefixify setup.py
-}
-
-python_test() {
-	distutils_install_for_testing
-	PYTHONPATH="${TEST_DIR}"/lib nosetests -v || die "tests failed"
-}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-lzo/files/, dev-python/python-lzo/
@ 2021-08-08  9:29 Louis Sautier
  0 siblings, 0 replies; 2+ messages in thread
From: Louis Sautier @ 2021-08-08  9:29 UTC (permalink / raw
  To: gentoo-commits

commit:     779862562a0dcca72fa43063aae0a6435fb81f6c
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  8 09:27:58 2021 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Sun Aug  8 09:29:31 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77986256

dev-python/python-lzo: enable py3.10, update EAPI 7 -> 8

Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 .../files/python-lzo-1.12-fix-py3.10.patch         | 159 +++++++++++++++++++++
 dev-python/python-lzo/python-lzo-1.12-r2.ebuild    |  34 +++++
 2 files changed, 193 insertions(+)

diff --git a/dev-python/python-lzo/files/python-lzo-1.12-fix-py3.10.patch b/dev-python/python-lzo/files/python-lzo-1.12-fix-py3.10.patch
new file mode 100644
index 00000000000..17bad96d627
--- /dev/null
+++ b/dev-python/python-lzo/files/python-lzo-1.12-fix-py3.10.patch
@@ -0,0 +1,159 @@
+diff --git a/lzomodule.c b/lzomodule.c
+index b5fa542..e9ca432 100644
+--- a/lzomodule.c
++++ b/lzomodule.c
+@@ -31,6 +31,8 @@
+ 
+ #define MODULE_VERSION  "1.12"
+ 
++#define PY_SSIZE_T_CLEAN
++
+ #include <Python.h>
+ #include <lzo/lzo1x.h>
+ 
+@@ -83,7 +85,7 @@ compress(PyObject *dummy, PyObject *args)
+     lzo_uint in_len;
+     lzo_uint out_len;
+     lzo_uint new_len;
+-    int len;
++    Py_ssize_t len;
+     int level = 1;
+     int header = 1;
+     int err;
+@@ -95,6 +97,16 @@ compress(PyObject *dummy, PyObject *args)
+     if (len < 0)
+         return NULL;
+ 
++    if (len > LZO_UINT_MAX) {
++      PyErr_SetString(LzoError, "Input size is larger than LZO_UINT_MAX");
++      return NULL;
++    }
++
++    if ((len + len / 16 + 64 + 3) > LZO_UINT_MAX) {
++      PyErr_SetString(LzoError, "Output size is larger than LZO_UINT_MAX");
++      return NULL;
++    }
++
+     in_len = len;
+     out_len = in_len + in_len / 16 + 64 + 3;
+ 
+@@ -189,7 +201,7 @@ decompress(PyObject *dummy, PyObject *args)
+     lzo_uint in_len;
+     lzo_uint out_len;
+     lzo_uint new_len;
+-    int len;
++    Py_ssize_t len;
+     int buflen = -1;
+     int header = 1;
+     int err;
+@@ -274,7 +286,7 @@ optimize(PyObject *dummy, PyObject *args)
+     lzo_uint in_len;
+     lzo_uint out_len;
+     lzo_uint new_len;
+-    int len;
++    Py_ssize_t len;
+     int err;
+     int header = 1;
+     int buflen = -1;
+@@ -356,7 +368,7 @@ static PyObject *
+ adler32(PyObject *dummy, PyObject *args)
+ {
+     char *buf;
+-    int len;
++    Py_ssize_t len;
+     unsigned long val = 1; /* == lzo_adler32(0, NULL, 0); */
+ 
+     UNUSED(dummy);
+@@ -392,7 +404,7 @@ static PyObject *
+ crc32(PyObject *dummy, PyObject *args)
+ {
+     char *buf;
+-    int len;
++    Py_ssize_t len;
+     unsigned long val = 0; /* == lzo_crc32(0, NULL, 0); */
+ 
+     UNUSED(dummy);
+diff --git a/tests/test.py b/tests/test.py
+index 9a96ce7..af761d9 100644
+--- a/tests/test.py
++++ b/tests/test.py
+@@ -96,11 +96,17 @@ def test_version():
+ 
+ def test_lzo():
+     yield gen, b"aaaaaaaaaaaaaaaaaaaaaaaa"
+-    yield gen_raw, b"aaaaaaaaaaaaaaaaaaaaaaaa"
+     yield gen, b"abcabcabcabcabcabcabcabc"
+-    yield gen_raw, b"abcabcabcabcabcabcabcabc"
+     yield gen, b"abcabcabcabcabcabcabcabc", 9
++
++
++def test_lzo_raw():
++    yield gen_raw, b"aaaaaaaaaaaaaaaaaaaaaaaa"
++    yield gen_raw, b"abcabcabcabcabcabcabcabc"
+     yield gen_raw, b"abcabcabcabcabcabcabcabc", 9
++
++
++def test_lzo_empty():
+     yield gen, b""
+     yield gen_raw, b""
+ 
+@@ -113,41 +119,8 @@ def test_lzo_raw_big():
+     gen_raw(b" " * 131072)
+ 
+ 
+-def main(args):
+-    # display version information and module documentation
+-    print("LZO version %s (0x%x), %s" % (lzo.LZO_VERSION_STRING, lzo.LZO_VERSION, lzo.LZO_VERSION_DATE))
+-    print(lzo.__file__)
+-    print()
+-    print(lzo.__doc__)
+-
+-    # display additional module information
+-    ## print dir(lzo)
+-    ## print_modinfo()
+-
+-    # compress some simple strings
+-    gen(b"aaaaaaaaaaaaaaaaaaaaaaaa")
+-    gen_raw(b"aaaaaaaaaaaaaaaaaaaaaaaa")
+-    gen(b"abcabcabcabcabcabcabcabc")
+-    gen_raw(b"abcabcabcabcabcabcabcabc")
+-    gen(b"abcabcabcabcabcabcabcabc", level=9)
+-    gen_raw(b"abcabcabcabcabcabcabcabc", level=9)
+-    gen(b" " * 131072)
+-    gen_raw(b" " * 131072)
+-    gen(b"")
+-    gen_raw(b"")
+-    print("Simple compression test passed.")
+-
+-    test_version()
+-
+-    # force an exception (because of invalid compressed data)
+-    assert issubclass(lzo.error, Exception)
+-    try:
+-        x = lzo.decompress("xx")
+-    except lzo.error:
+-        pass
+-    else:
+-        print("Exception handling does NOT work !")
+-    return 0
+-
+-if __name__ == '__main__':
+-    sys.exit(main(sys.argv))
++if sys.maxsize > 1<<32:
++    # This test raises OverflowError on 32-bit Pythons. Compressing
++    # this much data requires a 64-bit system.
++    def test_lzo_compress_extremely_big():
++        b = lzo.compress(bytes(bytearray((1024**3)*2)))
+diff --git a/tests/util.py b/tests/util.py
+index 0a2f4ed..c7bd5f0 100644
+--- a/tests/util.py
++++ b/tests/util.py
+@@ -45,7 +45,7 @@ def get_sys_path(p=None):
+     if p: p0 = p[0]
+     #
+     plat = get_platform()
+-    plat_specifier = "%s-%s" % (plat, sys.version[:3])
++    plat_specifier = "%s-%d.%d" % (plat, sys.version_info[0], sys.version_info[1])
+     ##print plat, plat_specifier
+     #
+     for prefix in (p0, os.curdir, os.pardir,):

diff --git a/dev-python/python-lzo/python-lzo-1.12-r2.ebuild b/dev-python/python-lzo/python-lzo-1.12-r2.ebuild
new file mode 100644
index 00000000000..f3636cc05cb
--- /dev/null
+++ b/dev-python/python-lzo/python-lzo-1.12-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_SETUPTOOLS=no
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit distutils-r1 prefix
+
+DESCRIPTION="Python interface to lzo"
+HOMEPAGE="https://github.com/jd-boyd/python-lzo"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="dev-libs/lzo:2"
+DEPEND="${RDEPEND}"
+
+# We can't use pytest at the moment because the package uses "yield tests"
+# https://docs.pytest.org/en/6.2.x/deprecations.html#yield-tests
+distutils_enable_tests --install nose
+
+PATCHES=(
+	# Upstream commits: 52440984, e63333e5, 15c40595 and 0a4272fc
+	"${FILESDIR}/${P}-fix-py3.10.patch"
+)
+
+python_prepare_all() {
+	hprefixify setup.py
+	distutils-r1_python_prepare_all
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-08  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-08  9:29 [gentoo-commits] repo/gentoo:master commit in: dev-python/python-lzo/files/, dev-python/python-lzo/ Louis Sautier
  -- strict thread matches above, loose matches on Subject: below --
2020-02-05 20:47 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox