Ticket #36488: Portfile

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

Version using v1.1.0 (instead of v1.1.0c0)

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
7PortGroup           github 1.0
8github.setup        idiap bob 1.1.0 v
9
10name                bob
11set soversion       1.1
12categories          science math devel
13platforms           darwin
14maintainers         idiap.ch:andre.anjos \
15                    idiap.ch:laurent.el-shafey
16
17description         Bob is a signal-processing and machine learning toolbox
18
19long_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
25license             GPL-3
26homepage            http://idiap.github.com/bob/
27
28checksums           rmd160  8d6696bac29896e99760ecbcc4984725e5676920 \
29                    sha256  1cf7e20e6bb4e1fe96f1abdab909dc1df6c916db4eadc2ef3d356c53422a4366
30
31use_parallel_build  no
32
33depends_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
43configure.args      -DCMAKE_BUILD_TYPE=Release -DBOB_VERSION=${version} -DBOB_SOVERSION=${soversion}
44
45universal_variant   no
46default_variants    +qt4 +opencv
47
48if { ![variant_isset python26] } {
49    default_variants-append +python27
50}
51
52variant 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
62variant 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
71variant qt4 description "Compile Qt4 extensions." {
72    depends_lib-append      port:qt4-mac
73}
74
75variant opencv description "Compile OpenCV extensions." {
76    depends_lib-append      port:opencv
77}
78
79variant 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
96pre-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
104post-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
123if {[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
131set boost_python_lib ${prefix}/lib/libboost_python-mt.dylib
132set boost_python_version "0"
133if {[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}
136if {${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}