some existing COMPILER lines with arch restrictions etc. In the usual case this is now using "COMPILER = base-clang ports-gcc base-gcc" on ports with c++ libraries in WANTLIB. This is basically intended to be a noop on architectures using clang as the system compiler, but help with other architectures where we currently have many ports knocked out due to building with an unsuitable compiler - - some ports require c++11/newer so the GCC version in base that is used on these archirtectures is too old. - some ports have conflicts where an executable is built with one compiler (e.g. gcc from base) but a library dependency is built with a different one (e.g. gcc from ports), resulted in mixing incompatible libraries in the same address space. devel/gmp is intentionally skipped as it's on the path to building gcc - the c++ library there is unused in ports (and not built by default upstream) so intending to disable building gmpcxx in a future commit.
163 lines
4.8 KiB
Makefile
163 lines
4.8 KiB
Makefile
# $OpenBSD: Makefile,v 1.45 2018/10/24 14:28:06 sthen Exp $
|
|
|
|
ONLY_FOR_ARCHS = ${GCC4_ARCHS} ${CLANG_ARCHS}
|
|
|
|
CATEGORIES = graphics devel
|
|
COMMENT-docs = OpenCV documentation and examples
|
|
COMMENT-main = library of programming functions for real time cv
|
|
COMMENT-java = Java bindings for OpenCV
|
|
|
|
V = 2.4.13.4
|
|
GH_ACCOUNT = Itseez
|
|
GH_PROJECT = opencv
|
|
GH_TAGNAME = ${V}
|
|
|
|
PKGNAME-main = ${PKGNAME}
|
|
PKGNAME-docs = opencv-docs-$V
|
|
PKGNAME-java = opencv-java-$V
|
|
REVISION-java = 1
|
|
REVISION-main = 1
|
|
REVISION-docs = 0
|
|
|
|
.for i in opencv_calib3d opencv_contrib opencv_core opencv_features2d \
|
|
opencv_flann opencv_gpu opencv_highgui opencv_imgproc opencv_legacy \
|
|
opencv_ml opencv_nonfree opencv_objdetect opencv_photo opencv_stitching \
|
|
opencv_superres opencv_ts opencv_video opencv_videostab opencv_ocl
|
|
SHARED_LIBS += $i 3.0
|
|
.endfor
|
|
|
|
HOMEPAGE = https://www.opencv.org/
|
|
MAINTAINER = Rafael Sadowski <rsadowski@openbsd.org>
|
|
|
|
# "patents" means containing some patented algorithms, see
|
|
# http://docs.opencv.org/modules/nonfree/doc/nonfree.html
|
|
# As some source modules include this functionality, we couldn't
|
|
# just subpackage "nonfree". Excluding this, here we have a usual
|
|
# BSD license.
|
|
PERMIT_PACKAGE_FTP = Yes
|
|
PERMIT_PACKAGE_CDROM = patents
|
|
PERMIT_PACKAGE_CDROM-docs = Yes
|
|
|
|
WANTLIB-main += ${MODPY_WANTLIB}
|
|
WANTLIB-main += ${COMPILER_LIBCXX} Half Iex IlmImf IlmThread Imath
|
|
WANTLIB-main += X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama
|
|
WANTLIB-main += Xrandr Xrender atk-1.0 avresample c cairo fontconfig
|
|
WANTLIB-main += freetype gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 glib-2.0
|
|
WANTLIB-main += gobject-2.0 gstapp-1.0 gstbase-1.0 gstpbutils-1.0 gstreamer-1.0
|
|
WANTLIB-main += gstriff-1.0 gstvideo-1.0 gthread-2.0 gtk-x11-2.0 intl
|
|
WANTLIB-main += jasper jpeg m pango-1.0 pangocairo-1.0 pangoft2-1.0
|
|
WANTLIB-main += png tiff z
|
|
|
|
|
|
WANTLIB-docs =
|
|
|
|
WANTLIB-java = m pthread ${COMPILER_LIBCXX}
|
|
WANTLIB-java += opencv_calib3d opencv_contrib opencv_core opencv_features2d
|
|
WANTLIB-java += opencv_flann opencv_gpu opencv_highgui opencv_imgproc
|
|
WANTLIB-java += opencv_legacy opencv_ml opencv_nonfree opencv_objdetect
|
|
WANTLIB-java += opencv_ocl opencv_photo opencv_video
|
|
|
|
COMPILER = base-clang ports-gcc base-gcc
|
|
|
|
MULTI_PACKAGES = -main -docs -java
|
|
PSEUDO_FLAVORS = no_docs no_java
|
|
FLAVOR ?=
|
|
|
|
.include <bsd.port.arch.mk>
|
|
|
|
MODULES = devel/cmake \
|
|
lang/python
|
|
|
|
BUILD_DEPENDS = devel/doxygen \
|
|
math/py-numpy \
|
|
math/eigen3
|
|
|
|
RUN_DEPENDS-main = math/py-numpy
|
|
RUN_DEPENDS-docs = ${BUILD_PKGPATH},-main
|
|
RUN_DEPENDS-java = ${MODJAVA_RUN_DEPENDS}
|
|
|
|
LIB_DEPENDS-main = ${LIB_DEPENDS} \
|
|
${MODPY_LIB_DEPENDS} \
|
|
multimedia/gstreamer1/plugins-base \
|
|
x11/gtk+2 \
|
|
graphics/ffmpeg \
|
|
graphics/ilmbase \
|
|
graphics/jpeg \
|
|
graphics/openexr \
|
|
graphics/png \
|
|
graphics/tiff
|
|
LIB_DEPENDS-docs =
|
|
LIB_DEPENDS-java = ${BUILD_PKGPATH},-main=${V}
|
|
|
|
# ATM opencv requires V4L1 compat, ask them to change it,
|
|
# then see WITH_V4L below.
|
|
CONFIGURE_ARGS = -DBUILD_opencv_nonfree:Bool=On \
|
|
-DBUILD_opencv_python:Bool=On \
|
|
-DWITH_1394:Bool=Off \
|
|
-DWITH_CUDA:Bool=Off \
|
|
-DWITH_EIGEN:Bool=Off \
|
|
-DWITH_FFMPEG:Bool=On \
|
|
-DWITH_GSTREAMER:Bool=On \
|
|
-DWITH_GTK:Bool=On \
|
|
-DWITH_JPEG:Bool=On \
|
|
-DWITH_PNG:Bool=On \
|
|
-DWITH_TIFF:Bool=On \
|
|
-DWITH_V4L:Bool=Off \
|
|
-DPYTHON_EXECUTABLE:FILEPATH=${MODPY_BIN}
|
|
|
|
.if ${ARCH:Mi386}
|
|
# XXX PIE cannot be produced due to problems with inline assembly.
|
|
# Since OpenCV is mostly used as a library, switch to PIC.
|
|
CONFIGURE_ENV = CFLAGS="${CFLAGS} -fPIC" \
|
|
CXXFLAGS="${CXXFLAGS} -fPIC"
|
|
CONFIGURE_ARGS += -DENABLE_SSE3:Bool=Off
|
|
.endif
|
|
|
|
.if ${BUILD_PACKAGES:M-java}
|
|
MODULES += java
|
|
MODJAVA_VER = 1.8+
|
|
BUILD_DEPENDS += devel/apache-ant
|
|
.else
|
|
# Safe: Java will be detected, if present, but won't be used
|
|
CONFIGURE_ARGS += -DBUILD_opencv_java:Bool=Off
|
|
.endif
|
|
|
|
.if ${BUILD_PACKAGES:M-docs}
|
|
BUILD_DEPENDS += textproc/py-sphinx
|
|
ALL_TARGET = all html_docs
|
|
CONFIGURE_ARGS += -DBUILD_DOCS:Bool=On \
|
|
-DBUILD_EXAMPLES:Bool=On \
|
|
-DINSTALL_C_EXAMPLES:Bool=On \
|
|
-DINSTALL_PYTHON_EXAMPLES:Bool=On
|
|
.else
|
|
CONFIGURE_ARGS += -DBUILD_DOCS:Bool=Off \
|
|
-DBUILD_EXAMPLES:Bool=Off \
|
|
-DINSTALL_PYTHON_EXAMPLES:Bool=Off
|
|
.endif
|
|
|
|
CONFIG_ADJ_CMD = perl -pi
|
|
.for _l _v in ${SHARED_LIBS}
|
|
CONFIG_ADJ_CMD += -e 's,lib${_l}.so([^.]),lib${_l}.so.${_v}$$1,g;'
|
|
.endfor
|
|
|
|
DOCDIR = ${PREFIX}/share/doc/OpenCV
|
|
|
|
post-patch:
|
|
perl -pi -e 's@^.*(#\s*include)@$$1@' \
|
|
${WRKSRC}/samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp
|
|
|
|
post-install:
|
|
${CONFIG_ADJ_CMD} ${PREFIX}/share/OpenCV/OpenCVConfig.cmake
|
|
${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py ${WRKINST}${MODPY_SITEPKG}
|
|
.if ${BUILD_PACKAGES:M-docs}
|
|
rm -Rf ${DOCDIR}
|
|
mv ${PREFIX}/share/OpenCV/doc ${DOCDIR}
|
|
cp -R ${WRKBUILD}/doc/_html ${DOCDIR}/html
|
|
.endif
|
|
|
|
do-test:
|
|
cd ${WRKBUILD}; \
|
|
${MODPY_BIN} ${WRKSRC}/modules/ts/misc/run.py
|
|
|
|
.include <bsd.port.mk>
|