Browse Source

updated 3 packages

eigen3-3.3.7-1

opencv-4.3.0-1

tbb-2020.2-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@12418 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 3 years ago
parent
commit
daf57388d2
3 changed files with 399 additions and 247 deletions
  1. 32 30
      e/eigen3/eigen3-vl.spec
  2. 221 165
      o/opencv/opencv-vl.spec
  3. 146 52
      t/tbb/tbb-vl.spec

+ 32 - 30
e/eigen3/eigen3-vl.spec

@@ -1,29 +1,34 @@
+%bcond_with test
+
 # The (empty) main package is arch, to have the package built and tests run
 # on all arches, but the actual result package is the noarch -devel subpackge.
 # Debuginfo packages are disabled to prevent rpmbuild from generating an empty
 # debuginfo package for the empty main package.
 %global debug_package %{nil}
 
-%global commit 10219c95fe65
+%global commit 323c052e1731
 
 Name:           eigen3
-Version:        3.2.4
-Release:        2%{?_dist_release}
+Version:        3.3.7
+Release:        1%{?_dist_release}
 Summary:        A lightweight C++ template library for vector and matrix math
 Summary(ja):    ベクトル及び行列演算のための軽量 C++ テンプレートライブラリ
-
 Group:          Development/Libraries
+Vendor:         Project Vine
+Distribution:   Vine Linux
+
 License:        MPLv2.0 and LGPLv2+ and BSD
 URL:            http://eigen.tuxfamily.org/index.php?title=Main_Page
-# Source file is at: http://bitbucket.org/eigen/eigen/get/3.1.3.tar.bz2
-# Renamed source file so it's not just a version number
-Source0:        eigen-%{version}.tar.bz2
+Source0:        http://bitbucket.org/eigen/eigen/get/%{version}.tar.bz2#/eigen-%{version}.tar.bz2
 
-# Fix build with recent suitesparse versions
-Patch0:         eigen-3.2.3_suitesparse.patch
+# Install FindEigen3.cmake
+# Adapted from Debian eigen3 package
+Patch0:         01_install_FindEigen3.patch
 
-# Vine Patch
-Patch700:       eigen-3.2.4_BVHsegfault.patch
+# Fix pkg-config file
+Patch1:         eigen_pkgconfig.patch
+# Fix the include paths in the new Eigen3Config.cmake file
+Patch2:         eigen3-3.3.1-fixcmake.patch
 
 #BuildRequires:  atlas-devel
 BuildRequires:  fftw3-devel
@@ -40,8 +45,6 @@ BuildRequires:  qt4-devel
 BuildRequires:  cmake
 BuildRequires:  doxygen
 BuildRequires:  graphviz
-BuildRequires:  texlive-collection-latex
-#BuildRequires:  tex(latex)
 
 %description
 %{summary}.
@@ -59,56 +62,55 @@ Provides:       %{name}-static = %{version}-%{release}
 %description devel
 %{summary}.
 
-%package doc
-Summary:        Developer documentation for Eigen
-Summary(ja):    Eigen の開発用ドキュメント
-Group:          Documentation
-BuildArch:      noarch
-Requires:       %{name}-devel = %{version}-%{release}
-
-%description doc
-Developer documentation for Eigen.
 
 %prep
-%setup -q -n eigen-eigen-%{commit}
-%patch0 -p1
+%autosetup -p1 -n eigen-eigen-%{commit}
 
-%patch700 -p1
 
 %build
 mkdir %{_target_platform}
 pushd %{_target_platform}
 #cmake .. -DBLAS_LIBRARIES="cblas" -DSUPERLU_INCLUDES=%{_includedir}/SuperLU
-%cmake .. -DBLAS_LIBRARIES="cblas" 
+%cmake -DINCLUDE_INSTALL_DIR=%{_includedir}/eigen3 \
+       -DBLAS_LIBRARIES="cblas" \
+       ..
 popd
 make -C %{_target_platform} %{?_smp_mflags}
-make doc -C %{_target_platform} %{?_smp_mflags}
 
 rm -f %{_target_platform}/doc/html/installdox
 rm -f %{_target_platform}/doc/html/unsupported/installdox
 
+
 %install
 rm -rf %{buildroot}
 %make_install -C %{_target_platform}
 
+
+%if %{with test}
 %check
 # Run tests but make failures non-fatal. Note that upstream doesn't expect the
 # tests to pass consistently since they're seeded randomly.
 make -C %{_target_platform} %{?_smp_mflags} buildtests
 make -C %{_target_platform} %{?_smp_mflags} test ARGS="-V" || exit 0
+%endif
+
 
 %clean
 rm -rf %{buildroot}
 
+
 %files devel
