From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aDINISSGk2D+jQAAgWs5BA (envelope-from ) for ; Thu, 06 May 2021 08:01:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id VYToHCSGk2BzQgAA1q6Kng (envelope-from ) for ; Thu, 06 May 2021 06:01:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CCBA81735B for ; Thu, 6 May 2021 08:01:07 +0200 (CEST) Received: from localhost ([::1]:60748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leX4M-0006zB-TM for larch@yhetil.org; Thu, 06 May 2021 02:01:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leX4I-0006yK-IA for guix-patches@gnu.org; Thu, 06 May 2021 02:01:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leX4I-0003C2-9T for guix-patches@gnu.org; Thu, 06 May 2021 02:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1leX4I-00013d-78 for guix-patches@gnu.org; Thu, 06 May 2021 02:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48251] [PATCH] gnu: Update opencv Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 May 2021 06:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48251 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48251@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16202808254042 (code B ref -1); Thu, 06 May 2021 06:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 May 2021 06:00:25 +0000 Received: from localhost ([127.0.0.1]:36781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leX3g-000138-Pn for submit@debbugs.gnu.org; Thu, 06 May 2021 02:00:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:33870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leX3b-000131-TG for submit@debbugs.gnu.org; Thu, 06 May 2021 02:00:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leX3b-0006p2-Ka for guix-patches@gnu.org; Thu, 06 May 2021 02:00:19 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]:33362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leX3Y-0002bR-QY for guix-patches@gnu.org; Thu, 06 May 2021 02:00:19 -0400 Received: by mail-il1-x12d.google.com with SMTP id y10so3869236ilv.0 for ; Wed, 05 May 2021 23:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=8PVV1lI0XlkMynTZAf4O57OnwFQ0v0BH56EVYIadY6s=; b=GzERbkFRSQIOCmK2Jan2M4jxzfrWa0NaVlCYdIt7hioBD2a+tIv91RiykklFaKRArl L1cxScztkA/vc/QQvEYvoKF99YS1waGiDlppdYEOW2uRlEX+K+f7YPEDLomGQ89tbEIz hbw/N6LZ33mhj8KK7DLMRPRwaYvGRcKpCESEWc41xALt0N5XvucrreCDEFXn/kf7i8pp k8xpA3Ybu1igMrhFDCZsGWV1Qus5ZLkweULKE+auhpBdtElLBG3dcAUED0B38E94Cv5h d6Vl4SSk/QX043Kl11J65TniyXLWx5VWSgUZMN5VKR6CRgxlvJ9tHnMgXWqVwwuGfwvc FI9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8PVV1lI0XlkMynTZAf4O57OnwFQ0v0BH56EVYIadY6s=; b=m3ekkYX6RJZtVOwLi+80th6IeuR9/S7VgrW1tKbTohv6ZlQv81UduYHAbJh0mn8yt8 Z3ZmfenrPjV3NiMKBLYkX+Dta3rBzgFVZZVs1IW9HOKRZN3antp+ntq1I2o/ll79kS62 t/qegH/bvVDIVzpnPSpSlU5VcLg75JZx2GtmyKp9E9D2tn/CUzDX1c+ffkJwgHgDf9L+ KdQj/vcctNdmF30HK/jpDZgXmpQQDEdcpvyLQLNc1Ci5BtMJQibtAfysJcFW1rtj5RT6 z70LxhYKFve8P/yPDUWuHp8V7Rx/1kzk890ZgsvLy0VnrO5LN6JoysUv/sdoB3lAPuCg l71Q== X-Gm-Message-State: AOAM530NrYEuQKiw7gUgIl5zz3o61+1veWOAQ8wiFoXmGlr8IQdNDptk jIysblkfJ70/x1GG4SGyM/V1I1EN77z0VPTrVEzevDDeXBg= X-Google-Smtp-Source: ABdhPJxBfEUEd5aHbMtYGL3Pov78tE158if4F7ZFalh7TFIpax+yWxWaK+SpqjdyHhxXdt/AtHCeWpk+F8uNvei4OQI= X-Received: by 2002:a05:6e02:2197:: with SMTP id j23mr2658217ila.269.1620280813783; Wed, 05 May 2021 23:00:13 -0700 (PDT) MIME-Version: 1.0 From: Andy Tai Date: Wed, 5 May 2021 22:59:37 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::12d; envelope-from=lichengtai@gmail.com; helo=mail-il1-x12d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620280868; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=8PVV1lI0XlkMynTZAf4O57OnwFQ0v0BH56EVYIadY6s=; b=cW27/Cle03Huq6sPRyPp7E6CFw7jvMbCbJS3/M4OZAs67tU8HwfRkWTghkrzSobbWc+npF wGH76i2lXq/boTDjx9iBoVMuzx3uHx9RmvPSJgJ2x8Kc3NXiZUpSovWVGMlCoqIuMqL9jM 9CWbyKzb+LPGLm68k3SvKq2IqEUFH58KrfNp2U1DmPu1e7laL+r2DRJpcD9cpY42jYVLyY m8ZSiMH4o4uhdzzrOo9whE+OB2EzK3qxLNcUSKQP83Q7J8WspTBn7wG+IoV7w4gh751LyB tOT/8RCb+bDKrlsNHtCTafyoIpnJNiP7Fb2VP8yVT40wB+yxo373Fi7han1NWQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620280868; a=rsa-sha256; cv=none; b=PVV+xQpFUvwxHKKmIMV1VZY2KC2NqraX95ERAX122XYdYrPyYvtHfPsHPcKOAGNSf2C+da nZvK5M8G+B42b4ET3aqTqcZ95eh06ONWbvUHY1Vl2bl+Nh+Qx6Lk0IkthIcwew5NEyoGsh /JUNmW9eQ8M0Hf51vOWnns2OtJRZo9PquXiV1PAFT0g3YOs7T+bcebKVSnl8cuDSNIst3i hWMoE/doNAWitFvtF+L+gTrpc/Ad3rFuB17kp34G6zH8v9XXurfCtBg6iqI4kqn9GP50w/ sFGr+g/6UaFWxhxie33R0CZiAm2KW5S+HxFQC0YiMYDNrX/7qf3ca5qYoZ8eYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=GzERbkFR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.14 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=GzERbkFR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: CCBA81735B X-Spam-Score: 0.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: wra4sG44ZJHh * gnu/packages/image-processing.scm (opencv): Update to 3.4.14 [arguments]: Adjust #:configure-flags. [inputs]: add opencl-headers, ocl-icd --- gnu/packages/image-processing.scm | 120 +++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 25 deletions(-) diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index ed21b26812..127fbbf8c0 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -65,6 +65,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) #:use-module (gnu packages maths) + #:use-module (gnu packages opencl) #:use-module (gnu packages pdf) #:use-module (gnu packages perl) #:use-module (gnu packages photo) @@ -385,7 +386,7 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") (define-public opencv (package (name "opencv") - (version "3.4.3") + (version "3.4.14") (source (origin (method git-fetch) (uri (git-reference @@ -394,14 +395,35 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") (file-name (git-file-name name version)) (sha256 (base32 - "06bc61r8myym4s8im10brdjfg4wxkrvsbhhl7vr1msdan2xddzi3")) - (patches - (search-patches "opencv-fix-build-of-grfmt_jpeg2000.cpp.patch")) + "0xfgky4j65vq1vy6wcb6p913akgyjw0fdh9b8x6ni7xdladzi0mz")) + ;;(patches + ;; (search-patches "opencv-fix-build-of-grfmt_jpeg2000.cpp.patch")) (modules '((guix build utils))) (snippet '(begin ;; Remove external libraries. We have all available in Guix: - (delete-file-recursively "3rdparty") + ;; except quirc not packaged yet in Guix + ;;(delete-file-recursively "3rdparty") + (for-each delete-file-recursively + '("3rdparty/carotene" + "3rdparty/cpufeatures" + "3rdparty/ffmpeg" + "3rdparty/include" + "3rdparty/ippicv" + "3rdparty/ittnotify" + "3rdparty/libjasper" + "3rdparty/libjpeg" + "3rdparty/libjpeg-turbo" + "3rdparty/libpng" + "3rdparty/libtengine" + "3rdparty/libtiff" + "3rdparty/libwebp" + "3rdparty/openexr" + "3rdparty/openvx" + "3rdparty/protobuf" + ;;"3rdparty/quirc" + "3rdparty/tbb" + "3rdparty/zlib")) ;; Milky icon set is non-free: (delete-file-recursively "modules/highgui/src/files_Qt/Milky") @@ -462,7 +484,23 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") ;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake ;; Cmp this bug entry: ;; https://github.com/opencv/opencv_contrib/issues/1131 - "-DBUILD_opencv_xfeatures2d=OFF") + "-DBUILD_opencv_xfeatures2d=OFF" + + ;; face module disabled as it downloads data face_landmark_model.dat, etc. + ;; cannot be carried out during guix package build + "-DBUILD_opencv_face=OFF" + + ;; allowing external VTK to be found + (string-append "-DVTK_DIR=" (assoc-ref %build-inputs "vtk") "/lib/cmake/vtk-8.0") + + ;; allowing external OpenEXR to be found + ;; for OpenEXR the cmake search script for OpenEXR assumes ilmbase libs also should be found + ;; else it will try to force building the local OpenEXR in 3rdParty directory which we don't want + (string-append "-DOPENEXR_ROOT:PATH=" (assoc-ref %build-inputs "openexr")) + (string-append "-DILMBASE_ROOT:PATH=" (assoc-ref %build-inputs "ilmbase")) + + ) + #:phases (modify-phases %standard-phases (add-after 'unpack 'disable-broken-tests @@ -481,7 +519,7 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") ;; But I couldn't figure out which file was missing: (substitute* "../opencv-contrib/modules/face/test/test_face_align.cpp" (("(TEST\\(CV_Face_FacemarkKazemi, )(can_detect_landmarks\\).*)" - all pre post) + all pre post) (string-append pre "DISABLED_" post))) ;; Failure reason: Bad accuracy @@ -489,6 +527,21 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") (substitute* "../opencv-contrib/modules/rgbd/test/test_odometry.cpp" (("(TEST\\(RGBD_Odometry_Rgbd, )(algorithmic\\).*)" all pre post) (string-append pre "DISABLED_" post))) + + ;; Failure reason: data reading failure + ;; these tests fail due to data reading using protobuf + (substitute* "modules/dnn/test/test_layers.cpp" + (("(TEST_P\\(Test_Caffe_layers, )(Accum\\).*)" all pre post) + (string-append pre "DISABLED_" post))) + (substitute* "modules/dnn/test/test_layers.cpp" + (("(TEST_P\\(Test_Caffe_layers, )(DataAugmentation\\).*)" all pre post) + (string-append pre "DISABLED_" post))) + (substitute* "modules/dnn/test/test_layers.cpp" + (("(TEST_P\\(Test_Caffe_layers, )(Resample\\).*)" all pre post) + (string-append pre "DISABLED_" post))) + (substitute* "modules/dnn/test/test_layers.cpp" + (("(TEST_P\\(Test_Caffe_layers, )(Correlation\\).*)" all pre post) + (string-append pre "DISABLED_" post))) #t)) (add-after 'unpack 'unpack-submodule-sources @@ -497,10 +550,21 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") (mkdir "../opencv-contrib") (copy-recursively (assoc-ref inputs "opencv-extra") "../opencv-extra") - (invoke "tar" "xvf" - (assoc-ref inputs "opencv-contrib") - "--strip-components=1" - "-C" "../opencv-contrib"))) + (copy-recursively (assoc-ref inputs "opencv-contrib") + "../opencv-contrib") + #t)) + + (add-after 'unpack 'patch-cmake-files + (lambda _ + ;; make ILMBASE_ROOT effective + (substitute* "cmake/OpenCVFindOpenEXR.cmake" + (("SET\\(SEARCH_PATHS") "SET\(SEARCH_PATHS\n \"${ILMBASE_ROOT}\"")) + + ;; disable 3rdparty opencl header installation + ;; as we use Guix's opencl header + (substitute* "cmake/OpenCVDetectOpenCL.cmake" + (("ocv_install_3rdparty_licenses") + "#ocv_install_3rdparty_licenses")))) (add-after 'set-paths 'add-ilmbase-include-path (lambda* (#:key inputs #:allow-other-keys) @@ -512,18 +576,21 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") "/include/OpenEXR" ":" (or (getenv "CPATH") ""))) #t)) - (add-before 'check 'start-xserver - (lambda* (#:key inputs #:allow-other-keys) - (let ((xorg-server (assoc-ref inputs "xorg-server")) - (disp ":1")) - (setenv "HOME" (getcwd)) - (setenv "DISPLAY" disp) - ;; There must be a running X server and make check doesn't start one. - ;; Therefore we must do it. - (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp))))))))) + + (add-before 'check 'start-xserver + (lambda* (#:key inputs #:allow-other-keys) + (let ((xorg-server (assoc-ref inputs "xorg-server")) + (disp ":1")) + (setenv "HOME" (getcwd)) + (setenv "DISPLAY" disp) + ;; There must be a running X server and make check doesn't start one. + ;; Therefore we must do it. + (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp)))) + #t))))) (native-inputs `(("pkg-config" ,pkg-config) ("xorg-server" ,xorg-server-for-tests) ; For running the tests + ("opencl-headers" ,opencl-headers) ("opencv-extra" ,(origin (method git-fetch) @@ -532,7 +599,7 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") (commit version))) (file-name (git-file-name "opencv_extra" version)) (sha256 - (base32 "08p5xnq8n1jw8svvz0fnirfg7q8dm3p4a5dl7527s5xj0f9qn7lp")))) + (base32 "1m257hi34p511v4g3g2qx7ny8q2pgfi28lzkfmkilwhmhhw8iw0h")))) ("opencv-contrib" ,(origin (method git-fetch) @@ -540,9 +607,9 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") (url "https://github.com/opencv/opencv_contrib") (commit version))) (file-name (git-file-name "opencv_contrib" version)) - (patches (search-patches "opencv-rgbd-aarch64-test-fix.patch")) + ;;(patches (search-patches "opencv-rgbd-aarch64-test-fix.patch")) (sha256 - (base32 "1f334glf39nk42mpqq6j732h3ql2mpz89jd4mcl678s8n73nfjh2")))))) + (base32 "11mqxnc5bw4yrdy7nwmrl8b98dxsql6s5pvk50dwdswlp06824m6")))))) (inputs `(("libjpeg" ,libjpeg-turbo) ("libpng" ,libpng) ("jasper" ,jasper) @@ -551,15 +618,18 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") ("libtiff" ,libtiff) ("hdf5" ,hdf5) ("libgphoto2" ,libgphoto2) + ("v4l-utils" ,v4l-utils) ;libv4l2 ("libwebp" ,libwebp) ("zlib" ,zlib) ("gtkglext" ,gtkglext) ("openexr" ,openexr) ("ilmbase" ,ilmbase) - ("gtk+" ,gtk+-2) + ("gtk+-2" ,gtk+-2) + ("gtk+" ,gtk+) + ("ocl-icd" ,ocl-icd) ;for OpenCL support ("python-numpy" ,python-numpy) ("protobuf" ,protobuf) - ("vtk" ,vtk) + ("vtk" ,vtk-8) ("python" ,python))) ;; These three CVEs are not a problem of OpenCV, see: ;; https://github.com/opencv/opencv/issues/10998 -- 2.26.3