From b40de40874f877b2ad68aed3caa46d87a4f44792 Mon Sep 17 00:00:00 2001 From: extrowerk <5569059+extrowerk@users.noreply.github.com> Date: Sat, 28 Nov 2020 20:10:39 +0100 Subject: [PATCH] OpenCV: decomission python2 (#5442) * OpenCV: decomission python2 * Fix Python module-path --- media-libs/opencv/opencv-4.5.0.recipe | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/media-libs/opencv/opencv-4.5.0.recipe b/media-libs/opencv/opencv-4.5.0.recipe index d7b529825..1d2b3334e 100644 --- a/media-libs/opencv/opencv-4.5.0.recipe +++ b/media-libs/opencv/opencv-4.5.0.recipe @@ -10,7 +10,7 @@ COPYRIGHT="2000-2020, Intel Corporation 2015-2016, Itseez Inc. 2019-2020, Xperience AI" LICENSE="BSD (3-clause)" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/opencv/opencv/archive/$portVersion.tar.gz" SOURCE_FILENAME="opencv-$portVersion.tar.gz" CHECKSUM_SHA256="dde4bf8d6639a5d3fe34d5515eab4a15669ded609a1d622350c7ff20dace1907" @@ -104,6 +104,14 @@ REQUIRES_devel=" opencv$secondaryArchSuffix == $portVersion base " +PROVIDES_python=" + opencv${secondaryArchSuffix}_python = $portVersionCompat + " +REQUIRES_python=" + haiku$secondaryArchSuffix + opencv$secondaryArchSuffix == $portVersion base + " + PROVIDES_tools=" opencv${secondaryArchSuffix}_tools = $portVersionCompat cmd:opencv_annotation$commandSuffix = $portVersion @@ -115,6 +123,8 @@ PROVIDES_tools=" REQUIRES_tools=" haiku$secondaryArchSuffix opencv$secondaryArchSuffix == $portVersion base + cmd:f2py3 + cmd:python3 " BUILD_REQUIRES=" @@ -167,7 +177,6 @@ BUILD_PREREQUIRES=" # cmd:ant cmd:cmake cmd:doxygen - cmd:f2py2 cmd:f2py3 cmd:gcc$secondaryArchSuffix # cmd:javac @@ -176,7 +185,6 @@ BUILD_PREREQUIRES=" cmd:make # cmd:matlab # maybe later cmd:pkg_config$secondaryArchSuffix - cmd:python2 cmd:python3 " @@ -206,6 +214,8 @@ BUILD() ARCH_SUBDIR="$secondaryArchSuffix/" fi + pythonVersion=$(python3 --version 2>&1 | sed 's/Python //' | head -c3) + cmake .. \ -DWITH_GDAL=ON \ -DWITH_IPP=OFF \ @@ -217,11 +227,12 @@ BUILD() -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_RPATH=ON \ -DENABLE_PIC=OFF \ - -D OPENCV_GENERATE_PKGCONFIG=YES \ + -DOPENCV_GENERATE_PKGCONFIG=YES \ -DCMAKE_INSTALL_PREFIX:PATH="$prefix" \ -DOPENCV_OTHER_INSTALL_PATH:PATH="$dataDir" \ -DOpenBLAS_INCLUDE_DIR="$portPackageLinksDir/openblas${secondaryArchSuffix}_devel/develop/headers/$ARCH_SUBDIR" \ - -DOpenBLAS_LIB="$portPackageLinksDir/openblas${secondaryArchSuffix}_devel/develop/lib/$ARCH_SUBDIR" + -DOpenBLAS_LIB="$portPackageLinksDir/openblas${secondaryArchSuffix}_devel/develop/lib/$ARCH_SUBDIR" \ + -DPYTHON3_PACKAGES_PATH="$prefix/lib/python$pythonVersion/vendor-packages" make $jobArgs } @@ -268,6 +279,10 @@ INSTALL() $developDir \ $libDir/cmake + # python package + packageEntries python \ + $prefix/lib/python* + # tools package packageEntries tools \ $binDir