-%doc COPYING.README COPYING.BSD COPYING.MPL2 COPYING.LGPL
+%license COPYING.README COPYING.BSD COPYING.MPL2 COPYING.LGPL
 %{_includedir}/eigen3
+%{_datadir}/%{name}
 %{_datadir}/pkgconfig/*
+%{_datadir}/cmake/Modules/*.cmake
 
-%files doc
-%doc %{_target_platform}/doc/html
 
 %changelog
+* Tue Jun 30 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 3.3.7-1
+- new upstream release.
+
 * Tue Feb 17 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 3.2.4-2
 - Initial build for Vine Linux
 

+ 221 - 165
o/opencv/opencv-vl.spec

@@ -1,15 +1,20 @@
+%bcond_with test
+
+%bcond_without gstreamer
 #global indice   a
 
 Name:           opencv
-Version:        2.4.9
-Release:        8%{?_dist_release}
+Version:        4.3.0
+Release:        1%{?_dist_release}
 Summary:        Collection of algorithms for computer vision
 Summary(ja):    コンピュータビジョン用のアルゴリズム集
-
 Group:          System Environment/Libraries
+Vendor:         Project Vine
+Distribution:   Vine Linux
+
 # This is normal three clause BSD.
 License:        BSD
-URL:            http://opencv.org
+URL:            https://opencv.org
 
 # Need to remove SIFT/SURF from source tarball, due to legal concerns
 # rm -f opencv-%%{version}/modules/nonfree/src/sift.cpp
@@ -17,74 +22,59 @@ URL:            http://opencv.org
 # Removed because we don't use pre-built contribs
 # rm -rf 3rdparty
 #Source0:        http://downloads.sourceforge.net/opencvlibrary/opencv-unix/%{version}/%{name}-%{version}%{?indice}.zip
-Source0:	%{name}-clean-%{version}%{?indice}.tar.xz
-Source1:        opencv-samples-Makefile
-Patch0:         opencv-pkgcmake.patch
-#http://code.opencv.org/issues/2720
-Patch2:         OpenCV-2.4.4-pillow.patch
-Patch3:         opencv-2.4.9-ts_static.patch
-# fix/simplify cmake config install location (upstreamable)
-# https://bugzilla.redhat.com/1031312
-Patch4:         opencv-2.4.7-cmake_paths.patch
-
-# relevant gst1-related patches from upstream master branch
-# 0550 needed slight rebasing -- rex
-Patch10: 0550-bomb-commit-of-gstreamer-videocapture-and-videowrite.patch
-Patch11: 0552-eliminated-warnings.patch
-Patch12: 0587-Fix-build-with-gstreamer-0.10.28.patch
-Patch13: 0865-gstreamer-cleaning-up-resources.patch
-Patch14: 0871-allow-for-arbitraty-number-of-sources-and-sinks.patch
+Source0:        %{name}-clean-%{version}.tar.gz
+Source1:        %{name}_contrib-clean-%{version}.tar.gz
+Source2:        %{name}_extra-clean-%{version}.tar.gz
+Source3:        face_landmark_model.dat.xz
+# from https://github.com/opencv/ade/archive/v0.1.1f.zip
+Source4:        b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
+Source5:        xorg.conf
+
+Patch0:         opencv-4.1.0-install_3rdparty_licenses.patch
+Patch1:         https://patch-diff.githubusercontent.com/raw/opencv/opencv/pull/17431.patch
+Patch2:         https://patch-diff.githubusercontent.com/raw/opencv/opencv_contrib/pull/2549.patch
+# Comment out removed vulkan symbols
+Patch3:         opencv_vulkan.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-root
 BuildRequires:  libtool
 BuildRequires:  cmake >= 2.6.3
 BuildRequires:  chrpath
 
-%if "%{?_dist_release}" == "vl6"
-BuildRequires:  eigen2-devel
-%else
 BuildRequires:  eigen3-devel
-%endif
-BuildRequires:  gtk2-devel
 BuildRequires:  libtheora-devel
 BuildRequires:  libvorbis-devel
-BuildRequires:  libraw1394-devel
-BuildRequires:  libdc1394-devel
+#BuildRequires:  libraw1394-devel
+#BuildRequires:  libdc1394-devel
 BuildRequires:  jasper-devel
 BuildRequires:  libpng-devel
 BuildRequires:  libjpeg-devel
 BuildRequires:  libtiff-devel
-%if "%{?_dist_release}" != "vl6"
 BuildRequires:  libv4l-devel
-%endif
+BuildRequires:  libwebp-devel
 BuildRequires:  mesa-libGL-devel
-BuildRequires:  gtkglext-devel
 BuildRequires:  OpenEXR-devel
 #ifarch %{ix86} x86_64
 #BuildRequires:  openni-devel
 #BuildRequires:  openni-primesense
 #endif
-
-%if "%{?_dist_release}" != "vl6"
-%ifarch %{ix86} x86_64 ia64 ppc ppc64
 BuildRequires:  tbb-devel
-%endif
-%endif
+
+BuildRequires:  qt5-qtbase-devel
+BuildRequires:  freetype2-devel
+BuildRequires:  harfbuzz-devel
 
 BuildRequires:  zlib-devel pkgconfig
-BuildRequires:  python-devel
-BuildRequires:  numpy
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-rpm-macros
+BuildRequires:  python3-numpy
 BuildRequires:  swig >= 1.3.24
-BuildRequires:  python-sphinx
+#BuildRequires:  python-sphinx
 #BuildRequires:  ffmpeg-devel >= 0.4.9
 
-%if "%{?_dist_release}" == "vl6"
-BuildRequires:  gstreamer-devel
-BuildRequires:  gstreamer-plugins-base-devel
-%else
 BuildRequires:  gstreamer1-devel
 BuildRequires:  gstreamer1-plugins-base-devel
-%endif
 #BuildRequires:  xine-lib-devel
 #BuildRequires:  opencl-headers
 
@@ -101,6 +91,7 @@ and Computer Vision algorithms.
 Summary:        OpenCV core libraries
 Summary(ja):    OpenCV コアライブラリ
 Group:          System Environment/Libraries
+Obsoletes:      %{name}-python < %{version}-%{release}
 
 %description    core
 This package contains the OpenCV C/C++ core libraries.
@@ -117,97 +108,117 @@ documentation. It should be installed if you want to develop programs that
 will use the OpenCV library. You should consider installing opencv-devel-docs
 package.
 
-%package        devel-docs
-Summary:        Development files for using the OpenCV library
-Summary(ja):    OpenCV ライブラリを使用するための開発用ドキュメント
-Group:          Documentation
-Requires:       opencv-devel = %{version}-%{release}
-BuildArch:      noarch
-
-%description    devel-docs
-This package contains the OpenCV documentation and examples programs.
-
-%package        python
+%package -n     python3-opencv
 Summary:        Python bindings for apps which use OpenCV
-Summary(ja):    OpenCV 使用するアプリケーション用の Python バインディング
+Summary(ja):    OpenCV を使用するアプリケーション用の Python バインディング
 Group:          Development/Libraries
 Requires:       opencv = %{version}-%{release}
-Requires:       numpy
+Requires:       python3-numpy
 
-%description    python
+%description -n python3-opencv
 This package contains Python bindings for the OpenCV library.
 
+%package        contrib
+Summary:        OpenCV contributed functionality
+Summary(ja):    寄付された OpenCV の追加機能
 
-%prep
-%setup -q
-%patch0 -p1 -b .pkgcmake
-%patch2 -p1 -b .pillow
-%patch3 -p1 -b .ts_static
-%patch4 -p1 -b .cmake_paths
+%description    contrib
+This package is intended for development of so-called "extra" modules, contribut
+ed
+functionality. New modules quite often do not have stable API, and they are not
+well-tested. Thus, they shouldn't be released as a part of official OpenCV
+distribution, since the library maintains binary compatibility, and tries
+to provide decent performance and stability.
 
-# for gst1
-%patch10 -p1 -b .10
-%patch11 -p1 -b .11
-%patch12 -p1 -b .12
-%patch13 -p1 -b .13
-%patch14 -p1 -b .14
 
-# fix dos end of lines
-sed -i 's|\r||g'  samples/c/adaptiveskindetector.cpp
+%prep
+%setup -q -a1 -a2
+# we don't use pre-built contribs except quirc
+pushd 3rdparty
+shopt -s extglob
+rm -r !(openexr|openvx|quirc)
+shopt -u extglob
+popd &>/dev/null
+
+%patch0 -p1 -b .install_3rdparty_licenses
+%patch1 -p1
+%patch3 -p1
+
+pushd %{name}_contrib-%{version}
+%patch2 -p1
+popd
+
+# Install ADE, needed for opencv_gapi
+mkdir -p .cache/ade
+install -pm 0644 %{SOURCE4} .cache/ade/
 
 
 %build
 # enabled by default if libraries are presents at build time:
-# GTK, GSTREAMER, UNICAP, 1394, V4L
+# GTK, GSTREAMER, 1394, V4L
 # non available on Fedora: FFMPEG, XINE
 mkdir -p build
 pushd build
+
+rm -rf  share/opencv4/testdata/cv/face
+mkdir -p share/opencv4/testdata/cv/face
+install -pm 0644 %{SOURCE3} share/opencv4/testdata/cv/face
+pushd share/opencv4/testdata/cv/face
+  xz -d face_landmark_model.dat.xz
+popd
+
+# disabling IPP because it is closed source library from intel
+
 %cmake CMAKE_VERBOSE=1 \
-       -DPYTHON_PACKAGES_PATH=%{python_sitearch} \
-       -DCMAKE_SKIP_RPATH=ON \
-       -DENABLE_PRECOMPILED_HEADERS:BOOL=OFF \
+        -DWITH_IPP=OFF \
+        -DWITH_ITT=OFF \
+        -DWITH_QT=ON \
+        -DWITH_OPENGL=ON \
+        -DOpenGL_GL_PREFERENCE=GLVND \
+        -DWITH_GDAL=ON \
+        -DWITH_OPENEXR=ON \
+        -DWITH_UNICAP=ON \
+        -DCMAKE_SKIP_RPATH=ON \
+        -DWITH_CAROTENE=OFF \
 %ifnarch x86_64 ia64
-       -DENABLE_SSE=0 \
-       -DENABLE_SSE2=0 \
-%endif
-       -DENABLE_SSE3=0 \
-       -DCMAKE_BUILD_TYPE=ReleaseWithDebInfo \
-       -DBUILD_TEST=1 \
-       -DBUILD_opencv_java=0 \
-       -DBUILD_opencv_nonfree=0 \
-       -DBUILD_opencv_gpu=0 \
-       -DWITH_FFMPEG=0 \
-       -DWITH_GSTREAMER_1_X=1 \
-       -DWITH_OPENGL=1 \
-       -DWITH_OPENMP=1 \
-%if "%{?_dist_release}" == "vl6"
-       -DWITH_V4L=0 \
+        -DENABLE_SSE=0 \
+        -DENABLE_SSE2=0 \
 %else
-%ifarch %{ix86} x86_64 ia64
-       -DWITH_TBB=1 -DTBB_LIB_DIR=%{_libdir} \
-%endif
+        -DCPU_BASELINE=SSE2 \
 %endif
-       -DWITH_XINE=0 \
-       -DINSTALL_C_EXAMPLES=1 \
-       -DINSTALL_PYTHON_EXAMPLES=1 \
-       ..
-
-
-#{?_without_gstreamer:-DWITH_GSTREAMER=0} \
-
-#%{?_with_cuda: \
-# -DCUDA_TOOLKIT_ROOT_DIR=%{?_cuda_topdir} \
-# -DCUDA_VERBOSE_BUILD=1 \
-# -DCUDA_PROPAGATE_HOST_FLAGS=0 \
-#} \
-
- #%ifarch %{ix86} x86_64
-#%{?_with_openni: \
-# -DWITH_OPENNI=ON \
-#} \
-#%endif
-
-# -DOPENCL_INCLUDE_DIR=${_includedir}/CL \
+        -DENABLE_PRECOMPILED_HEADERS=OFF \
+        -DCMAKE_BUILD_TYPE=ReleaseWithDebInfo \
+        -DBUILD_opencv_java=OFF \
+        %{?with_tbb: -DWITH_TBB=ON } \
+        %{!?with_gstreamer: -DWITH_GSTREAMER=OFF } \
+        -DWITH_FFMPEG=OFF \
+        %{?with_openni: -DWITH_OPENNI=ON } \
+        -DWITH_XINE=OFF \
+        -DBUILD_DOCS=OFF \
+        -DBUILD_EXAMPLES=OFF \
+        -DBUILD_opencv_python2=OFF \
+        -DINSTALL_C_EXAMPLES=OFF \
+        -DINSTALL_PYTHON_EXAMPLES=OFF \
+        -DPYTHON3_EXECUTABLE=%{__python3} \
+        -DPYTHON3_PACKAGES_PATH=%{python3_sitearch} \
+        -DENABLE_PYLINT=ON \
+        -DBUILD_PROTOBUF=OFF \
+        -DPROTOBUF_UPDATE_FILES=ON \
+        -DWITH_OPENCL=OFF \
+        -DOPENCV_SKIP_PYTHON_LOADER=ON \
+        -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-%{version}/modules \
+        -DWITH_LIBV4L=ON \
+        -DWITH_OPENMP=ON \
+        -DOPENCV_CONFIG_INSTALL_PATH=%{_lib}/cmake/OpenCV \
+        -DOPENCV_GENERATE_PKGCONFIG=ON \
+        -DOPENCV_TEST_DATA_PATH=opencv_extra-%{version}/testdata \
+        %{?with_gdcm: -DWITH_GDCM=ON } \
+        %{?with_libmfx: -DWITH_MFX=ON } \
+        %{?with_clp: -DWITH_CLP=ON } \
+        %{?with_va: -DWITH_VA=ON } \
+        -DWITH_VTK=OFF \
+        -DWITH_TBB=1 -DTBB_LIB_DIR=%{_libdir} \
+        ..
  
 make VERBOSE=1 %{?_smp_mflags}
 
@@ -216,86 +227,131 @@ popd
 
 %install
 rm -rf %{buildroot}
-rm -rf __devel-doc
-pushd build
-make install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"
+%make_install -C build
 find %{buildroot} -name '*.la' -delete
+rm -rf %{buildroot}%{_datadir}/OpenCV/licenses/
 
-rm -f %{buildroot}%{_datadir}/OpenCV/samples/c/build_all.sh \
-      %{buildroot}%{_datadir}/OpenCV/samples/c/cvsample.dsp \
-      %{buildroot}%{_datadir}/OpenCV/samples/c/cvsample.vcproj \
-      %{buildroot}%{_datadir}/OpenCV/samples/c/facedetect.cmd
-install -pm644 %{SOURCE1} %{buildroot}%{_datadir}/OpenCV/samples/c/GNUmakefile
-
-# remove unnecessary documentation
-rm -rf %{buildroot}%{_datadir}/OpenCV/doc
-
-popd
 
+%if %{with test}
 %check
 # Check fails since we don't support most video
 # read/write capability and we don't provide a display
 # ARGS=-V increases output verbosity
-# Make test is unavailble as of 2.3.1
-%if 0
-#ifnarch ppc64
 pushd build
-    LD_LIBRARY_PATH=%{_builddir}/%{tar_name}-%{version}/lib:$LD_LIBARY_PATH make test ARGS=-V || :
+    cp %SOURCE5 .
+    if [ -x /usr/libexec/Xorg ]; then
+       Xorg=/usr/libexec/Xorg
+    else
+       Xorg=/usr/libexec/Xorg.bin
+    fi
+    $Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xorg.log -config ./xorg.conf -configdir . :99 &
+    export DISPLAY=:99
+    LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/build/lib:$LD_LIBARY_PATH make test ARGS=-V || :
 popd
 %endif
 
+
 %clean
 rm -rf %{buildroot}
 
+
 %post core -p /sbin/ldconfig
 %postun core -p /sbin/ldconfig
 
 %post -p /sbin/ldconfig
 %postun -p /sbin/ldconfig
 
+%post contrib -p /sbin/ldconfig
+%postun contrib -p /sbin/ldconfig
+
+
 %files
-%doc LICENSE README.md
+%doc README.md
 %{_bindir}/opencv_*
-%{_libdir}/libopencv_calib3d.so.2.4*
-%{_libdir}/libopencv_contrib.so.2.4*
-%{_libdir}/libopencv_features2d.so.2.4*
-%{_libdir}/libopencv_highgui.so.2.4*
-%{_libdir}/libopencv_legacy.so.2.4*
-%{_libdir}/libopencv_objdetect.so.2.4*
-#{_libdir}/libopencv_ocl.so.2.4*
-%{_libdir}/libopencv_stitching.so.2.4*
-%{_libdir}/libopencv_superres.so.2.4*
-%{_libdir}/libopencv_ts.so.2.4*
-%{_libdir}/libopencv_videostab.so.2.4*
-%dir %{_datadir}/OpenCV
-%{_datadir}/OpenCV/haarcascades
-%{_datadir}/OpenCV/lbpcascades
+%dir %{_datadir}/opencv4
+%{_datadir}/opencv4/haarcascades
+%{_datadir}/opencv4/lbpcascades
+%{_datadir}/opencv4/valgrind*
+%{_datadir}/opencv4/quality
 
 %files core
-%{_libdir}/libopencv_core.so.2.4*
-%{_libdir}/libopencv_flann.so.2.4*
-%{_libdir}/libopencv_imgproc.so.2.4*
-%{_libdir}/libopencv_ml.so.2.4*
-%{_libdir}/libopencv_photo.so.2.4*
-%{_libdir}/libopencv_video.so.2.4*
+%license LICENSE
+%{_datadir}/licenses/opencv4/
+%{_libdir}/libopencv_alphamat.so.*
+%{_libdir}/libopencv_core.so.*
+%{_libdir}/libopencv_cvv.so.*
+%{_libdir}/libopencv_features2d.so.*
+%{_libdir}/libopencv_flann.so.*
+%{_libdir}/libopencv_gapi.so.*
+%{_libdir}/libopencv_hfs.so.*
+%{_libdir}/libopencv_highgui.so.*
+%{_libdir}/libopencv_imgcodecs.so.*
+%{_libdir}/libopencv_imgproc.so.*
+%{_libdir}/libopencv_intensity_transform.so.*
+%{_libdir}/libopencv_ml.so.*
+%{_libdir}/libopencv_objdetect.so.*
+%{_libdir}/libopencv_photo.so.*
+%{_libdir}/libopencv_rapid.so.*
+%{_libdir}/libopencv_shape.so.*
+%{_libdir}/libopencv_stitching.so.*
+%{_libdir}/libopencv_superres.so.*
+%{_libdir}/libopencv_video.so.*
+%{_libdir}/libopencv_videoio.so.*
+%{_libdir}/libopencv_videostab.so.*
 
 %files devel
-%{_includedir}/opencv
-%{_includedir}/opencv2
+%dir %{_includedir}/opencv4
+%{_includedir}/opencv4/opencv2
 %{_libdir}/lib*.so
-%{_libdir}/pkgconfig/opencv.pc
-%dir %{_libdir}/OpenCV/
-%{_libdir}/OpenCV/*.cmake
+%{_libdir}/pkgconfig/opencv*.pc
+%{_libdir}/cmake/OpenCV/*.cmake
+
+%files -n python3-opencv
+%exclude %{_bindir}/setup_vars_opencv4.sh
+%{python3_sitearch}/cv2.cpython-3*.so
+
+
+%files contrib
+%{_libdir}/libopencv_aruco.so.*
+%{_libdir}/libopencv_bgsegm.so.*
+%{_libdir}/libopencv_bioinspired.so.*
+%{_libdir}/libopencv_calib3d.so.*
+%{_libdir}/libopencv_ccalib.so.*
+%{_libdir}/libopencv_datasets.so.*
+# needs protobuf
+#{_libdir}/libopencv_dnn.so.*
+#{_libdir}/libopencv_dnn_objdetect.so.*
+#{_libdir}/libopencv_dnn_superres.so.*
+%{_libdir}/libopencv_dpm.so.*
+%{_libdir}/libopencv_face.so.*
+%{_libdir}/libopencv_freetype.so.*
+%{_libdir}/libopencv_fuzzy.so.*
+# needs hdf5
+#{_libdir}/libopencv_hdf.so.*
+%{_libdir}/libopencv_img_hash.so.*
+%{_libdir}/libopencv_line_descriptor.so.*
+%{_libdir}/libopencv_optflow.so.*
+%{_libdir}/libopencv_phase_unwrapping.so.*
+%{_libdir}/libopencv_plot.so.*
+%{_libdir}/libopencv_reg.so.*
+%{_libdir}/libopencv_rgbd.so.*
+%{_libdir}/libopencv_quality.so.*
+%{_libdir}/libopencv_saliency.so.*
+%{_libdir}/libopencv_stereo.so.*
+%{_libdir}/libopencv_structured_light.so.*
+%{_libdir}/libopencv_surface_matching.so.*
+# needs tesseract
+#{_libdir}/libopencv_text.so.*
+%{_libdir}/libopencv_tracking.so.*
+%{_libdir}/libopencv_ximgproc.so.*
+%{_libdir}/libopencv_xobjdetect.so.*
+%{_libdir}/libopencv_xphoto.so.*
 
-%files devel-docs
-%doc doc/*.{htm,png,jpg}
-%doc %{_datadir}/OpenCV/samples
-
-%files python
-%{python_sitearch}/cv.py*
-%{python_sitearch}/cv2.so
 
 %changelog
+* Tue Jun 30 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.3.0-1
+- new upstream release.
+
 * Mon Mar 27 2017 Daisuke SUZUKI <daisuke@vinelinux.org> 2.4.9-8
 - use eigen2 on Vine Linux 6.x
 - disable tbb/v4l on Vine Linux 6.x

+ 146 - 52
t/tbb/tbb-vl.spec

@@ -1,43 +1,51 @@
-%define releasedate 20150611
-%define major 4
-%define minor 3
-%define update 6
-%define dotver %{major}.%{minor}
-
-%define sourcebasename tbb%{major}%{minor}_%{releasedate}oss
-%define sourcefilename %{sourcebasename}_src.tgz
-
-Name:    tbb
-Summary: The Threading Building Blocks library abstracts low-level threading details
-Summary(ja): スレッド処理を抽象化するスレッディング・ビルディング・ブロックライブラリ
-Version: %{dotver}%{?update:u%{update}}
-Release: 2%{?_dist_release}
-License: GPLv2 with exceptions
-Group:   System Environment/Libraries
-URL:     http://threadingbuildingblocks.org/
-
-Source0: http://threadingbuildingblocks.org/sites/default/files/software_releases/source/%{sourcebasename}_src.tgz
-# These two are downstream sources.
-Source6: tbb.pc
-Source7: tbbmalloc.pc
-Source8: tbbmalloc_proxy.pc
-
-# Propagate CXXFLAGS variable into flags used when compiling C++.
-# This so that RPM_OPT_FLAGS are respected.
-Patch1: tbb-3.0-cxxflags.patch
-
-# Replace mfence with xchg (for 32-bit builds only) so that TBB
-# compiles and works supported hardware.  mfence was added with SSE2,
-# which we still don't assume.
-Patch2: tbb-4.0-mfence.patch
+%bcond_with test
+
+Name:           tbb
+Summary:        The Threading Building Blocks library abstracts low-level threading details
+Summary(ja):    スレッド処理を抽象化するスレッディング・ビルディング・ブロックライブラリ
+Version:        2020.2
+Release:        1%{?_dist_release}
+Group:          System Environment/Libraries
+Vendor:         Project Vine
+Distribution:   Vine Linux
+
+
+License:        ASL 2.0
+URL:            https://github.com/oneapi-src/oneTBB
+
+Source0:        https://github.com/intel/tbb/archive/v%{version}/%{name}-%{version}.tar.gz
+# These three are downstream sources.
+Source6:        tbb.pc
+Source7:        tbbmalloc.pc
+Source8:        tbbmalloc_proxy.pc
 
 # Don't snip -Wall from C++ flags.  Add -fno-strict-aliasing, as that
 # uncovers some static-aliasing warnings.
 # Related: https://bugzilla.redhat.com/show_bug.cgi?id=1037347
-Patch3: tbb-4.3-dont-snip-Wall.patch
+Patch0: tbb-2019-dont-snip-Wall.patch
+
+# Make attributes of aliases match those on the aliased function.
+Patch1: tbb-2020-attributes.patch
+
+# Fix test-thread-monitor, which had multiple bugs that could (and did, on
+# ppc64le) result in a hang.
+Patch2: tbb-2019-test-thread-monitor.patch
+
+# Fix a test that builds a 4-thread barrier, but cannot guarantee that more
+# than 2 threads will be available to use it.
+Patch3: tbb-2019-test-task-scheduler-init.patch
+
+# Fix compilation on aarch64 and s390x.  See
+# https://github.com/intel/tbb/issues/186
+Patch4: tbb-2019-fetchadd4.patch
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-root
+BuildRequires: doxygen
 BuildRequires: libstdc++-devel
+BuildRequires: python3-rpm-macros
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: swig
 
 %description
 Threading Building Blocks (TBB) is a C++ runtime library that
@@ -53,7 +61,7 @@ maintenance is required as more processor cores become available.
 
 %package devel
 Summary: The Threading Building Blocks C++ headers and shared development libraries
-Summary(ja): スレッディング・ビルディング・ブロックの C++ ヘッダファイルと開発用共有ライブラリ
+Summary(ja): TBBの C++ ヘッダファイルと開発用共有ライブラリ
 Group: Development/Libraries
 Requires: %{name} = %{version}-%{release}
 
@@ -64,7 +72,7 @@ Blocks (TBB) C++ libraries.
 
 %package doc
 Summary: The Threading Building Blocks documentation
-Summary(ja): スレッディング・ビルディング・ブロックのドキュメント
+Summary(ja): TBBのドキュメント
 Group: Documentation
 BuildArch: noarch
 
@@ -73,24 +81,73 @@ PDF documentation for the user of the Threading Building Block (TBB)
 C++ library.
 
 
+%package -n python3-%{name}
+Summary: Python 3 TBB module
+%{?python_provide:%python_provide python3-%{name}}
+
+%description -n python3-%{name}
+Python 3 TBB module.
+
+
 %prep
-%setup -q -n %{sourcebasename}
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
+%autosetup -p1 -n oneTBB-%{version}
+
+# For repeatable builds, don't query the hostname or architecture
+sed -i 's/"`hostname -s`" ("`uname -m`"/fedorabuild (%{_arch}/' \
+    build/version_info_linux.sh
+
+# Do not assume the RTM instructions are available.
+# Insert --as-needed before the libraries to be linked.
+sed -e 's/-mrtm//' \
+    -e "s/-fPIC/& -Wl,--as-needed/" \
+    -i build/linux.gcc.inc
+
+# Invoke the right python binary directly
+sed -i 's,env python,python3,' python/TBB.py python/tbb/__*.py
+
+# Remove shebang from files that don't need it
+sed -i '/^#!/d' python/tbb/{pool,test}.py
+
 
 %build
-make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS" tbb_build_prefix=obj
+make %{?_smp_mflags} tbb_build_prefix=obj stdver=c++14 \
+    compiler=gcc \
+    CXXFLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
+    LDFLAGS="$RPM_LD_FLAGS -lpthread"
 for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
-    sed 's/_FEDORA_VERSION/%{major}.%{minor}.%{update}/' ${file} \
-        > $(basename ${file})
+    base=$(basename ${file})
+    sed 's/_FEDORA_VERSION/%{version}/' ${file} > ${base}
+    touch -r ${file} ${base}
 done
 
+# Build for python 3
+. build/obj_release/tbbvars.sh
+pushd python
+make %{?_smp_mflags} -C rml stdver=c++14 \
+    compiler=gcc \
+    CPLUS_FLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
+    LDFLAGS="$RPM_LD_FLAGS -lpthread"
+cp -p rml/libirml.so* .
+%py3_build
+popd
+
+# Build the documentation
+make doxygen
+
+
+%if %{with test}
 %check
-%ifarch ppc64le
-make test
+# This test assumes it can create thread barriers for arbitrary numbers of
+# threads, but tbb limits the number of threads spawned to a function of the
+# number of CPUs available.  Some of the koji builders have a small number of
+# CPUs, so the test hangs waiting for threads that have not been created to
+# arrive at the barrier.  Skip this test until upstream fixes it.
+sed -i '/test_task_scheduler_observer/d' build/Makefile.test
+
+make test tbb_build_prefix=obj stdver=c++14 CXXFLAGS="%{optflags}"
 %endif
 
+
 %install
 rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT%{_libdir}
@@ -98,44 +155,81 @@ mkdir -p $RPM_BUILD_ROOT%{_includedir}
 
 pushd build/obj_release
     for file in libtbb{,malloc{,_proxy}}; do
-        install -p -D -m 755 ${file}.so.2 $RPM_BUILD_ROOT%{_libdir}
-        ln -s $file.so.2 $RPM_BUILD_ROOT%{_libdir}/$file.so
+        install -p -D -m 755 ${file}.so.2 $RPM_BUILD_ROOT/%{_libdir}
+        ln -s $file.so.2 $RPM_BUILD_ROOT/%{_libdir}/$file.so
     done
 popd
 
 pushd include
     find tbb -type f ! -name \*.htm\* -exec \
-        install -p -D -m 644 {} $RPM_BUILD_ROOT%{_includedir}/{} \
+        install -p -D -m 644 {} $RPM_BUILD_ROOT/%{_includedir}/{} \
     \;
 popd
 
 for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
     install -p -D -m 644 $(basename ${file}) \
-	$RPM_BUILD_ROOT%{_libdir}/pkgconfig/$(basename ${file})
+        $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/$(basename ${file})
 done
 
+# Install the rml headers
+mkdir -p $RPM_BUILD_ROOT%{_includedir}/rml
+cp -p src/rml/include/*.h $RPM_BUILD_ROOT%{_includedir}/rml
+
+# Python 3 install
+. build/obj_release/tbbvars.sh
+pushd python
+%py3_install
+chmod a+x $RPM_BUILD_ROOT%{python3_sitearch}/TBB.py
+chmod a+x $RPM_BUILD_ROOT%{python3_sitearch}/tbb/__*.py
+cp -p libirml.so.1 $RPM_BUILD_ROOT%{_libdir}
+ln -s libirml.so.1 $RPM_BUILD_ROOT%{_libdir}/libirml.so
+popd
+
+# Install the cmake files
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/cmake
+cp -a cmake $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}
+rm $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}/README.rst
+
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
+
 %files
-%doc COPYING doc/Release_Notes.txt
-%{_libdir}/*.so.2
+%doc doc/Release_Notes.txt README.md
+%license LICENSE
+%{_libdir}/*.so.*
 
 %files devel
 %doc CHANGES
-%{_includedir}/tbb
+%doc CHANGES cmake/README.rst
+%{_includedir}/rml/
+%{_includedir}/tbb/
 %{_libdir}/*.so
+%{_libdir}/cmake/tbb/
 %{_libdir}/pkgconfig/*.pc
 
 %files doc
 %doc doc/Release_Notes.txt
-%doc doc/html
+%doc html
+
+
+%files -n python3-%{name}
+%doc python/index.html
+%{python3_sitearch}/TBB*
+%{python3_sitearch}/tbb/
+%{python3_sitearch}/__pycache__/TBB*
+
 
 %changelog
+* Tue Jun 30 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2020.2-1
+- new upstream release.
+
 * Sat Sep 03 2016 Toshiaki Ara <ara_t@384.jp> - 4.3u6-2
 - rebuild with gcc-5.4.0