[packages/libfreenect] - new
qboosh
qboosh at pld-linux.org
Sun Mar 15 08:35:10 CET 2020
commit 580dd7a4d2f6004a9958aa30e102ba3d116e3f60
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Mar 15 08:36:00 2020 +0100
- new
libfreenect-install.patch | 22 +++++
libfreenect-link.patch | 11 +++
libfreenect.spec | 241 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 274 insertions(+)
---
diff --git a/libfreenect.spec b/libfreenect.spec
new file mode 100644
index 0000000..619c07b
--- /dev/null
+++ b/libfreenect.spec
@@ -0,0 +1,241 @@
+#
+# Conditional build:
+%bcond_without opencv # OpenCV wrapper
+%bcond_without openni2 # OpenNI2 driver
+%bcond_without python2 # Python 2.x extension
+%bcond_without python3 # Python 3.x extension
+#
+Summary: Userspace driver for the Microsoft Kinect
+Summary(pl.UTF-8): Sterownik przestrzeni użytkownika dla kontrolera Microsoft Kinect
+Name: libfreenect
+Version: 0.6.0
+Release: 1
+License: Apache v2.0 or GPL v2
+Group: Libraries
+#Source0Download: https://github.com/OpenKinect/libfreenect/releases
+Source0: https://github.com/OpenKinect/libfreenect/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: cc6005158c2ea4654aff31cfd3319186
+Patch0: %{name}-link.patch
+Patch1: %{name}-install.patch
+URL: https://openkinect.org/wiki/Main_Page
+BuildRequires: cmake >= 3.1.0
+BuildRequires: libstdc++-devel >= 6:4.7
+BuildRequires: libusb-devel >= 1.0.18
+%{?with_opencv:BuildRequires: opencv-devel}
+%if %{with python2}
+BuildRequires: python-Cython
+BuildRequires: python-devel >= 1:2.7
+BuildRequires: python-numpy-devel
+%endif
+%if %{with python3}
+BuildRequires: python3-Cython
+BuildRequires: python3-devel >= 1:3.3
+BuildRequires: python3-numpy-devel
+%endif
+Requires: libusb >= 1.0.18
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+libfreenect is a userspace driver for the Microsoft Kinect. It runs on
+Linux, OSX, and Windows and supports:
+- RGB and Depth Images
+- Motors
+- Accelerometer
+- LED
+- Audio
+
+Notice: for the newer Kinect v2 (XBox One), use libfreenect 2 instead.
+
+%description -l pl.UTF-8
+libfreenect to sterownik przestrzeni użytkownika dla kontrolera
+Microsoft Kinect. Działa na Linuksie, OSX oraz Windows i obsługuje:
+- obrazy RGB z głębią
+- silniki
+- akcelerometr
+- LED
+- dźwięk
+
+Uwaga: do nowszego Kinecta v2 (XBox One) należy używać libfreenect2.
+
+%package fakenect
+Summary: Fakenect mock library
+Summary(pl.UTF-8): Biblioteka atrapy fakenect
+Group: Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description fakenect
+Fakenect mock library.
+
+%description fakenect -l pl.UTF-8
+Biblioteka atrapy fakenect.
+
+%package opencv
+Summary: OpenCV wrapper for libfreenect
+Summary(pl.UTF-8): Obudowanie OpenCV do biblioteki libfreenect
+Group: Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description opencv
+OpenCV wrapper for libfreenect.
+
+%description opencv -l pl.UTF-8
+Obudowanie OpenCV do biblioteki libfreenect.
+
+%package -n OpenNI2-driver-freenect
+Summary: OpenNI2 driver for Microsoft Kinect
+Summary(pl.UTF-8): Sterownik do kontrolera Microsoft Kinect dla platformy OpenNI2
+Group: Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: OpenNI2
+
+%description -n OpenNI2-driver-freenect
+OpenNI2 driver for Microsoft Kinect.
+
+%description -n OpenNI2-driver-freenect -l pl.UTF-8
+Sterownik do kontrolera Microsoft Kinect dla platformy OpenNI2.
+
+%package devel
+Summary: Header files for libfreenect libraries
+Summary(pl.UTF-8): Pliki nagłówkowe bibliotek libfreenect
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: libusb-devel >= 1.0.18
+
+%description devel
+Header files for libfreenect libraries.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe bibliotek libfreenect.
+
+%package static
+Summary: Static libfreenect libraries
+Summary(pl.UTF-8): Statyczne biblioteki libfreenect
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static libfreenect libraries.
+
+%description static -l pl.UTF-8
+Statyczne biblioteki libfreenect.
+
+%package -n python-freenect
+Summary: Python 2 interface to libfreenect
+Summary(pl.UTF-8): Interfejs Pythona 2 do libfreenect
+Group: Libraries/Python
+Requires: %{name} = %{version}-%{release}
+Requires: python-libs
+
+%description -n python-freenect
+Python 2 interface to libfreenect.
+
+%description -n python-freenect -l pl.UTF-8
+Interfejs Pythona 2 do libfreenect.
+
+%package -n python3-freenect
+Summary: Python 3 interface to libfreenect
+Summary(pl.UTF-8): Interfejs Pythona 3 do libfreenect
+Group: Libraries/Python
+Requires: %{name} = %{version}-%{release}
+Requires: python3-libs
+
+%description -n python3-freenect
+Python 3 interface to libfreenect.
+
+%description -n python3-freenect -l pl.UTF-8
+Interfejs Pythona 3 do libfreenect.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%{__sed} -i -e '1s,/usr/bin/env python2,%{__python},' src/fwfetcher.py
+
+%build
+install -d build
+cd build
+%cmake .. \
+ %{?with_opencv:-DBUILD_CV=ON} \
+ -DBUILD_EXAMPLES=OFF \
+ -DBUILD_PYTHON2=ON \
+ -DBUILD_PYTHON3=ON \
+ -DBUILD_OPENNI2_DRIVER=ON \
+ -DPROJECT_LIBRARY_INSTALL_DIR=%{_lib}
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%{__mv} $RPM_BUILD_ROOT%{_datadir}/fwfetcher.py \
+ $RPM_BUILD_ROOT%{_datadir}/libfreenect
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc README.md
+%attr(755,root,root) %{_libdir}/libfreenect.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libfreenect.so.0.6
+%attr(755,root,root) %{_libdir}/libfreenect_sync.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libfreenect_sync.so.0.6
+%dir %{_datadir}/libfreenect
+%{_datadir}/libfreenect/fwfetcher.py
+
+%files fakenect
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/fakenect
+%attr(755,root,root) %{_bindir}/fakenect-record
+%dir %{_libdir}/fakenect
+%attr(755,root,root) %{_libdir}/fakenect/libfakenect.so*
+%{_mandir}/man1/fakenect.1*
+%{_mandir}/man1/fakenect-record.1*
+
+%if %{with opencv}
+%files opencv
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/freenect-cvdemo
+%attr(755,root,root) %{_libdir}/libfreenect_cv.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libfreenect_cv.so.0.6
+%attr(755,root,root) %{_libdir}/libfreenect_cv.so
+%endif
+
+%if %{with openni2}
+%files -n OpenNI2-driver-freenect
+%defattr(644,root,root,755)
+%dir %{_libdir}/OpenNI2-FreenectDriver
+%attr(755,root,root) %{_libdir}/OpenNI2-FreenectDriver/libFreenectDriver.so*
+%endif
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libfreenect.so
+%attr(755,root,root) %{_libdir}/libfreenect_sync.so
+%{_includedir}/libfreenect
+%{_pkgconfigdir}/libfreenect.pc
+%{_datadir}/libfreenect/libfreenectConfig.cmake
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libfreenect.a
+%{_libdir}/libfreenect_sync.a
+
+%if %{with python2}
+%files -n python-freenect
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/freenect.so
+%endif
+
+%if %{with python3}
+%files -n python3-freenect
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/freenect.so
+%endif
diff --git a/libfreenect-install.patch b/libfreenect-install.patch
new file mode 100644
index 0000000..1f17aa0
--- /dev/null
+++ b/libfreenect-install.patch
@@ -0,0 +1,22 @@
+--- libfreenect-0.6.0/wrappers/python/CMakeLists.txt.orig 2019-10-30 01:30:13.000000000 +0100
++++ libfreenect-0.6.0/wrappers/python/CMakeLists.txt 2020-03-15 08:31:40.236407736 +0100
+@@ -50,7 +50,7 @@
+ # Figure out installation path
+ execute_process(COMMAND
+ ${PYTHON${Python_BUILD_VERSION}_EXECUTABLE}
+- -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'))"
++ -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=1, prefix='${CMAKE_INSTALL_PREFIX}'))"
+ OUTPUT_VARIABLE PYTHON${Python_BUILD_VERSION}_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ # Figure out numpy include path
+--- libfreenect-0.6.0/cmake_modules/SetupDirectories.cmake.orig 2019-10-30 01:30:13.000000000 +0100
++++ libfreenect-0.6.0/cmake_modules/SetupDirectories.cmake 2020-03-15 08:31:53.559668891 +0100
+@@ -8,7 +8,7 @@
+ STRING (TOLOWER ${PROJECT_NAME} projectNameLower)
+ SET (PROJECT_INCLUDE_INSTALL_DIR "include/${projectNameLower}")
+ SET (PROJECT_MANPAGE_INSTALL_DIR "share/man")
+-SET (PROJECT_LIBRARY_INSTALL_DIR "lib")
++SET (PROJECT_LIBRARY_INSTALL_DIR "lib${LIB_SUFFIX}")
+
+ MESSAGE (STATUS "${PROJECT_NAME} will be installed to ${CMAKE_INSTALL_PREFIX}")
+ MESSAGE (STATUS "Headers will be installed to ${CMAKE_INSTALL_PREFIX}/${PROJECT_INCLUDE_INSTALL_DIR}")
diff --git a/libfreenect-link.patch b/libfreenect-link.patch
new file mode 100644
index 0000000..22b3d34
--- /dev/null
+++ b/libfreenect-link.patch
@@ -0,0 +1,11 @@
+--- libfreenect-0.6.0/OpenNI2-FreenectDriver/CMakeLists.txt.orig 2019-10-30 01:30:13.000000000 +0100
++++ libfreenect-0.6.0/OpenNI2-FreenectDriver/CMakeLists.txt 2020-03-14 21:47:22.859166045 +0100
+@@ -24,7 +24,7 @@
+
+ target_compile_features(FreenectDriver PUBLIC cxx_constexpr)
+
+-target_link_libraries(FreenectDriver freenectstatic ${MATH_LIB})
++target_link_libraries(FreenectDriver freenectstatic ${MATH_LIB} -lpthread)
+
+ install (TARGETS FreenectDriver
+ DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}/OpenNI2-FreenectDriver")
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libfreenect.git/commitdiff/580dd7a4d2f6004a9958aa30e102ba3d116e3f60
More information about the pld-cvs-commit
mailing list