[packages/libfreenect] - added cython fixes, release 4
qboosh
qboosh at pld-linux.org
Tue Apr 8 21:55:49 CEST 2025
commit 9c12edc120f8c9181f4c617909ad4080dd674520
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Apr 8 21:50:16 2025 +0200
- added cython fixes, release 4
libfreenect-cython.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++++
libfreenect.spec | 4 +++-
2 files changed, 62 insertions(+), 1 deletion(-)
---
diff --git a/libfreenect.spec b/libfreenect.spec
index 23a0aff..95ffc9e 100644
--- a/libfreenect.spec
+++ b/libfreenect.spec
@@ -9,7 +9,7 @@ Summary: Userspace driver for the Microsoft Kinect
Summary(pl.UTF-8): Sterownik przestrzeni użytkownika dla kontrolera Microsoft Kinect
Name: libfreenect
Version: 0.6.4
-Release: 3
+Release: 4
License: Apache v2.0 or GPL v2
Group: Libraries
#Source0Download: https://github.com/OpenKinect/libfreenect/releases
@@ -17,6 +17,7 @@ Source0: https://github.com/OpenKinect/libfreenect/archive/v%{version}/%{name}-%
# Source0-md5: a277bfd10d08ff44f4db7ac72db3c5e2
Patch0: %{name}-link.patch
Patch1: %{name}-install.patch
+Patch2: %{name}-cython.patch
URL: https://openkinect.org/wiki/Main_Page
BuildRequires: cmake >= 3.1.0
BuildRequires: libstdc++-devel >= 6:4.7
@@ -149,6 +150,7 @@ Interfejs Pythona 3 do libfreenect.
%setup -q
%patch -P 0 -p1
%patch -P 1 -p1
+%patch -P 2 -p1
%{__sed} -i -e '1s,/usr/bin/env python2,%{__python},' src/fwfetcher.py
diff --git a/libfreenect-cython.patch b/libfreenect-cython.patch
new file mode 100644
index 0000000..22ade44
--- /dev/null
+++ b/libfreenect-cython.patch
@@ -0,0 +1,59 @@
+--- libfreenect-0.6.4/wrappers/python/freenect.pyx.orig 2022-09-19 23:00:01.000000000 +0200
++++ libfreenect-0.6.4/wrappers/python/freenect.pyx 2025-04-07 21:11:09.510328884 +0200
+@@ -27,7 +27,7 @@ import numpy as np
+ cimport numpy as npc
+
+ cdef extern from "numpy/arrayobject.h":
+- void import_array()
++ int _import_array()
+ cdef object PyArray_SimpleNewFromData(int nd, npc.npy_intp *dims,
+ int typenum, void *data)
+
+@@ -322,7 +322,7 @@ cpdef open_device(CtxPtr ctx, int index)
+
+ _depth_cb, _video_cb = None, None
+
+-cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
++cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) noexcept with gil:
+ cdef freenect_frame_mode mode = freenect_get_current_depth_mode(dev)
+ if not mode.is_valid:
+ return
+@@ -333,7 +333,7 @@ cdef void depth_cb(freenect_device *dev,
+ pydata = _depth_cb_np(data, &mode)
+ _depth_cb(dev_out, pydata, timestamp)
+
+-cdef void video_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
++cdef void video_cb(freenect_device *dev, void *data, uint32_t timestamp) noexcept with gil:
+ cdef freenect_frame_mode mode = freenect_get_current_video_mode(dev)
+ if not mode.is_valid:
+ return
+@@ -455,7 +455,7 @@ def base_runloop(CtxPtr ctx, body=None):
+ except Kill:
+ pass
+
+-import_array()
++_import_array()
+
+ cdef object _depth_cb_np(void *data, freenect_frame_mode *mode):
+ cdef npc.npy_intp dims[2]
+--- libfreenect-0.6.4/wrappers/python/CMakeLists.txt.orig 2025-04-08 19:11:43.732789333 +0200
++++ libfreenect-0.6.4/wrappers/python/CMakeLists.txt 2025-04-08 20:06:35.680538009 +0200
+@@ -15,7 +15,8 @@ else()
+ find_package(Python${Python_BUILD_VERSION} REQUIRED COMPONENTS Interpreter Development)
+ endif()
+
+-find_program(CYTHON_EXECUTABLE cython)
++find_program(CYTHON2_EXECUTABLE cython2)
++find_program(CYTHON3_EXECUTABLE cython3)
+
+ # Figure out installation path
+ # CMake populates this var automatically but we need to specify prefix
+@@ -34,7 +35,7 @@ execute_process(COMMAND
+ # How to Cython the .pyx file
+ add_custom_command(OUTPUT freenect${Python_BUILD_VERSION}.c
+ COMMAND
+- ${CYTHON_EXECUTABLE}
++ ${CYTHON${Python_BUILD_VERSION}_EXECUTABLE}
+ -${Python_BUILD_VERSION}
+ -o freenect${Python_BUILD_VERSION}.c
+ "${CMAKE_CURRENT_SOURCE_DIR}/freenect.pyx")
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libfreenect.git/commitdiff/9c12edc120f8c9181f4c617909ad4080dd674520
More information about the pld-cvs-commit
mailing list