Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-ctypeslib2 for 
openSUSE:Factory checked in at 2021-02-19 23:44:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ctypeslib2 (Old)
 and      /work/SRC/openSUSE:Factory/.python-ctypeslib2.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-ctypeslib2"

Fri Feb 19 23:44:32 2021 rev:3 rq:873595 version:2.2.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ctypeslib2/python-ctypeslib2.changes      
2020-05-28 09:19:58.913281631 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-ctypeslib2.new.28504/python-ctypeslib2.changes
   2021-02-19 23:45:27.355374605 +0100
@@ -1,0 +2,9 @@
+Fri Feb 19 02:18:14 UTC 2021 - John Vandenberg <[email protected]>
+
+- Switch to PyPI source
+- Skip python3.6 on Tumbleweed due to missing python36-clang
+- Add clang-version.patch to support more clang versions
+- Update to v2.2.3
+  * See https://github.com/trolldbois/ctypeslib/compare/2.2.2...2.2.3
+  
+-------------------------------------------------------------------

Old:
----
  ctypeslib2-2.2.2.tar.gz

New:
----
  clang-version.patch
  ctypeslib2-2.2.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-ctypeslib2.spec ++++++
--- /var/tmp/diff_new_pack.eCH5Lz/_old  2021-02-19 23:45:27.939375176 +0100
+++ /var/tmp/diff_new_pack.eCH5Lz/_new  2021-02-19 23:45:27.943375181 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-ctypeslib2
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,6 +18,7 @@
 
 # No python2-clang
 %define skip_python2 1
+%define skip_python36 1
 %define oldpython python
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %ifarch %{ix86} x86_64
@@ -26,20 +27,22 @@
 %bcond_with test
 %endif
 Name:           python-ctypeslib2
-Version:        2.2.2
+Version:        2.2.3
 Release:        0
 Summary:        Python FFI toolkit using clang
 License:        MIT
 Group:          Development/Languages/Python
 URL:            https://github.com/trolldbois/ctypeslib
-Source:         
https://github.com/trolldbois/ctypeslib/archive/%{version}.tar.gz#/ctypeslib2-%{version}.tar.gz
-BuildRequires:  %{python_module clang}
+Source:         
https://files.pythonhosted.org/packages/source/c/ctypeslib2/ctypeslib2-%{version}.tar.gz
+Patch0:         
https://github.com/trolldbois/ctypeslib/commit/98060fe704f7195356d754a78c67c6fd4756daa7.patch#/clang-version.patch
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module testsuite}
 BuildRequires:  fdupes
+BuildRequires:  gcc
 BuildRequires:  python-rpm-macros
-Requires:       python-clang
+BuildRequires:  python3-clang
+Requires:       python3-clang
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
 BuildArch:      noarch
@@ -53,13 +56,22 @@
 Python FFI toolkit using clang.
 
 %prep
-%setup -q -n ctypeslib-%{version}
+%setup -q -n ctypeslib2-%{version}
+%patch0 -p1
+sed -i '1{/^#!/d}' ctypeslib/clang2py.py
+
 # https://github.com/trolldbois/ctypeslib/issues/60
-sed -i 's/test_variable/_test_variable/' test/test_clang2py.py
+sed -Ei 's/(test_class|test_macro|test_variable)/_\1/' test/test_clang2py.py
+
+# Skipped on master
+# 
https://github.com/trolldbois/ctypeslib/commit/ef141bb04ef1f9f50774a52195d75a71d55b2749#diff-056c7a7f3e89754296c5f3478ac0ad54630c347a1dc5bf22311ca059cde0ccde
 sed -i 's/test_unicode_cpp11/_test_unicode_cpp11/' test/test_types_values.py
 sed -i 's/test_unicode/_test_unicode/' test/test_types_values.py
+
 # https://github.com/trolldbois/ctypeslib/issues/61
 sed -i 
's/test_extern_function_pointer_multiarg/_test_extern_function_pointer_multiarg/'
 test/test_types_values.py
