community/gmic to 2.4.1-2

This commit is contained in:
Kevin Mihelich 2018-11-24 13:40:19 +00:00
parent d3ae88c9c3
commit ce8590668f
3 changed files with 66 additions and 5 deletions

View file

@ -12,18 +12,26 @@ highmem=1
pkgbase=gmic
pkgname=(gmic zart gimp-plugin-gmic krita-plugin-gmic)
pkgver=2.4.1
pkgrel=1
pkgrel=2
arch=(x86_64)
url="http://gmic.eu/"
license=(custom:CeCILL)
makedepends=(gimp qt5-base fftw openexr opencv git)
source=(https://gmic.eu/files/source/gmic_$pkgver.tar.gz)
sha256sums=('446b465d2ff7314add634115f6bffecd136ad96759eb92f76c03f231f44188d6')
source=(https://gmic.eu/files/source/gmic_$pkgver.tar.gz gmic-opencv4.patch zart-opencv4.patch)
sha256sums=('446b465d2ff7314add634115f6bffecd136ad96759eb92f76c03f231f44188d6'
'1ffb4f8952be152ba2956a50ff6c39b078e547a4d3386cc2f34549124aefbed3'
'182c6723708302a8cee92bfb45a40ff09b8903c649ce856d0d8cd10aab0ee39b')
prepare() {
sed -e 's|/etc/bash_completion.d|/usr/share/bash-completion/completions|g' -i gmic-$pkgver/src/Makefile
# fix overlinking
sed -e 's/pkg-config opencv --libs ||//' -e 's/-lopencv_highgui/-lopencv_videoio/' -i gmic-$pkgver/src/Makefile
sed -e 's/pkg-config opencv --libs ||//' -e 's/-lopencv_highgui/-lopencv_videoio/' \
-e 's/pkg-config opencv/pkg-config opencv4/' -i gmic-$pkgver/src/Makefile
# fix build with openCV 4.0
cd gmic-$pkgver/src
patch -p1 -i "$srcdir"/gmic-opencv4.patch
cd ../zart
patch -p1 -i "$srcdir"/zart-opencv4.patch
sed -i "s|-mtune=generic|${CFLAGS}|" gmic-$pkgver/src/Makefile
}
@ -41,7 +49,7 @@ build() {
make
cd ../zart
qmake GMIC_PATH=../src GMIC_DYNAMIC_LINKING=on
qmake GMIC_PATH=../src GMIC_DYNAMIC_LINKING=on QMAKE_CXXFLAGS+=" -DOPENCV2_HEADERS"
make
}

View file

@ -0,0 +1,14 @@
diff --git a/CImg.h b/CImg.h
index af63bcb..c7757fc 100644
--- a/CImg.h
+++ b/CImg.h
@@ -414,8 +414,7 @@
#define _cimg_redefine_False
#endif
#include <cstddef>
-#include "cv.h"
-#include "highgui.h"
+#include <opencv2/videoio/videoio_c.h>
#endif
// Configure LibPNG support.

View file

@ -0,0 +1,39 @@
diff --git a/include/VideoFileSource.h b/include/VideoFileSource.h
index 0fda14e..8c15178 100644
--- a/include/VideoFileSource.h
+++ b/include/VideoFileSource.h
@@ -50,6 +50,8 @@
#if defined(HAS_OPENCV2_HEADERS) || defined(OPENCV2_HEADERS)
#include <opencv2/core/core_c.h>
#include <opencv2/highgui/highgui_c.h>
+#include <opencv2/videoio.hpp>
+#include <opencv2/videoio/videoio_c.h>
#else
#include <cv.h>
#include <highgui.h>
diff --git a/include/WebcamSource.h b/include/WebcamSource.h
index 8c1911a..9194385 100644
--- a/include/WebcamSource.h
+++ b/include/WebcamSource.h
@@ -51,6 +51,8 @@
#if defined(HAS_OPENCV2_HEADERS) || defined(OPENCV2_HEADERS)
#include <opencv2/core/core_c.h>
#include <opencv2/highgui/highgui_c.h>
+#include <opencv2/videoio.hpp>
+#include <opencv2/videoio/videoio_c.h>
#else
#include <cv.h>
#include <highgui.h>
diff --git a/zart.pro b/zart.pro
index d98a192..ddb2d3b 100644
--- a/zart.pro
+++ b/zart.pro
@@ -19,7 +19,7 @@ greaterThan(QT_MAJOR_VERSION, 4): CONFIG += c++11
CONFIG += warn_on
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
-PKGCONFIG += opencv fftw3 zlib
+PKGCONFIG += opencv4 fftw3 zlib
# LIBS += -lfftw3_threads
DEFINES += cimg_use_fftw3 cimg_use_zlib