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$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup cmake 1.0 |
---|
6 | |
---|
7 | PortGroup github 1.0 |
---|
8 | github.setup idiap bob 1.1.0 v |
---|
9 | |
---|
10 | name bob |
---|
11 | set soversion 1.1 |
---|
12 | categories science math devel |
---|
13 | platforms darwin |
---|
14 | maintainers idiap.ch:andre.anjos \ |
---|
15 | idiap.ch:laurent.el-shafey |
---|
16 | |
---|
17 | description Bob is a signal-processing and machine learning toolbox |
---|
18 | |
---|
19 | long_description Bob is a signal-processing and machine learning toolbox \ |
---|
20 | developed at the Idiap Research Institute, in Martigny, \ |
---|
21 | Switzerland. The toolbox is written in a mix of Python \ |
---|
22 | and C++ and is designed to be both efficient and to \ |
---|
23 | reduce development time. |
---|
24 | |
---|
25 | license GPL-3 |
---|
26 | homepage http://idiap.github.com/bob/ |
---|
27 | |
---|
28 | checksums rmd160 8d6696bac29896e99760ecbcc4984725e5676920 \ |
---|
29 | sha256 1cf7e20e6bb4e1fe96f1abdab909dc1df6c916db4eadc2ef3d356c53422a4366 |
---|
30 | |
---|
31 | use_parallel_build no |
---|
32 | |
---|
33 | depends_lib port:blitz \ |
---|
34 | port:ffmpeg \ |
---|
35 | port:matio \ |
---|
36 | port:imagemagick \ |
---|
37 | port:hdf5-18 \ |
---|
38 | port:boost \ |
---|
39 | port:fftw-3 \ |
---|
40 | port:vlfeat \ |
---|
41 | port:libsvm |
---|
42 | |
---|
43 | configure.args -DCMAKE_BUILD_TYPE=Release -DBOB_VERSION=${version} -DBOB_SOVERSION=${soversion} |
---|
44 | |
---|
45 | universal_variant no |
---|
46 | default_variants +qt4 +opencv |
---|
47 | |
---|
48 | if { ![variant_isset python26] } { |
---|
49 | default_variants-append +python27 |
---|
50 | } |
---|
51 | |
---|
52 | variant python26 conflicts python27 description "Builds for python 2.6." { |
---|
53 | depends_lib-append port:py26-distribute |
---|
54 | port:py26-numpy \ |
---|
55 | port:py26-matplotlib \ |
---|
56 | port:py26-sqlalchemy \ |
---|
57 | port:py26-argparse \ |
---|
58 | port:py26-scipy \ |
---|
59 | port:py26-nose |
---|
60 | } |
---|
61 | |
---|
62 | variant python27 conflicts python26 description "Builds for python 2.7." { |
---|
63 | depends_lib-append port:py27-distribute |
---|
64 | port:py27-numpy \ |
---|
65 | port:py27-matplotlib \ |
---|
66 | port:py27-sqlalchemy \ |
---|
67 | port:py27-scipy \ |
---|
68 | port:py27-nose |
---|
69 | } |
---|
70 | |
---|
71 | variant qt4 description "Compile Qt4 extensions." { |
---|
72 | depends_lib-append port:qt4-mac |
---|
73 | } |
---|
74 | |
---|
75 | variant opencv description "Compile OpenCV extensions." { |
---|
76 | depends_lib-append port:opencv |
---|
77 | } |
---|
78 | |
---|
79 | variant doc description "Builds documentation." { |
---|
80 | depends_build-append port:dvipng \ |
---|
81 | port:doxygen \ |
---|
82 | port:texlive-latex-extra \ |
---|
83 | port:texlive-fonts-recommended |
---|
84 | destroot.target-append sphinx-latex install-sphinx install-doxygen |
---|
85 | |
---|
86 | if {[variant_isset python26]} { |
---|
87 | depends_build-append port:py26-sphinx |
---|
88 | } |
---|
89 | if {[variant_isset python27]} { |
---|
90 | depends_build-append port:py27-sphinx |
---|
91 | } |
---|
92 | test.run yes |
---|
93 | test.target sphinx-doctest |
---|
94 | } |
---|
95 | |
---|
96 | pre-configure { |
---|
97 | if {[variant_isset python26]} { |
---|
98 | configure.args-append -DWITH_PYTHON=${prefix}/bin/python2.6 |
---|
99 | } elseif {[variant_isset python27]} { |
---|
100 | configure.args-append -DWITH_PYTHON=${prefix}/bin/python2.7 |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | post-destroot { |
---|
105 | if {[variant_isset python26]} { |
---|
106 | set pypath ${prefix}/lib/python2.6/site-packages |
---|
107 | set pycompile ${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages |
---|
108 | xinstall -d ${destroot}/${pycompile} |
---|
109 | system "${prefix}/bin/python2.6 -m compileall ${destroot}/${pypath}/bob" |
---|
110 | move ${destroot}/${pypath}/bob ${destroot}/${pycompile}/bob |
---|
111 | move ${destroot}/${pypath}/bob-${version}-py2.6.egg-info ${destroot}/${pycompile}/ |
---|
112 | } elseif {[variant_isset python27]} { |
---|
113 | set pypath ${prefix}/lib/python2.7/site-packages |
---|
114 | set pycompile ${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages |
---|
115 | xinstall -d ${destroot}/${pycompile} |
---|
116 | system "${prefix}/bin/python2.7 -m compileall ${destroot}/${pypath}/bob" |
---|
117 | move ${destroot}/${pypath}/bob ${destroot}/${pycompile}/bob |
---|
118 | move ${destroot}/${pypath}/bob-${version}-py2.7.egg-info ${destroot}/${pycompile}/ |
---|
119 | } |
---|
120 | } |
---|
121 | |
---|
122 | # check if boost is installed with the required python variant |
---|
123 | if {[variant_isset python26]} { |
---|
124 | set boost_python_required 2.6 |
---|
125 | set boost_variant +python26 |
---|
126 | } elseif {[variant_isset python27]} { |
---|
127 | set boost_python_required 2.7 |
---|
128 | set boost_variant +python27 |
---|
129 | } |
---|
130 | |
---|
131 | set boost_python_lib ${prefix}/lib/libboost_python-mt.dylib |
---|
132 | set boost_python_version "0" |
---|
133 | if {[file exists ${boost_python_lib}]} { |
---|
134 | set boost_python_version [exec /usr/bin/otool -L ${boost_python_lib} | /usr/bin/grep Python | /usr/bin/sed -e "s|^.*Versions/||" -e "s|/.*||"] |
---|
135 | } |
---|
136 | if {${boost_python_version} != ${boost_python_required}} { |
---|
137 | depends_lib-delete port:boost |
---|
138 | pre-configure { |
---|
139 | ui_error "${name} requires boost installed with variant ${boost_variant}." |
---|
140 | ui_error "Please install boost as follows and try installing ${name} again:" |
---|
141 | ui_error "sudo port install boost ${boost_variant}" |
---|
142 | return -code error "incompatible boost installation" |
---|
143 | } |
---|
144 | } |
---|