+sed -i 's/test_callbacks/_test_callbacks/' test/test_callbacks.py
+
 # https://github.com/trolldbois/ctypeslib/issues/62
 sed -i 's/test_includes/_test_includes/' test/test_fast_clang.py
 
@@ -73,14 +85,18 @@
 
 %if %{with test}
 %check
+CFLAGS="-Wall -Wextra -Werror -std=c99 -pedantic -fpic"
+LDFLAGS="-shared"
+gcc $CFLAGS $LDFLAGS -o test/data/test-callbacks.so test/data/test-callbacks.c
+
 export LANG=en_US.UTF-8
+export PYTHONDONTWRITEBYTECODE=1
 %{python_expand \
   bin_dir=bin-%{$python_version}
   mkdir $bin_dir
   ln -s %{buildroot}%{_bindir}/clang2py-%{$python_version} $bin_dir/clang2py
   export PATH=$PATH:`pwd`/$bin_dir
-  export PYTHONPATH=:test:./build/lib:%{buildroot}%{$python_sitearch}
-  export PYTHONDONTWRITEBYTECODE=1
+  export PYTHONPATH=:test/:%{buildroot}%{$python_sitelib}
   $python -m unittest discover -s test/ -v
 }
 %endif

++++++ clang-version.patch ++++++
>From 98060fe704f7195356d754a78c67c6fd4756daa7 Mon Sep 17 00:00:00 2001
From: Loic Jaquemet <[email protected]>
Date: Tue, 16 Feb 2021 18:14:32 -0700
Subject: [PATCH] add an helpful helper for clang python & .so in -version

---
 ctypeslib/__init__.py | 8 +++++++-
 ctypeslib/clang2py.py | 3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ctypeslib/__init__.py b/ctypeslib/__init__.py
index a332e9e..c8fabfd 100644
--- a/ctypeslib/__init__.py
+++ b/ctypeslib/__init__.py
@@ -23,7 +23,10 @@
 try:
     from ctypes.util import find_library
     # debug for python-haystack travis-ci
-    for version in ["libclang", "clang", "clang-11", "clang-5.0", "clang-4.0", 
"clang-3.9", "clang-3.8", "clang-3.7"]:
+    v1 = ["clang-%d" % _ for _ in range(14, 6, -1)]
+    v2 = ["clang-%f" % _ for _ in range(6, 3, -1)]
+    v_list = v1 + v2 + ["clang-3.9", "clang-3.8", "clang-3.7"]
+    for version in ["libclang", "clang"] + v_list:
         if find_library(version) is not None:
             from clang import cindex
             cindex.Config.set_library_file(find_library(version))
@@ -33,6 +36,9 @@
             # On darwin, consider that Xcode should be installed in its 
default path.
             from clang import cindex
             
cindex.Config.set_library_file('/Applications/Xcode.app/Contents/Frameworks/libclang.dylib')
+
+    def ctypes_version():
+        return cindex.Config.library_file
 except ImportError as e:
     print(e)
 
diff --git a/ctypeslib/clang2py.py b/ctypeslib/clang2py.py
index 611cc0d..465df84 100755
--- a/ctypeslib/clang2py.py
+++ b/ctypeslib/clang2py.py
@@ -13,6 +13,7 @@
 from ctypeslib.codegen import typedesc
 from ctypeslib.codegen.codegenerator import generate_code
 from ctypeslib.library import Library
+from ctypeslib import ctypes_version
 
 ################################################################
 windows_dll_names = """\
@@ -175,7 +176,7 @@ def windows_dlls(option, opt, value, parser):
                         default=False)
     parser.add_argument('-V', '--version',
                         action='version',
-                        version="%(prog)s version " + version)
+                        version="%(prog)s version " + version + " clang: " + 
ctypes_version())
 
     parser.add_argument("-w",
                         action="store",
++++++ ctypeslib2-2.2.2.tar.gz -> ctypeslib2-2.2.3.tar.gz ++++++
++++ 4517 lines of diff (skipped)

Reply via email to