forked from pool/python-cffi
- update to 1.10.0: * Issue #295: use calloc() directly instead of PyObject_Malloc()+memset() to handle ffi.new() with a default allocator. Speeds up ffi.new(large-array) where most of the time you never touch most of the array. * Some OS/X build fixes (“only with Xcode but without CLT”). * Improve a couple of error messages: when getting mismatched versions of cffi and its backend; and when calling functions which cannot be called with libffi because an argument is a struct that is “too complicated” (and not a struct pointer, which always works). * Add support for some unusual compilers (non-msvc, non-gcc, non-icc, non-clang) * Implemented the remaining cases for ffi.from_buffer. Now all buffer/memoryview objects can be passed. The one remaining check is against passing unicode strings in Python 2. (They support the buffer interface, but that gives the raw bytes behind the UTF16/UCS4 storage, which is most of the times not what you expect. In Python 3 this has been fixed and the unicode strings don’t support the memoryview interface any more.) * The C type _Bool or bool now converts to a Python boolean when reading, instead of the content of the byte as an integer. The potential incompatibility here is what occurs if the byte contains a value different from 0 and 1. Previously, it would just return it; with this change, CFFI raises an exception in this case. But this case means “undefined behavior” in C; if you really have to interface with a library relying on this, don’t use bool in the CFFI side. Also, it is still valid to use a byte string as initializer for a bool[], but now it must only contain \x00 or \x01. As an aside, ffi.string() no longer works on bool[] (but it never made much sense, as this function stops at the first zero). * ffi.buffer is now the name of cffi’s buffer type, and ffi.buffer() works like before but is the constructor of that type. * ffi.addressof(lib, "name") now works also in in-line mode, not only in out-of-line mode. This is useful for taking the address of global variables. OBS-URL: https://build.opensuse.org/request/show/507126 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=35
66 lines
2.0 KiB
RPMSpec
66 lines
2.0 KiB
RPMSpec
#
|
|
# spec file for package python-cffi
|
|
#
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
%define modname cffi
|
|
Name: python-%{modname}
|
|
Version: 1.10.0
|
|
Release: 0
|
|
Summary: Foreign Function Interface for Python calling C code
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
Url: http://%{modname}.readthedocs.org
|
|
Source0: https://files.pythonhosted.org/packages/source/c/%{modname}/%{modname}-%{version}.tar.gz
|
|
Source1: python-cffi-rpmlintrc
|
|
BuildRequires: %{python_module devel}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: python-rpm-macros
|
|
# Documentation requirements:
|
|
BuildRequires: %{python_module pycparser}
|
|
BuildRequires: %{python_module pytest}
|
|
Requires: python-pycparser
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
BuildRequires: pkgconfig(libffi)
|
|
|
|
%python_subpackages
|
|
|
|
%description
|
|
Foreign Function Interface for Python calling C code. The aim of this project
|
|
is to provide a convenient and reliable way of calling C code from Python.
|
|
|
|
%prep
|
|
%setup -q -n %{modname}-%{version}
|
|
|
|
%build
|
|
export CFLAGS="%{optflags}"
|
|
%python_build
|
|
|
|
%install
|
|
%python_install
|
|
|
|
%check
|
|
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} py.test-%$python_bin_suffix
|
|
|
|
%files %{python_files}
|
|
%defattr(-,root,root,-)
|
|
%doc LICENSE
|
|
%{python_sitearch}/*
|
|
|
|
%changelog
|