legacy package [release 4.7.0-5mamba;Thu Aug 31 2023]

This commit is contained in:
Silvan Calarco 2024-01-06 08:11:34 +01:00
parent 461e4e1ac3
commit 9fa9c6bcab
5 changed files with 459 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# opencv47
OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision.

View File

@ -0,0 +1,46 @@
From ea50be0529c248961e1b66293f8a9e4b807294a6 Mon Sep 17 00:00:00 2001
From: Samuel Martin <s.martin49@gmail.com>
Date: Sun, 12 Oct 2014 10:17:23 +0200
Subject: [PATCH] core: fix x86 PIC code compilation
This bug was triggered by Buildroot autobuilders [1,2], causing this
kind of failures [3,4]:
[ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
/home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)':
/home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm'
make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
[1] http://buildroot.org/
[2] http://autobuild.buildroot.org/
[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10
[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
modules/core/src/system.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
index 5a970d5..e9ffdc7 100644
--- a/modules/core/src/system.cpp
+++ b/modules/core/src/system.cpp
@@ -267,14 +267,17 @@ struct HWFeatures
: "cc"
);
#else
+ // We need to preserve ebx since we are compiling PIC code.
+ // This means we cannot use "=b" for the 2nd output register.
asm volatile
(
"pushl %%ebx\n\t"
"movl $7,%%eax\n\t"
"movl $0,%%ecx\n\t"
"cpuid\n\t"
+ "movl %%ebx,%1\n\t"
"popl %%ebx\n\t"
- : "=a"(cpuid_data[0]), "=b"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
+ : "=a"(cpuid_data[0]), "=r"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
:
: "cc"
);

View File

@ -0,0 +1,55 @@
diff --git a/package/opencv/opencv-0001-core-fix-x86-PIC-code-compilation.patch b/package/opencv/opencv-0001-core-fix-x86-PIC-code-compilation.patch
new file mode 100644
index 0000000..9e8c2e9
--- /dev/null
+++ b/package/opencv/opencv-0001-core-fix-x86-PIC-code-compilation.patch
@@ -0,0 +1,49 @@
+From ea50be0529c248961e1b66293f8a9e4b807294a6 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Sun, 12 Oct 2014 10:17:23 +0200
+Subject: [PATCH] core: fix x86 PIC code compilation
+
+This bug was triggered by Buildroot autobuilders [1,2], causing this
+kind of failures [3,4]:
+
+ [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
+ /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)':
+ /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm'
+ make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
+
+[1] http://buildroot.org/
+[2] http://autobuild.buildroot.org/
+[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10
+[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+---
+ modules/core/src/system.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
+index 5a970d5..e9ffdc7 100644
+--- a/modules/core/src/system.cpp
++++ b/modules/core/src/system.cpp
+@@ -267,14 +267,17 @@ struct HWFeatures
+ : "cc"
+ );
+ #else
++ // We need to preserve ebx since we are compiling PIC code.
++ // This means we cannot use "=b" for the 2nd output register.
+ asm volatile
+ (
+ "pushl %%ebx\n\t"
+ "movl $7,%%eax\n\t"
+ "movl $0,%%ecx\n\t"
+ "cpuid\n\t"
++ "movl %%ebx,%1\n\t"
+ "popl %%ebx\n\t"
+- : "=a"(cpuid_data[0]), "=b"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
++ : "=a"(cpuid_data[0]), "=r"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
+ :
+ : "cc"
+ );
+--
+2.1.2
+

View File

@ -0,0 +1,11 @@
--- opencv-4.1.2/cmake/templates/OpenCVConfig.cmake.in.orig 2019-11-14 20:10:06.372000000 +0100
+++ opencv-4.1.2/cmake/templates/OpenCVConfig.cmake.in 2019-11-14 20:10:31.100000000 +0100
@@ -77,7 +77,7 @@
# Extract the directory where *this* file has been installed (determined at cmake run-time)
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
-get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/@OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE@" REALPATH)
+get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../../" REALPATH)
# Search packages for host system instead of packages for target system.
# in case of cross compilation this macro should be defined by toolchain file

345
opencv47.spec Normal file
View File

@ -0,0 +1,345 @@
%define pkgver %(echo %version | sed "s|[a-z]||")
%define javaver %(echo %version | cut -d. -f1-3 | tr -d .)
Name: opencv47
Version: 4.7.0
Release: 5mamba
Summary: Collection of algorithms for computer vision
Group: Development/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://opencv.org/
Source: https://github.com/opencv/opencv.git/%{version}/opencv-%{version}.tar.bz2
Source1: https://github.com/opencv/opencv_contrib.git/%{version}/opencv_contrib-%{version}.tar.bz2
Patch2: opencv-2.4.9-buildfix-x86-asm-constraint.patch
Patch3: opencv-2.4.10-i586-inconsistent-constraint-asm.patch
Patch4: opencv-4.1.2-cmake-includedir.patch
License: BSD
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libavcodec-ffmpeg-devel
BuildRequires: libavformat-ffmpeg-devel
BuildRequires: libavutil-ffmpeg-devel
BuildRequires: libdc1394-devel
BuildRequires: libfreetype-devel
BuildRequires: libgcc
BuildRequires: libglib-devel
BuildRequires: libglvnd-devel
BuildRequires: libgst-plugins-base-devel
BuildRequires: libgstreamer-devel
BuildRequires: libharfbuzz-devel
BuildRequires: libhdf5-devel
BuildRequires: libjpeg-devel
BuildRequires: libopenblas-devel
BuildRequires: libopenexr-devel
BuildRequires: libopenjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libprotobuf-devel
BuildRequires: libpython27-devel
BuildRequires: libpython310-devel
BuildRequires: libstdc++6-devel
BuildRequires: libswscale-ffmpeg-devel
BuildRequires: libtbb-devel
%ifnarch arm
BuildRequires: libtesseract-devel
%endif
BuildRequires: libtiff-devel
BuildRequires: libvtk-devel
BuildRequires: libwebp-devel
BuildRequires: libxine-devel
BuildRequires: libz-devel
BuildRequires: qt6-qtbase-devel
## AUTOBUILDREQ-END
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description
OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision.
%package -n lib%{name}
Summary: Collection of algorithms for computer vision
Group: System/Libraries
%description -n lib%{name}
OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision.
This package contains the OpenCV static libraries.
%package -n lib%{name}-devel
Summary: Devel package for %{name}
Group: Development/Libraries
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n lib%{name}-devel
OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision.
This package contains static libraries and header files need for development.
%package -n java-%{name}
Summary: Java bindings for apps which use OpenCV
Group: Development/Libraries
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n java-%{name}
This package contains Python bindings for the OpenCV library.
%package -n python-cv47-py2
Summary: Python bindings for apps which use OpenCV
Group: Development/Libraries
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: python-Pillow
Requires: python-numpy
%description -n python-cv47-py2
This package contains Python bindings for the OpenCV library.
%package -n python-cv47-py310
Summary: Python bindings for apps which use OpenCV
Group: Development/Libraries
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: python-Pillow-py310
Requires: python-numpy-py310
%description -n python-cv47-py310
This package contains Python bindings for the OpenCV library.
%debug_package
%prep
%setup -q -a1 -n opencv-%{version}
#% setup -q -D -T -n opencv-%{version}
#:<< _EOF
%ifarch %{ix86}
%patch 2 -p1
%endif
#%patch3 -p1
%patch 4 -p1
# FIXME: removing module requiring Ogre
rm -rf opencv_contrib-%{version}/modules/ovis
%build
#:<< _EOF
export JAVA_HOME=%{_jvmdir}/jdk
export JAVACMD=%{_jvmdir}/jdk/bin/java
#:<< _EOF
#-- Interfaces:
# -- Use IPP: NO (Intel Performance Primitive)
# -- Use TBB: NO (Threading Building Blocks library)
# -- Build Documentation 0
#
# append flag -D__STDC_CONSTANT_MACROS to fix build with ffmpeg >= 0.6
#PYTHON_PATH=`echo %python36_sitelib | sed "s|%{_prefix}/||"`
%cmake -d build \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_OPENCL=ON \
-DWITH_OPENGL=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DWITH_TBB=ON \
-DWITH_VULKAN=ON \
-DWITH_QT=ON \
-DWITH_GSTREAMER=1 \
-DWITH_XINE=1 \
-DWITH_UNICAP=1 \
-DWITH_1394=1 \
-DWITH_FFMPEG=1 \
-DWITH_QUICKTIME=0 \
-DBUILD_PROTOBUF=OFF \
-DPROTOBUF_UPDATE_FILES=ON \
-DBUILD_SWIG_PYTHON_SUPPORT=1 \
-DINSTALL_C_EXAMPLES=0 \
-DCMAKE_CXX_FLAGS:STRING="%{optflags} -D__STDC_CONSTANT_MACROS" \
-DPYTHON3_EXECUTABLE:PATH=%{__python310} \
-DPYTHON3_PACKAGES_PATH:PATH=%{python310_sitelib} \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DOPENCV_ENABLE_NONFREE=ON \
-DOPENCV_EXTRA_MODULES_PATH=${PWD}/../opencv_contrib-%{version}/modules \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DLIB_SUFFIX=
%make_jobs
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C build
## Fix permissions
#chmod 0755 %{buildroot}%{python_sitearch}/cv2.so
#chmod 0755 %{buildroot}%{python_sitearch}/cv.py
# Remove unpackaged files
rm -fr %{buildroot}%{_datadir}/opencv/doc
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n lib%{name}
/sbin/ldconfig
:
%postun -n lib%{name}
/sbin/ldconfig
:
%files
%defattr(-,root,root)
%{_bindir}/opencv_*
%{_bindir}/setup_vars_opencv4.sh
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/libopencv_*.so.*
%dir %{_datadir}/opencv4
%{_datadir}/opencv4/*
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/opencv4
%dir %{_includedir}/opencv4/opencv2
%{_includedir}/opencv4/opencv2/*
%{_libdir}/libopencv_*.so
%dir %{_libdir}/cmake/opencv4
%{_libdir}/cmake/opencv4/OpenCV*.cmake
%{_libdir}/pkgconfig/opencv4.pc
%dir %{_datadir}/licenses/opencv4
%{_datadir}/licenses/opencv4/*
%files -n java-%{name}
%defattr(-,root,root)
%{_datadir}/java/opencv4/libopencv_java*.so
%{_datadir}/java/opencv4/opencv-*.jar
%files -n python-cv47-py2
%defattr(-,root,root)
%dir %{python27_sitelib}/cv2
%{python27_sitelib}/cv2/*
%files -n python-cv47-py310
%defattr(-,root,root)
%dir %{python310_sitelib}/cv2
%{python310_sitelib}/cv2/*
%changelog
* Thu Aug 31 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 4.7.0-5mamba
- legacy package
* Sun May 07 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 4.7.0-4mamba
- removed ovis module with dependency on ogre
* Sat May 06 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 4.7.0-3mamba
- rebuilt with ogre 13.6.4
* Sat May 06 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 4.7.0-2mamba
- rebuilt with extra opencv_contrib modules and other cmake options
* Fri Dec 30 2022 Automatic Build System <autodist@mambasoft.it> 4.7.0-1mamba
- automatic version update by autodist
* Tue Jun 07 2022 Automatic Build System <autodist@mambasoft.it> 4.6.0-1mamba
- automatic version update by autodist
* Mon Dec 27 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.5.5-1mamba
- update to 4.5.5
* Sat Apr 03 2021 Automatic Build System <autodist@mambasoft.it> 4.5.2-1mamba
- automatic version update by autodist
* Tue Dec 29 2020 Automatic Build System <autodist@mambasoft.it> 4.5.1-1mamba
- automatic version update by autodist
* Sat Dec 12 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.5.0-1mamba
- update to 4.5.0
* Sat Dec 12 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.2-5mamba
- rebuilt with python3; updated build requirements
* Sun Dec 08 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.2-4mamba
- rebuilt with -DENABLE_PRECOMPILED_HEADERS=OFF to fix blender build, see https://stackoverflow.com/questions/43558709/opencv-and-tbb-error-x64?rq=1
* Thu Nov 14 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.2-3mamba
- fix cmake file for wrong include dir
* Sat Nov 09 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.2-2mamba
- fix double provide/obsolete for opencv-python
* Fri Oct 11 2019 Automatic Build System <autodist@mambasoft.it> 4.1.2-1mamba
- automatic version update by autodist
* Sun Aug 18 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.1-2mamba
- python-cv-py36: require -py36 packages, not -py3
* Sat Jul 27 2019 Automatic Build System <autodist@mambasoft.it> 4.1.1-1mamba
- automatic version update by autodist
* Thu Apr 25 2019 Automatic Build System <autodist@mambasoft.it> 4.1.0-1mamba
- automatic version update by autodist
* Sat Apr 06 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.0.1-1mamba
- update to 4.0.1
* Thu Aug 30 2018 Automatic Build System <autodist@mambasoft.it> 3.4.3-1mamba
- automatic version update by autodist
* Fri Aug 03 2018 Automatic Build System <autodist@mambasoft.it> 3.4.2-1mamba
- automatic version update by autodist
* Mon Jul 30 2018 Silvan Calarco <silvan.calarco@mambasoft.it> 3.4.1-1mamba
- update to 3.4.1
* Thu Jan 21 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 3.1.0-1mamba
- update to 3.1.0
* Wed Dec 23 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.11-3mamba
- rebuilt with gcc 5.3.0
* Tue Sep 22 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.11-2mamba
- libopencv-devel: require java-opencv or provided cmake files fail
* Fri Aug 14 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.11-1mamba
- update to 2.4.11
* Fri May 29 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.10-2mamba
- build kde4 version with gstreamer 0.10 (should fix digikam)
* Sun Dec 28 2014 Automatic Build System <autodist@mambasoft.it> 2.4.10-1mamba
- automatic version update by autodist
* Thu Sep 04 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.9-2mamba
- rebuilt to fix wrong cmake files on i586 which don't like to digikam
* Tue Jul 15 2014 Automatic Build System <autodist@mambasoft.it> 2.4.9-1mamba
- automatic version update by autodist
* Wed Jan 15 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.8-1mamba
- update to 2.4.8
* Wed Nov 13 2013 Automatic Build System <autodist@mambasoft.it> 2.4.7-1mamba
- automatic version update by autodist
* Mon Aug 26 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.6.1-3mamba
- rebuilt after upgrading libatlas-3.8.4-2mamba which fixes python-numpy
* Wed Aug 21 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.6.1-2mamba
- rebuilt with libopenexr-2.0.1-3mamba nad python-numpy 1.8
* Sun Jul 14 2013 Automatic Build System <autodist@mambasoft.it> 2.4.6.1-1mamba
- automatic version update by autodist
* Mon Jul 08 2013 Automatic Build System <autodist@mambasoft.it> 2.4.6-1mamba
- automatic version update by autodist
* Thu Apr 25 2013 Automatic Build System <autodist@mambasoft.it> 2.4.5-1mamba
- update to 2.4.5
* Sat Dec 01 2012 Automatic Build System <autodist@mambasoft.it> 2.4.3-1mamba
- automatic version update by autodist
* Thu Aug 09 2012 Automatic Build System <autodist@mambasoft.it> 2.4.2-1mamba
- automatic version update by autodist
* Fri Dec 09 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.1a-1mamba
- update to 2.3.1a
* Mon Oct 11 2010 Davide Madrisan <davide.madrisan@gmail.com> 2.1.0-1mamba
- update to 2.1.0
* Mon Dec 07 2009 Davide Madrisan <davide.madrisan@gmail.com> 2.0.0-1mamba
- package created by autospec