summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Rogoża2016-10-23 01:27:01 +0200
committerPiotr Rogoża2016-10-23 01:27:01 +0200
commitc8eb956d81715da977d9cb8e35b76ae2b78c7030 (patch)
treeb9191723a337518e4bb02430e33349045091b352
downloadaur-c8eb956d81715da977d9cb8e35b76ae2b78c7030.tar.gz
Adopted opencv2 legacy version and adapt instalation to the /opt directory
-rw-r--r--.SRCINFO37
-rw-r--r--PKGBUILD140
-rw-r--r--opencv_a0fdc91a14f07de25d858037940fcd3ba859b4e2.patch13
3 files changed, 190 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..209e490f5cd
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,37 @@
+# Generated by mksrcinfo v8
+# Sat Oct 22 23:25:02 UTC 2016
+pkgbase = opencv2-opt
+ pkgdesc = Open Source Computer Vision Library (Legacy Version & /opt directory version)
+ pkgver = 2.4.13
+ pkgrel = 1
+ url = http://opencv.org/
+ arch = i686
+ arch = x86_64
+ license = BSD
+ makedepends = cmake
+ makedepends = python2-numpy
+ makedepends = mesa
+ makedepends = eigen2
+ depends = intel-tbb
+ depends = openexr
+ depends = xine-lib
+ depends = libdc1394
+ depends = gtkglext
+ optdepends = opencv2-opt-samples
+ optdepends = eigen2
+ optdepends = libcl: For coding with OpenCL
+ optdepends = python2-numpy: Python 2.x interface
+ source = opencv-2.4.13.zip::https://github.com/Itseez/opencv/archive/2.4.13.zip
+ source = opencv_a0fdc91a14f07de25d858037940fcd3ba859b4e2.patch
+ md5sums = 886b0c511209b2f3129649928135967c
+ md5sums = aebe7878a572a2dc26a434bf08b8d851
+
+pkgname = opencv2-opt
+ provides = opencv2
+ options = staticlibs
+
+pkgname = opencv2-opt-samples
+ pkgdesc = Open Source Computer Vision Library (Legacy Version & /opt directory version) (samples)
+ depends = opencv2-opt=2.4.13
+ provides = opencv2-samples
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6a463fc7ea8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,140 @@
+# Maintainer: Joshua Schüler <joshua.schueler at gmail dotcom>
+# Contributor: Ray Rashif <schiv@archlinux.org>
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+
+
+############################################
+# Here you have the option to use some CPU
+# extensions to speed up opencv
+# Only change this if you know what you
+# are doing!
+############################################
+
+# Use `cat /proc/cpuinfo` to see the extensions your CPU supports
+
+_FORCE_SSE=OFF # always ON on x64
+_FORCE_SSE2=OFF # always ON on x64
+
+# Set to ON on CPUs newer than approx. 2005
+_FORCE_SSE3=OFF
+
+# Set to ON on CPUs since Intel Core 2 or newer/AMD Bulldozer/AMD Fusion
+_FORCE_SSSE3=OFF # also known as SSE4
+
+# Set to ON on CPUs since Intel Core 2 Penryn (older than Nehalem or Sandybridge)
+# or on AMDs since K10 (approx. 2009)
+_FORCE_SSE41=OFF
+
+# Set to ON on nearly all Intel Core i or AMD since Bulldozer
+_FORCE_SSE42=OFF
+
+# Set to ON on Sandybridge or newer/Bulldozer or newer
+_FORCE_AVX=OFF
+
+# Set to ON on Haswell or newer
+_FORCE_AVX2=OFF
+
+############################################
+
+
+_pkgbase=opencv
+pkgbase=opencv2-opt
+pkgname=('opencv2-opt' 'opencv2-opt-samples')
+pkgver=2.4.13
+pkgrel=1
+pkgdesc="Open Source Computer Vision Library (Legacy Version & /opt directory version)"
+arch=('i686' 'x86_64')
+license=('BSD')
+url="http://opencv.org/"
+depends=('intel-tbb' 'openexr' 'xine-lib' 'libdc1394' 'gtkglext')
+makedepends=('cmake' 'python2-numpy' 'mesa' 'eigen2')
+optdepends=('opencv2-opt-samples'
+ 'eigen2'
+ 'libcl: For coding with OpenCL'
+ 'python2-numpy: Python 2.x interface')
+
+source=("$_pkgbase-$pkgver.zip::https://github.com/Itseez/opencv/archive/$pkgver.zip"
+ "opencv_a0fdc91a14f07de25d858037940fcd3ba859b4e2.patch")
+md5sums=('886b0c511209b2f3129649928135967c'
+ 'aebe7878a572a2dc26a434bf08b8d851')
+
+_cmakeopts=('-D WITH_CUDA=OFF' # Disable CUDA for now because GCC 6.1.1 and nvcc don't play along yet
+ '-D WITH_OPENCL=ON'
+ '-D WITH_OPENGL=ON'
+ '-D WITH_TBB=ON'
+ '-D WITH_XINE=ON'
+ '-D WITH_GSTREAMER=OFF'
+ '-D BUILD_WITH_DEBUG_INFO=OFF'
+ '-D BUILD_TESTS=OFF'
+ '-D BUILD_PERF_TESTS=OFF'
+ '-D BUILD_EXAMPLES=ON'
+ '-D INSTALL_C_EXAMPLES=ON'
+ '-D INSTALL_PYTHON_EXAMPLES=ON'
+ '-D CMAKE_BUILD_TYPE=Release'
+ "-D CMAKE_INSTALL_PREFIX=/opt/$_pkgbase"
+ '-D CMAKE_SKIP_RPATH=ON')
+
+# SSE only available from Pentium 3 onwards (i686 is way older)
+[[ "$CARCH" = 'i686' ]] && \
+ _cmakeopts+=("-D ENABLE_SSE=$_FORCE_SSE"
+ "-D ENABLE_SSE2=$_FORCE_SSE2"
+ "-D ENABLE_SSE3=$_FORCE_SSE3")
+
+# all x64 CPUs support SSE2 but not SSE3
+[[ "$CARCH" = 'x86_64' ]] && \
+ _cmakeopts+=("-D ENABLE_SSE3=$_FORCE_SSE3"
+ "-D ENABLE_SSSE4=$_FORCE_SSSE3" #(sic!)
+ "-D ENABLE_SSE41=$_FORCE_SSE41"
+ "-D ENABLE_SSE42=$_FORCE_SSE42"
+ "-D ENABLE_AVX=$_FORCE_AVX"
+ "-D ENABLE_AVX2=$_FORCE_AVX2")
+
+prepare() {
+ cd $_pkgbase-$pkgver
+# Patch for gcc 6
+# See https://github.com/Itseez/opencv/issues/6517
+ patch -p1 -i ../opencv_a0fdc91a14f07de25d858037940fcd3ba859b4e2.patch
+}
+build() {
+ cd "$srcdir/$_pkgbase-$pkgver"
+ cmake ${_cmakeopts[@]} .
+ make
+}
+package_opencv2-opt() {
+ options=('staticlibs')
+ provides=(opencv2)
+
+ cd "$srcdir/$_pkgbase-$pkgver"
+
+ make DESTDIR="$pkgdir" install
+ install -Dm644 "$srcdir/$_pkgbase-$pkgver/LICENSE" \
+ "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+ install -dm755 $pkgdir/usr/lib/pkgconfig
+ cd $pkgdir/usr/lib/pkgconfig
+ ln -s /opt/$_pkgbase/lib/pkgconfig/opencv.pc opencv2.pc
+ ln -s /opt/$_pkgbase/lib/pkgconfig/opencv.pc opencv2-opt.pc
+ cd "$pkgdir/usr/share"
+
+ # separate samples package; also be -R friendly
+ if [[ -d OpenCV/samples ]]; then
+ mv OpenCV/samples "$srcdir/$_pkgbase-samples"
+ mv OpenCV $_pkgbase # otherwise folder naming is inconsistent
+ elif [[ ! -d OpenCV ]]; then
+ warning "Directory naming issue; samples package may not be built!"
+ fi
+}
+package_opencv2-opt-samples() {
+ pkgdesc+=" (samples)"
+ depends=("opencv2-opt=$pkgver") # sample codes change with lib/API
+ unset optdepends
+ provides=(opencv2-samples)
+
+ cd "$srcdir/$_pkgbase-$pkgver"
+ install -dm755 "$pkgdir/opt/opencv2"
+ cp -r samples "$pkgdir/opt/opencv2"
+
+ # install license file
+ install -Dm644 "LICENSE" \
+ "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/opencv_a0fdc91a14f07de25d858037940fcd3ba859b4e2.patch b/opencv_a0fdc91a14f07de25d858037940fcd3ba859b4e2.patch
new file mode 100644
index 00000000000..e2a999ea1e1
--- /dev/null
+++ b/opencv_a0fdc91a14f07de25d858037940fcd3ba859b4e2.patch
@@ -0,0 +1,13 @@
+diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake
+index 243fb4c..a2df014 100644
+--- a/cmake/OpenCVPCHSupport.cmake
++++ b/cmake/OpenCVPCHSupport.cmake
+@@ -19,7 +19,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
+ ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+ OUTPUT_VARIABLE gcc_compiler_version)
+ #MESSAGE("GCC Version: ${gcc_compiler_version}")
+- IF(gcc_compiler_version VERSION_GREATER "4.2.-1")
++ IF(gcc_compiler_version VERSION_GREATER "4.2.-1" AND gcc_compiler_version VERSION_LESS "6.0.0")
+ SET(PCHSupport_FOUND TRUE)
+ ENDIF()
+