1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: Portfile 74319 2010-12-12 12:17:59Z stromnov@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup cmake 1.0 |
---|
6 | |
---|
7 | name opencv |
---|
8 | version 2.2.0 |
---|
9 | categories graphics science |
---|
10 | platforms darwin |
---|
11 | maintainers gmail.com:stante |
---|
12 | |
---|
13 | description Intel(R) Open Source Computer Vision Library |
---|
14 | |
---|
15 | long_description opencv is a library that is mainly aimed at real time \ |
---|
16 | computer vision. Some example areas would be \ |
---|
17 | Human-Computer Interaction (HCI), Object Identification, \ |
---|
18 | Segmentation and Recognition, Face Recognition, Gesture \ |
---|
19 | Recognition, Motion Tracking, Ego Motion, Motion \ |
---|
20 | Understanding, Structure From Motion (SFM), and Mobile \ |
---|
21 | Robotics. |
---|
22 | |
---|
23 | homepage http://opencv.willowgarage.com/wiki/ |
---|
24 | master_sites sourceforge:opencvlibrary |
---|
25 | use_bzip2 yes |
---|
26 | distname OpenCV-${version} |
---|
27 | |
---|
28 | checksums md5 122c9ac793a46854ef2819fedbbd6b1b \ |
---|
29 | sha1 984ed71672d50391d0617fce2ef58e7590ec0fd7 \ |
---|
30 | rmd160 57aedb7678964f43af3f1c838a8266c7b4869b01 |
---|
31 | |
---|
32 | depends_build-append port:pkgconfig |
---|
33 | |
---|
34 | depends_lib-append port:zlib \ |
---|
35 | path:lib/libavcodec.dylib:ffmpeg \ |
---|
36 | port:bzip2 \ |
---|
37 | port:dirac \ |
---|
38 | port:faac \ |
---|
39 | port:faad2 \ |
---|
40 | port:lame \ |
---|
41 | port:schroedinger \ |
---|
42 | port:liboil \ |
---|
43 | port:libtheora \ |
---|
44 | port:libvorbis \ |
---|
45 | port:libogg \ |
---|
46 | port:x264 \ |
---|
47 | port:orc |
---|
48 | |
---|
49 | # ffmpeg is not universal |
---|
50 | universal_variant no |
---|
51 | |
---|
52 | patchfiles patch-CMakeLists.txt.diff |
---|
53 | if {[variant_isset universal] && [variant_exists universal]} { |
---|
54 | patchfiles-append patch-pch-CMakeLists.txt.diff |
---|
55 | } |
---|
56 | |
---|
57 | post-patch { |
---|
58 | if {[variant_isset python26]} { |
---|
59 | reinplace "s|@@PYTHON_PKGD@@|${frameworks_dir}/Python.framework/Versions/2.6/lib/python2.6/site-packages|g" ${worksrcpath}/CMakeLists.txt |
---|
60 | } |
---|
61 | } |
---|
62 | |
---|
63 | configure.args-append -DBUILD_NEW_PYTHON_SUPPORT=OFF \ |
---|
64 | -DBUILD_EXAMPLES=ON \ |
---|
65 | -DINSTALL_C_EXAMPLES=ON \ |
---|
66 | -DBZIP2_LIBRARIES=${prefix}/lib/libbz2.dylib \ |
---|
67 | -DWITH_1394=OFF |
---|
68 | |
---|
69 | # use macros in /usr/include/stdint.h with C++ compiler; see <https://roundup.ffmpeg.org/issue2093> |
---|
70 | platform darwin { |
---|
71 | if {${os.major} <= 9} { |
---|
72 | configure.args-append -DCMAKE_CXX_FLAGS=-D__STDC_CONSTANT_MACROS |
---|
73 | } |
---|
74 | } |
---|
75 | |
---|
76 | variant dc1394 description {Use libdc1394 for firewire camera. Breaks compatibility with Apple iSight FireWire camera.} { |
---|
77 | depends_lib-append port:libdc1394 |
---|
78 | configure.args-delete -DWITH_1394=OFF |
---|
79 | configure.args-append -DWITH_1394=ON |
---|
80 | configure.args-append -DHAVE_1394=ON |
---|
81 | } |
---|
82 | |
---|
83 | variant qt4 description {Use experimental qt4 backend for graphical interface.} { |
---|
84 | depends_lib-append port:qt4-mac |
---|
85 | configure.args-append -DWITH_QT=ON |
---|
86 | } |
---|
87 | |
---|
88 | variant python26 conflicts python27 description {Add Python 2.6 bindings} { |
---|
89 | depends_lib-append port:python26 |
---|
90 | configure.args-delete -DBUILD_NEW_PYTHON_SUPPORT=OFF |
---|
91 | configure.args-append -DINSTALL_PYTHON_EXAMPLES=ON \ |
---|
92 | -DBUILD_NEW_PYTHON_SUPPORT=ON \ |
---|
93 | -DPYTHON_EXECUTABLE=${prefix}/bin/python2.6 \ |
---|
94 | -DPYTHON_LIBRARY=${prefix}/lib/libpython2.6.dylib \ |
---|
95 | -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.6/Headers |
---|
96 | } |
---|
97 | |
---|
98 | variant python27 conflicts python26 description {Add Python 2.7 bindings} { |
---|
99 | depends_lib-append port:python27 |
---|
100 | configure.args-delete -DBUILD_NEW_PYTHON_SUPPORT=OFF |
---|
101 | configure.args-append -DINSTALL_PYTHON_EXAMPLES=ON \ |
---|
102 | -DBUILD_NEW_PYTHON_SUPPORT=ON \ |
---|
103 | -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \ |
---|
104 | -DPYTHON_LIBRARY=${prefix}/lib/libpython2.7.dylib \ |
---|
105 | -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/Headers |
---|
106 | } |
---|
107 | |
---|
108 | variant tbb description {Use Intel TBB} { |
---|
109 | depends_lib-append port:tbb |
---|
110 | configure.args-append -DWITH_TBB=ON \ |
---|
111 | -DHAVE_TBB=ON \ |
---|
112 | -DTBB_INCLUDE_DIRS=${prefix}/include \ |
---|
113 | -DTBB_LIBRARY_DIRS=${prefix}/lib \ |
---|
114 | -DOPENCV_LINKER_LIBS="-ltbb -ltbbmalloc" |
---|
115 | } |
---|
116 | |
---|
117 | livecheck.type regex |
---|
118 | livecheck.url http://sourceforge.net/projects/opencvlibrary/files/ |
---|
119 | livecheck.regex "OpenCV-(\\d+(?:\\.\\d+)*)${extract.suffix}/download" |
---|