source: trunk/dports/math/shogun/Portfile @ 56061

Last change on this file since 56061 was 55126, checked in by jameskyle@…, 10 years ago

Combined depends_build. Ticket #20576

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1# $Id: Portfile 55126 2009-08-07 01:30:35Z jameskyle@macports.org $
2PortSystem          1.0
3
4categories          math science
5name                shogun
6version             0.7.3
7
8
9maintainers         jameskyle
10
11platforms           darwin
12
13description         The machine learning toolbox's focus is on large scale \
14                    kernel methods
15
16long_description    ${description} and especially on Support Vector Machines \
17                    (SVM). It provides a generic SVM object interfacing to \
18                    several different SVM implementations, among them the \
19                    state of the art OCAS, LibSVM, SVMLight, SVMLin and GPDT.
20
21homepage            http://www.shogun-toolbox.org/
22master_sites        http://shogun-toolbox.org/archives/shogun/releases/0.7/sources/
23use_bzip2           yes
24distfiles            shogun-${version}${extract.suffix}
25
26
27checksums           md5     e3cb08aa05c1da78cd96d71ef97669b0 \
28                    sha1    edad946b8ecbdf8e14f7de2ad54a95c4e2e72140 \
29                    rmd160  bfe7e456505e5306dcf8818ee1c1074d8b8b05e9
30
31worksrcdir          ${name}-${version}/src
32
33depends_build       port:bzip2 \
34                    port:gsed \
35                    port:gcc43
36
37depends_lib         port:swig \
38                    port:atlas \
39                    port:readline \
40                    port:glpk
41
42configure.args      --disable-svm-light \
43                    --libs=${prefix}/lib \
44                    --install-path=${prefix} \
45                    --includes=${prefix}/include \
46                    --destdir=${destroot} \
47                    --cc=${prefix}/bin/gcc-mp-4.3 \
48                    --cxx=${prefix}/bin/g++-mp-4.3
49
50configure.cc        ${prefix}/bin/gcc-mp-4.3                   
51
52configure.compiler  macports-gcc-4.3
53
54patchfiles          patch-src-configure.diff
55
56default_variants    +python +glpk
57
58# Interfaces are added by a comma delimited argument list to --interfaces.
59# We check for variants and then build this list accordingly
60set interfaces "libshogun libshogunui cmdline"
61if {[variant_isset python]} {lappend interfaces "python,python_modular"}
62if {[variant_isset r]} {lappend interfaces "r"}
63if {[variant_isset octave]} {lappend interfaces "octave,octave_modular"}
64if {[variant_isset elwms]  && !([variant_isset python] &&
65    [variant_isset octave] &&   [variant_isset r])} {
66  return -code error "Must set python and both r and octave variants to build elwms interface"
67} elseif {[variant_isset elwms]} {
68  lappend interfaces "elwms"
69}
70
71# disable glpk if variant is not set
72if {![variant_isset glpk]} {
73  configure.args-append --disable-glpk
74  depends_lib-delete port:glpk
75}
76#if {[variant_isset matlab]} {lappend interfaces "matlab"}
77set interfaces [join $interfaces ","]
78
79configure.args-append --interfaces=$interfaces
80
81variant elwms description {Build elwms interface. requires python plus  one other interface} {}
82
83variant python description {Build Python API} {
84  configure.args-append \
85      --includes=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 \
86      --python=${prefix}/bin/python2.5
87
88  depends_lib-append port:python25 \
89                     port:py25-numpy
90}
91
92variant r description {Build the R API} {
93  depends_lib-append port:R
94}
95
96variant octave description {Build the Octave API} {
97  depends_lib-append port:octave
98}
99
100variant glpk description {Add support for the Gnu Linear Programming Kit} {}
101
102#variant matlab description {Build the Matlab API} {}
103variant doc description {Install the documentation for shogun} {
104  depends_build-append port:texlive \
105                       path:bin/dot:graphviz \
106                       port:doxygen
107}
108
109pre-extract {
110  # Before doing anything, verify the correct swig bindings are present for
111  # our variants
112  if {[variant_isset python]} {
113    if {![file exists ${prefix}/share/swig/1.3.39/python/python.swg]} {
114      ui_error "To install shogun with the python variant, swig must be installed with the python variant as well."
115      return -code error "incompatible swig installation"
116    }
117  }
118 
119  if {[variant_isset r]} {
120    if {![file exists ${prefix}/share/swig/1.3.39/r/r.swg]} {
121      ui_error "To install shogun with the r variant, swig must be installed with the r variant as well."
122      return -code error "incompatible swig installation"
123    }
124  }
125 
126  if {[variant_isset octave]} {
127    if {![file exists ${prefix}/share/swig/1.3.39/octave/octave.swg]} {
128      ui_error "To install shogun with the octave variant, swig must be installed with the octave variant as well."
129      return -code error "incompatible swig installation"
130    }
131  }
132}
133
134post-patch {
135  reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure
136}
137post-destroot {
138  if {[variant_isset doc]} {
139    system "cd ${worksrcpath}/../doc && make"
140    file mkdir ${destroot}${prefix}/share/doc/${name}
141    file copy ${worksrcpath}/../doc ${destroot}${prefix}/share/doc/${name}/doc
142   
143  }
144}
Note: See TracBrowser for help on using the repository browser.