Ticket #27800: Portfile

File Portfile, 5.4 KB (added by njbutko@…, 13 years ago)

New Portfile (after patch)

Line 
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
4PortSystem                      1.0
5PortGroup                       cmake 1.0
6
7name                            opencv
8version                         2.2.0
9categories                      graphics science
10platforms                       darwin
11maintainers                     gmail.com:stante
12
13description                     Intel(R) Open Source Computer Vision Library
14
15long_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
23homepage                        http://opencv.willowgarage.com/wiki/
24master_sites                    sourceforge:opencvlibrary
25use_bzip2                       yes
26distname                        OpenCV-${version}
27
28checksums                       md5     122c9ac793a46854ef2819fedbbd6b1b \
29                                sha1    984ed71672d50391d0617fce2ef58e7590ec0fd7 \
30                                rmd160  57aedb7678964f43af3f1c838a8266c7b4869b01
31
32depends_build-append            port:pkgconfig
33
34depends_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
50universal_variant               no
51
52patchfiles                      patch-CMakeLists.txt.diff
53if {[variant_isset universal] && [variant_exists universal]} {
54    patchfiles-append           patch-pch-CMakeLists.txt.diff
55}
56
57post-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
63configure.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>
70platform darwin {
71    if {${os.major} <= 9} {
72        configure.args-append   -DCMAKE_CXX_FLAGS=-D__STDC_CONSTANT_MACROS
73    }
74}
75
76variant 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
83variant 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
88variant 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
98variant 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
108variant 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
117livecheck.type                  regex
118livecheck.url                   http://sourceforge.net/projects/opencvlibrary/files/
119livecheck.regex                 "OpenCV-(\\d+(?:\\.\\d+)*)${extract.suffix}/download"