From 7ca89c6e3fb412346d4a1907e22bbb29de50dee5 Mon Sep 17 00:00:00 2001
From: Meng Zhuo <mengzhuo@iscas.ac.cn>
Date: Tue, 14 Jan 2025 21:21:36 +0800
Subject: [PATCH] community/opencv: upgrade to 4.11.0

---
 community/opencv/APKBUILD          | 10 ++---
 community/opencv/loongarch64.patch | 62 ------------------------------
 2 files changed, 4 insertions(+), 68 deletions(-)
 delete mode 100644 community/opencv/loongarch64.patch

diff --git a/community/opencv/APKBUILD b/community/opencv/APKBUILD
index f8c69aaf0236..b7e4914dbe7b 100644
--- a/community/opencv/APKBUILD
+++ b/community/opencv/APKBUILD
@@ -1,8 +1,8 @@
 # Contributor: Marian Buschsieweke <marian.buschsieweke@posteo.net>
 # Maintainer: Meng Zhuo <mengzhuo@iscas.ac.cn>
 pkgname=opencv
-pkgver=4.10.0
-pkgrel=4
+pkgver=4.11.0
+pkgrel=0
 pkgdesc="Open source computer vision and machine learning library"
 url="https://opencv.org/"
 # s390x blocked by vtk -> netcdf
@@ -77,7 +77,6 @@ subpackages="
 	"
 source="https://github.com/opencv/opencv/archive/$pkgver/opencv-$pkgver.tar.gz
 	https://github.com/opencv/opencv_contrib/archive/$pkgver/opencv_contrib-$pkgver.tar.gz
-	loongarch64.patch
 	"
 # Tests require human interaction
 # net required to download a data file (face_landmark_model.dat)
@@ -204,7 +203,6 @@ _lib() {
 }
 
 sha512sums="
-b4f7248f89f1cd146dbbae7860a17131cd29bd3cb81db1e678abfcfbf2d8fa4a7633bfd0edbf50afae7b838c8700e8c0d0bb05828139d5cb5662df6bbf3eb92c  opencv-4.10.0.tar.gz
-480df862250692a97ce6431cba00dbecb70332307a19c1c04aa9d7444e6e74ab4f8c798548dce76d2319a9877624b82e361fb22a71df14b996087ade448be501  opencv_contrib-4.10.0.tar.gz
-73ffb0c5f3648ceefa8a79f98105716e2cecbae8f0c86e20b55941cefe1924c956c7935ba9cdaa2d61ba9b090627e9ad079b72e4b9d01626512a33c0d6296fff  loongarch64.patch
+3b6e0da8169449944715de9e66380977791069a1d8288534ec768eaa2fb68533821fd8e06eac925a26656baf42185258b13aa80579e1e9be3ebc18fcea66f24d  opencv-4.11.0.tar.gz
+a5ebb6810a3b5e40858b7fd533f9eb7b3d475dfda843a489bc5168e72c5eaad0a7a23629aace1f43e1b62d9c24e5e1923d841059c297728fac464e00759886c2  opencv_contrib-4.11.0.tar.gz
 "
diff --git a/community/opencv/loongarch64.patch b/community/opencv/loongarch64.patch
deleted file mode 100644
index 7a799e0c90b3..000000000000
--- a/community/opencv/loongarch64.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Patch source: https://github.com/opencv/opencv/commit/5638c38d530e2f524eeecbba80cf6deae2c0667a.patch
-From 5638c38d530e2f524eeecbba80cf6deae2c0667a Mon Sep 17 00:00:00 2001
-From: Hao Chen <chenhao@loongson.cn>
-Date: Thu, 4 Jul 2024 15:04:24 +0800
-Subject: [PATCH] Resolve compilation bug
-
-Fixed a bug that occurred when compiling with the clang18 compiler.
-
-Signed-off-by: Hao Chen <chenhao@loongson.cn>
----
- .../include/opencv2/core/hal/intrin_lasx.hpp  | 22 ++++++++++---------
- 1 file changed, 12 insertions(+), 10 deletions(-)
-
-diff --git a/modules/core/include/opencv2/core/hal/intrin_lasx.hpp b/modules/core/include/opencv2/core/hal/intrin_lasx.hpp
-index 4a98dbf96ebe..db491cc1375d 100644
---- a/modules/core/include/opencv2/core/hal/intrin_lasx.hpp
-+++ b/modules/core/include/opencv2/core/hal/intrin_lasx.hpp
-@@ -650,16 +650,18 @@ inline v_float32x8 v256_shuffle(const v_float32x8 &a)
- template<int m>
- inline v_float64x4 v256_shuffle(const v_float64x4 &a)
- {
--    int imm8 = m & 0b0001;  //0 or 1
--    if (m & 0x0b0010) imm8 |= 0b0100;
--    //else imm8 |= 0b0000;
--    if (m & 0x0b0100) imm8 |= 0b110000;  //2 or 3
--    else imm8 |= 0b100000;
--    if (m & 0x0b1000) imm8 |= 0b11000000;
--    else imm8 |= 0b10000000;
-+    const int m1 = m & 0b1;
-+    const int m2 = m & 0b10;
-+    const int m3 = m & 0b100;
-+    const int m4 = m & 0b1000;
-+    const int m5 = m2 << 1;
-+    const int m6 = m3 << 2;
-+    const int m7 = m4 << 3;
-+    const int m8 = m1 & m5 & m6 & m7;
- 
--    return v_float64x4(__lasx_xvpermi_d(*((__m256i*)&a.val), imm8));
-+    return v_float64x4(__lasx_xvshuf4i_d(*((__m256i*)&a.val), *((__m256i*)&a.val), m8));
- }
-+
- template<typename _Tpvec>
- inline void v256_zip(const _Tpvec& a, const _Tpvec& b, _Tpvec& ab0, _Tpvec& ab1)
- {
-@@ -1100,7 +1102,7 @@ inline v_uint8x32 v_rotate_right(const v_uint8x32& a, const v_uint8x32& b)
- template<int imm>
- inline v_uint8x32 v_rotate_left(const v_uint8x32& a)
- {
--    enum {IMM_L = (imm - 16) & 0xFF};
-+    enum {IMM_L = ((imm - 16) & 0xFF) > 31 ? 31 : ((imm - 16) & 0xFF)};
-     enum {IMM_R = (16 - imm) & 0xFF};
- 
-     if (imm == 0) return a;
-@@ -1117,7 +1119,7 @@ inline v_uint8x32 v_rotate_left(const v_uint8x32& a)
- template<int imm>
- inline v_uint8x32 v_rotate_right(const v_uint8x32& a)
- {
--    enum {IMM_L = (imm - 16) & 0xFF};
-+    enum {IMM_L = ((imm - 16) & 0xFF) > 31 ? 31 : ((imm - 16) & 0xFF)};
- 
-     if (imm == 0) return a;
-     if (imm > 32) return v_uint8x32();
-- 
GitLab