From c194901346a5e8e908198cd7c6c3d3dbdd4fda31 Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 19 Sep 2019 18:15:50 -0300 Subject: main/py3-cffi: rename from py-cffi --- main/py-cffi/APKBUILD | 61 -------------------------------------- main/py-cffi/musl-compat.patch | 65 ----------------------------------------- main/py3-cffi/APKBUILD | 61 ++++++++++++++++++++++++++++++++++++++ main/py3-cffi/musl-compat.patch | 65 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 main/py-cffi/APKBUILD delete mode 100644 main/py-cffi/musl-compat.patch create mode 100644 main/py3-cffi/APKBUILD create mode 100644 main/py3-cffi/musl-compat.patch diff --git a/main/py-cffi/APKBUILD b/main/py-cffi/APKBUILD deleted file mode 100644 index 7190fa1a04..0000000000 --- a/main/py-cffi/APKBUILD +++ /dev/null @@ -1,61 +0,0 @@ -# Contributor: -# Maintainer: -pkgname=py-cffi -_pkgname=cffi -pkgver=1.11.5 -pkgrel=4 -pkgdesc="A foreign function interface for calling C code from Python" -url="http://cffi.readthedocs.org/" -arch="all" -license="MIT" -depends="" -makedepends="python2-dev python3-dev py-setuptools libffi-dev" -checkdepends="py2-pytest py2-cparser py3-pytest py3-cparser" -subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2" -case "$CARCH" in - ppc64le|x86|aarch64) options="!check" # test failures -esac -source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz - musl-compat.patch" -builddir="$srcdir/$_pkgname-$pkgver" - -build() { - cd "$builddir" - python2 setup.py build - python3 setup.py build -} - -check() { - cd "$builddir" - python2 setup.py build_ext -i - python2 -m pytest --disable-pytest-warnings c/ testing/ - python3 setup.py build_ext -i - python3 -m pytest --disable-pytest-warnings c/ testing/ || true -} - -package() { - mkdir -p "$pkgdir" -} - -_py() { - local python="$1" - pkgdesc="$pkgdesc ${python#python}" - install_if="$pkgname=$pkgver-r$pkgrel $python" - - cd "$builddir" - $python setup.py install --prefix=/usr --root="$subpkgdir" -} - -_py2() { - depends="py2-cparser" - replaces="$pkgname" - _py python2 -} - -_py3() { - depends="py3-cparser" - _py python3 -} - -sha512sums="6770d5293cfd7405e733d60c96655641b5bcc5878fc66a737f4a8308f465d459ee0e3fcaa47893d8f57fb195e5534dd7e4728c868f33d7e657688f45e1fb1880 cffi-1.11.5.tar.gz -dd8d1ee2bc8965baa9e9caf7c29d4bb7616d5429de931c11845f7e4cab0d3a065429cd2a93d493eaf81a7ea2e8d25e4d3d3f330ab65c0f9b3bb3a6994f2f8ee9 musl-compat.patch" diff --git a/main/py-cffi/musl-compat.patch b/main/py-cffi/musl-compat.patch deleted file mode 100644 index 1145250a1b..0000000000 --- a/main/py-cffi/musl-compat.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- a/c/test_c.py -+++ b/c/test_c.py -@@ -86,7 +86,6 @@ - if sys.platform.startswith("linux"): - RTLD_NODELETE - RTLD_NOLOAD -- RTLD_DEEPBIND - - def test_new_primitive_type(): - py.test.raises(KeyError, new_primitive_type, "foo") -@@ -1237,8 +1236,7 @@ - def test_write_variable(): - ## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard - ## https://bugs.pypy.org/issue1643 -- if not sys.platform.startswith("linux"): -- py.test.skip("untested") -+ py.test.skip("'stderr' is read-only in musl") - BVoidP = new_pointer_type(new_void_type()) - ll = find_and_load_library('c') - stderr = ll.read_variable(BVoidP, "stderr") ---- a/testing/cffi0/test_function.py -+++ b/testing/cffi0/test_function.py -@@ -166,7 +166,7 @@ - b"hello, world!\n" - b"hello, world2!\n" - b"hello int 42 long 84 long long 168\n" -- b"hello (nil)\n") -+ b"hello 0\n") - - def test_must_specify_type_of_vararg(self): - ffi = FFI(backend=self.Backend()) -@@ -249,8 +249,7 @@ - assert res == 5 - - def test_write_variable(self): -- if not sys.platform.startswith('linux'): -- py.test.skip("probably no symbol 'stdout' in the lib") -+ py.test.skip("'stdout' is read-only in musl") - ffi = FFI(backend=self.Backend()) - ffi.cdef(""" - void *stdout; ---- a/testing/cffi0/test_verify.py -+++ b/testing/cffi0/test_verify.py -@@ -1612,8 +1612,7 @@ - assert func() == 42 - - def test_FILE_stored_in_stdout(): -- if not sys.platform.startswith('linux'): -- py.test.skip("likely, we cannot assign to stdout") -+ py.test.skip("'stdout' is read-only in musl") - ffi = FFI() - ffi.cdef("int printf(const char *, ...); FILE *setstdout(FILE *);") - lib = ffi.verify(""" ---- a/testing/cffi1/test_verify1.py -+++ b/testing/cffi1/test_verify1.py -@@ -1576,8 +1576,7 @@ - assert func() == 42 - - def test_FILE_stored_in_stdout(): -- if not sys.platform.startswith('linux'): -- py.test.skip("likely, we cannot assign to stdout") -+ py.test.skip("'stdout' is read-only in musl") - ffi = FFI() - ffi.cdef("int printf(const char *, ...); FILE *setstdout(FILE *);") - lib = ffi.verify(""" diff --git a/main/py3-cffi/APKBUILD b/main/py3-cffi/APKBUILD new file mode 100644 index 0000000000..7190fa1a04 --- /dev/null +++ b/main/py3-cffi/APKBUILD @@ -0,0 +1,61 @@ +# Contributor: +# Maintainer: +pkgname=py-cffi +_pkgname=cffi +pkgver=1.11.5 +pkgrel=4 +pkgdesc="A foreign function interface for calling C code from Python" +url="http://cffi.readthedocs.org/" +arch="all" +license="MIT" +depends="" +makedepends="python2-dev python3-dev py-setuptools libffi-dev" +checkdepends="py2-pytest py2-cparser py3-pytest py3-cparser" +subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2" +case "$CARCH" in + ppc64le|x86|aarch64) options="!check" # test failures +esac +source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz + musl-compat.patch" +builddir="$srcdir/$_pkgname-$pkgver" + +build() { + cd "$builddir" + python2 setup.py build + python3 setup.py build +} + +check() { + cd "$builddir" + python2 setup.py build_ext -i + python2 -m pytest --disable-pytest-warnings c/ testing/ + python3 setup.py build_ext -i + python3 -m pytest --disable-pytest-warnings c/ testing/ || true +} + +package() { + mkdir -p "$pkgdir" +} + +_py() { + local python="$1" + pkgdesc="$pkgdesc ${python#python}" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" +} + +_py2() { + depends="py2-cparser" + replaces="$pkgname" + _py python2 +} + +_py3() { + depends="py3-cparser" + _py python3 +} + +sha512sums="6770d5293cfd7405e733d60c96655641b5bcc5878fc66a737f4a8308f465d459ee0e3fcaa47893d8f57fb195e5534dd7e4728c868f33d7e657688f45e1fb1880 cffi-1.11.5.tar.gz +dd8d1ee2bc8965baa9e9caf7c29d4bb7616d5429de931c11845f7e4cab0d3a065429cd2a93d493eaf81a7ea2e8d25e4d3d3f330ab65c0f9b3bb3a6994f2f8ee9 musl-compat.patch" diff --git a/main/py3-cffi/musl-compat.patch b/main/py3-cffi/musl-compat.patch new file mode 100644 index 0000000000..1145250a1b --- /dev/null +++ b/main/py3-cffi/musl-compat.patch @@ -0,0 +1,65 @@ +--- a/c/test_c.py ++++ b/c/test_c.py +@@ -86,7 +86,6 @@ + if sys.platform.startswith("linux"): + RTLD_NODELETE + RTLD_NOLOAD +- RTLD_DEEPBIND + + def test_new_primitive_type(): + py.test.raises(KeyError, new_primitive_type, "foo") +@@ -1237,8 +1236,7 @@ + def test_write_variable(): + ## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard + ## https://bugs.pypy.org/issue1643 +- if not sys.platform.startswith("linux"): +- py.test.skip("untested") ++ py.test.skip("'stderr' is read-only in musl") + BVoidP = new_pointer_type(new_void_type()) + ll = find_and_load_library('c') + stderr = ll.read_variable(BVoidP, "stderr") +--- a/testing/cffi0/test_function.py ++++ b/testing/cffi0/test_function.py +@@ -166,7 +166,7 @@ + b"hello, world!\n" + b"hello, world2!\n" + b"hello int 42 long 84 long long 168\n" +- b"hello (nil)\n") ++ b"hello 0\n") + + def test_must_specify_type_of_vararg(self): + ffi = FFI(backend=self.Backend()) +@@ -249,8 +249,7 @@ + assert res == 5 + + def test_write_variable(self): +- if not sys.platform.startswith('linux'): +- py.test.skip("probably no symbol 'stdout' in the lib") ++ py.test.skip("'stdout' is read-only in musl") + ffi = FFI(backend=self.Backend()) + ffi.cdef(""" + void *stdout; +--- a/testing/cffi0/test_verify.py ++++ b/testing/cffi0/test_verify.py +@@ -1612,8 +1612,7 @@ + assert func() == 42 + + def test_FILE_stored_in_stdout(): +- if not sys.platform.startswith('linux'): +- py.test.skip("likely, we cannot assign to stdout") ++ py.test.skip("'stdout' is read-only in musl") + ffi = FFI() + ffi.cdef("int printf(const char *, ...); FILE *setstdout(FILE *);") + lib = ffi.verify(""" +--- a/testing/cffi1/test_verify1.py ++++ b/testing/cffi1/test_verify1.py +@@ -1576,8 +1576,7 @@ + assert func() == 42 + + def test_FILE_stored_in_stdout(): +- if not sys.platform.startswith('linux'): +- py.test.skip("likely, we cannot assign to stdout") ++ py.test.skip("'stdout' is read-only in musl") + ffi = FFI() + ffi.cdef("int printf(const char *, ...); FILE *setstdout(FILE *);") + lib = ffi.verify(""" -- cgit v1.3