From owner-svn-ports-head@freebsd.org Sun Feb 21 16:17:36 2021 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B79B55ACCF; Sun, 21 Feb 2021 16:17:36 +0000 (UTC) (envelope-from cmt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dk9Sw0pQLz4rVH; Sun, 21 Feb 2021 16:17:36 +0000 (UTC) (envelope-from cmt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0447515AA4; Sun, 21 Feb 2021 16:17:36 +0000 (UTC) (envelope-from cmt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 11LGHZM0071989; Sun, 21 Feb 2021 16:17:35 GMT (envelope-from cmt@FreeBSD.org) Received: (from cmt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 11LGHZfW071987; Sun, 21 Feb 2021 16:17:35 GMT (envelope-from cmt@FreeBSD.org) Message-Id: <202102211617.11LGHZfW071987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cmt set sender to cmt@FreeBSD.org using -f From: Christoph Moench-Tegeder Date: Sun, 21 Feb 2021 16:17:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r566231 - in head/graphics/shotwell: . files X-SVN-Group: ports-head X-SVN-Commit-Author: cmt X-SVN-Commit-Paths: in head/graphics/shotwell: . files X-SVN-Commit-Revision: 566231 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2021 16:17:36 -0000 Author: cmt Date: Sun Feb 21 16:17:35 2021 New Revision: 566231 URL: https://svnweb.freebsd.org/changeset/ports/566231 Log: make shotwell's facedetection code compile with opencv 4 Patch adapted from upstream: https://gitlab.gnome.org/GNOME/shotwell/-/commit/f54094594016359bbafd0be44a53ea28c8968593 At the same time, linking against opencv 4 fails when compiling shotwell with gcc. As a stopgap measure, disable option OPENMP (which currently forces use of gcc, but work is underway to switch that to llvm (see PR 252379). I'll revisit OPENMP once 252379 has landed). Added: head/graphics/shotwell/files/patch-facedetect_meson.build (contents, props changed) head/graphics/shotwell/files/patch-facedetect_shotwell-facedetect.cpp (contents, props changed) Modified: head/graphics/shotwell/Makefile Modified: head/graphics/shotwell/Makefile ============================================================================== --- head/graphics/shotwell/Makefile Sun Feb 21 16:06:23 2021 (r566230) +++ head/graphics/shotwell/Makefile Sun Feb 21 16:17:35 2021 (r566231) @@ -3,7 +3,7 @@ PORTNAME= shotwell PORTVERSION= 0.30.11 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics gnome MASTER_SITES= GNOME @@ -32,8 +32,9 @@ LIB_DEPENDS= libgio-2.0.so:devel/glib20 \ libwebkit2gtk-4.0.so:www/webkit2-gtk3 \ libxml2.so:textproc/libxml2 -USES= gettext desktop-file-utils gnome meson ninja pkgconfig \ - python:3.4+,build shebangfix sqlite tar:xz xorg +# USES compiler: also see option OPENMP below +USES= compiler:c++11-lib desktop-file-utils gettext gnome meson \ + ninja pkgconfig python:3.4+,build shebangfix sqlite tar:xz xorg USE_GNOME= cairo dconf gtk30 USE_GSTREAMER1= yes USE_LDCONFIG= yes @@ -49,18 +50,21 @@ INSTALLS_ICONS= yes PORTSCOUT= limitw:1,even MAKE_JOBS_UNSAFE= yes -OPTIONS_DEFINE= FACED OPENMP +# facedetection fails to link against opencv4 when building with GCC +# disable openmp until llvm becomes the default openmp provider, then +# try again +OPTIONS_DEFINE= FACED # OPENMP OPTIONS_SUB= yes FACED_DESC= Face Detection -OPENMP_DESC= libraw uses OpenMP (implies GCC) +# OPENMP_DESC= libraw uses OpenMP (implies GCC) FACED_CONFIGURE_ON= -Dface-detection=true FACED_CONFIGURE_OFF= -Dface-detection=false FACED_LIB_DEPENDS= libopencv_core.so:graphics/opencv \ libopencv_photo.so:graphics/opencv -OPENMP_USES= compiler:openmp -OPENMP_USES_OFF= compiler:c++11-lib +# OPENMP_USES= compiler:openmp +# OPENMP_USES_OFF= compiler:c++11-lib PLIST_SUB= DISTVERSION=${DISTVERSION} Added: head/graphics/shotwell/files/patch-facedetect_meson.build ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/shotwell/files/patch-facedetect_meson.build Sun Feb 21 16:17:35 2021 (r566231) @@ -0,0 +1,10 @@ +--- facedetect/meson.build.orig 2020-11-05 20:48:33 UTC ++++ facedetect/meson.build +@@ -1,6 +1,6 @@ + subproject = ('facedetect') + add_languages('cpp') +-facedetect_dep = dependency('opencv', version : ['>= 2.3.0'], required : true) ++facedetect_dep = dependency('opencv4', version : ['>= 4.0.0'], required : true) + executable('shotwell-facedetect', + 'shotwell-facedetect.cpp', + dependencies : facedetect_dep, Added: head/graphics/shotwell/files/patch-facedetect_shotwell-facedetect.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/shotwell/files/patch-facedetect_shotwell-facedetect.cpp Sun Feb 21 16:17:35 2021 (r566231) @@ -0,0 +1,20 @@ +--- facedetect/shotwell-facedetect.cpp.orig 2021-02-21 15:22:50 UTC ++++ facedetect/shotwell-facedetect.cpp +@@ -34,7 +34,7 @@ void help() { + void detectFaces(Mat &img, CascadeClassifier &cascade, double scale) { + + Mat gray; +- cvtColor(img, gray, CV_BGR2GRAY); ++ cvtColor(img, gray, COLOR_BGR2GRAY); + + Mat smallImg(cvRound(img.rows / scale), cvRound(img.cols / scale), CV_8UC1); + Size smallImgSize = smallImg.size(); +@@ -43,7 +43,7 @@ void detectFaces(Mat &img, CascadeClassifier &cascade, + equalizeHist(smallImg, smallImg); + + vector faces; +- cascade.detectMultiScale(smallImg, faces, 1.1, 2, CV_HAAR_SCALE_IMAGE, Size(30, 30)); ++ cascade.detectMultiScale(smallImg, faces, 1.1, 2, CASCADE_SCALE_IMAGE, Size(30, 30)); + + int i = 0; + for (vector::const_iterator r = faces.begin(); r != faces.end(); r++, i++) {