Ticket #36130: Portfile

File Portfile, 5.4 KB (added by andre.dos.anjos@…, 12 years ago)

Portfile for Bob

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$
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6
7name                bob
8version             1.0.6
9set soversion       1.0
10revision            1
11categories          science math devel
12platforms           darwin
13maintainers         anjos \
14                    idiap.ch:andre.anjos
15
16description         Bob is a signal-processing and machine learning toolbox
17
18long_description    Bob is a signal-processing and machine learning toolbox \
19                    developed at the Idiap Research Institute, in Martigny, \
20                    Switzerland. The toolbox is written in a mix of Python \
21                    and C++ and is designed to be both efficient and to \
22                    reduce development time.
23
24license             GPL-3
25homepage            http://idiap.github.com/bob/
26master_sites        https://github.com/idiap/bob/downloads/
27use_zip             yes
28
29checksums           rmd160 eac3e390ed25c69d8c6038f815ea473c21118a0f \
30                    sha256 767e22bddb2bfb59458b76eb37cab3791bf1bfbe33fc7ad11ca29038343b5dea
31
32depends_build       port:cmake
33
34depends_lib         port:blitz \
35                    port:ffmpeg \
36                    port:matio \
37                    port:imagemagick \
38                    port:hdf5-18 \
39                    port:boost \
40                    port:fftw-3 \
41                    port:vlfeat \
42                    port:libsvm
43
44configure.args      -DCMAKE_BUILD_TYPE=Release -DBOB_VERSION=${version} -DBOB_SOVERSION=${soversion}
45
46build.target        all
47destroot.target     install
48use_parallel_build  yes
49
50universal_variant    no
51default_variants     +qt4 +opencv
52
53variant python25 conflicts python26 python27 description "Builds for python 2.5." {
54  depends_lib-append    port:py25-numpy \
55                        port:py25-matplotlib \
56                        port:py25-sqlalchemy \
57                        port:py25-argparse \
58                        port:py25-scipy
59}
60
61variant python26 conflicts python25 python27 description "Builds for python 2.6." {
62  depends_lib-append    port:py26-numpy \
63                        port:py26-matplotlib \
64                        port:py26-sqlalchemy \
65                        port:py26-argparse \
66                        port:py26-scipy
67}
68
69variant python27 conflicts python25 python26 description "Builds for python 2.7." {
70  depends_lib-append    port:py27-numpy \
71                        port:py27-matplotlib \
72                        port:py27-sqlalchemy \
73                        port:py27-argparse \
74                        port:py27-scipy
75}
76
77variant qt4 description "Compile Qt4 extensions." {
78  depends_lib-append      port:qt4-mac
79}
80
81variant opencv description "Compile OpenCV extensions." {
82  depends_lib-append      port:opencv
83}
84
85variant unittest description "Runs unit tests after compilation." {
86}
87
88variant doc description "Builds documentation." {
89  depends_build-append    port:dvipng \
90                          port:doxygen \
91                          port:texlive-latex-extra \
92                          port:texlive-fonts-recommended
93  destroot.target-append  sphinx-latex install-sphinx install-doxygen
94
95  if {[variant_isset python25]} {
96    depends_build-append  port:py25-sphinx
97  }
98  if {[variant_isset python26]} {
99    depends_build-append  port:py26-sphinx
100  }
101  if {[variant_isset python27]} {
102    depends_build-append  port:py27-sphinx
103  }
104}
105
106pre-configure {
107  if {[variant_isset python25]} {
108    configure.args-append -DWITH_PYTHON=${prefix}/bin/python2.5
109  } elseif {[variant_isset python26]} {
110      configure.args-append -DWITH_PYTHON=${prefix}/bin/python2.6
111  } elseif {[variant_isset python27]} {
112    configure.args-append -DWITH_PYTHON=${prefix}/bin/python2.7
113  } else {
114    ui_error "You must choose a python variant. Tip: use the same variant used for building the boost port (use `port installed boost` to find it out)"
115  }
116  configure.compiler llvm-gcc-4.2 #clang remains untested at this point
117}
118
119pre-destroot {
120  if {[variant_isset unittest]} {
121    if {[variant_isset doc]} {
122      ${build.cmd} -C ${worksrcpath} test sphinx-doctest
123    }
124    else {
125      ${build.cmd} -C ${worksrcpath} test
126    }
127  }
128}
129
130post-destroot {
131  if {[variant_isset python25]} {
132    set pycompile ${destroot}/${prefix}/lib/python2.5/site-packages
133    system "${prefix}/bin/python2.5 -m compileall ${pycompile}"
134  } elseif {[variant_isset python26]} {
135    set pypath ${prefix}/lib/python2.6/site-packages
136    set pycompile ${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
137    file mkdir ${destroot}/${pycompile}
138    system "${prefix}/bin/python2.6 -m compileall ${destroot}/${pypath}/bob"
139    move ${destroot}/${pypath}/bob ${destroot}/${pycompile}/bob
140    move ${destroot}/${pypath}/bob-${version}-py2.6.egg-info ${destroot}/${pycompile}/
141  } elseif {[variant_isset python27]} {
142    set pypath ${prefix}/lib/python2.7/site-packages
143    set pycompile ${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
144    file mkdir ${destroot}/${pycompile}
145    system "${prefix}/bin/python2.7 -m compileall ${destroot}/${pypath}/bob"
146    move ${destroot}/${pypath}/bob ${destroot}/${pycompile}/bob
147    move ${destroot}/${pypath}/bob-${version}-py2.7.egg-info ${destroot}/${pycompile}/
148  } else {
149    ui_error "You must choose a python variant. Tip: use the same variant used for building the boost port (use `port installed boost` to find it out)"
150  }
151}