# $Id$ PortSystem 1.0 categories math science name shogun version 0.8.0 maintainers jameskyle platforms darwin description The machine learning toolbox's focus is on large scale \ kernel methods long_description ${description} and especially on Support Vector Machines \ (SVM). It provides a generic SVM object interfacing to \ several different SVM implementations, among them the \ state of the art OCAS, LibSVM, SVMLight, SVMLin and GPDT. homepage http://www.shogun-toolbox.org/ master_sites http://shogun-toolbox.org/archives/shogun/releases/0.8/sources/ use_bzip2 yes distfiles shogun-${version}${extract.suffix} checksums md5 e21db2d96288223d8da2e7a49e237245 \ sha1 bd4ef09f0a561eb3fb8ba3bd19939d69265f00c6 \ rmd160 0bd5d7bb7a2fbf3ed6a276a6a5b92d7f774c8df4 worksrcdir ${name}-${version}/src depends_build port:bzip2 \ port:gsed \ port:gcc43 depends_lib port:swig \ port:atlas \ port:readline \ port:glpk \ port:python26 \ port:py26-numpy set python_prefix ${prefix}/Library/Frameworks/Python.framework/Versions/2.6 configure.args --disable-svm-light \ --libs=${prefix}/lib \ --install-path=${prefix} \ --includes=${prefix}/include \ --destdir=${destroot} \ --cc=${prefix}/bin/gcc-mp-4.3 \ --cxx=${prefix}/bin/g++-mp-4.3 \ --includes=${python_prefix}/include/python2.6 \ --python=${python_prefix}/bin/python2.6 \ --pydir=${python_prefix}/lib/python2.6/site-packages configure.cc ${prefix}/bin/gcc-mp-4.3 configure.compiler macports-gcc-4.3 proc lremove {list elem} { set index [lsearch -exact $list $elem] return [lreplace $list $index $index] } # Interfaces are added by a comma delimited argument list to --interfaces. # We check for variants and then build this list accordingly set interfaces "libshogun libshogunui cmdline python python_modular" if {[variant_isset r]} {lappend interfaces "r"} if {[variant_isset octave]} {lappend interfaces "octave,octave_modular"} if {[variant_isset elwms] && !([variant_isset python] && [variant_isset octave] && [variant_isset r])} { return -code error "Must set python and both r and octave variants to build elwms interface" } elseif {[variant_isset elwms]} { lappend interfaces "elwms" } # remove python interface if necessary before appending to args if {[variant_isset no_python26] && ![variant_isset python25]} { set interfaces [lremove ${interfaces} "python"] set interfaces [lremove ${interfaces} "python_modular"] } #if {[variant_isset matlab]} {lappend interfaces "matlab"} set interfaces [join $interfaces ","] configure.args-append --interfaces=$interfaces variant elwms description {Build elwms interface. requires python plus one other interface} {} variant python25 requires no_python26 description {Build Python 2.5 API} { configure.args-append \ --includes=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 \ --python=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/bin/python \ --pydir=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/site-packages depends_lib-append port:python25 \ port:py25-numpy } variant no_python26 description {Do not build Python 2.6 API} { configure.args-delete \ --includes=${python_prefix}/include/python2.6 \ --python=${python_prefix}/bin/python2.6 \ --pydir=${python_prefix}/lib/python2.6/site-packages depends_lib-delete port:python26 \ port:py26-numpy } variant r description {Build the R API} { depends_lib-append port:R } variant octave description {Build the Octave API} { depends_lib-append port:octave } variant no_glpk description {Disable glpk support} { configure.args-append --disable-glpk depends_lib-delete port:glpk } #variant matlab description {Build the Matlab API} {} variant doc description {Install the documentation for shogun} { depends_build-append port:texlive \ path:bin/dot:graphviz \ port:doxygen } pre-extract { # Before doing anything, verify the correct swig bindings are present for # our variants if {[file exists ${prefix}/bin/swig]} { ui_debug "Attempting to find swig version" set swig_version [exec ${prefix}/bin/swig -version] regexp {(\d.?)+} $swig_version sversion set sversion [string trimright $sversion \n] } else { set sversion 0.0.0 } ui_debug "Found swig version ${sversion}" if {[variant_isset python]} { } if {[variant_isset python] || [variant_isset python26]} { ui_debug "Looking for swig python interface at ${prefix}/share/swig/${sversion}/python/python.swg" if {![file exists ${prefix}/share/swig/${sversion}/python/python.swg]} { ui_error "To install shogun with the python variant, swig must be installed with the python variant as well." return -code error "incompatible swig installation" } } if {[variant_isset r]} { if {![file exists ${prefix}/share/swig/${sversion}/r/r.swg]} { ui_error "To install shogun with the r variant, swig must be installed with the r variant as well." return -code error "incompatible swig installation" } } if {[variant_isset octave]} { if {![file exists ${prefix}/share/swig/${sversion}/octave/octave.swg]} { ui_error "To install shogun with the octave variant, swig must be installed with the octave variant as well." return -code error "incompatible swig installation" } } } pre-configure { reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure reinplace "s|= $\{_libdir\}/$\{_pydir\}|= $\{_pydir\}|g" ${worksrcpath}/configure } post-destroot { if {[variant_isset doc]} { system "cd ${worksrcpath}/../doc && make" file mkdir ${destroot}${prefix}/share/doc/${name} file copy ${worksrcpath}/../doc ${destroot}${prefix}/share/doc/${name}/doc } }