source: trunk/dports/math/libsvm/Portfile

Last change on this file was 145012, checked in by khindenburg@…, 22 months ago

libsvm: remove legacy variants

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
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: Portfile 145012 2016-01-23 20:18:32Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                libsvm
7epoch               3
8version             3.20
9revision            2
10categories          math
11maintainers         hum openmaintainer
12license             BSD
13platforms           darwin
14
15description         A free Support Vector Machine implementation.
16
17long_description    ${description} By Chih-Chung Chang and Chih-Jen Lin of       \
18                    National Taiwan University. \"LIBSVM is an integrated        \
19                    software for support vector classification, (C-SVC, nu-SVC), \
20                    regression (epsilon-SVR, nu-SVR) and distribution estimation \
21                    (one-class SVM ). It supports multi-class classification.\"
22
23homepage            http://www.csie.ntu.edu.tw/~cjlin/libsvm/
24master_sites        ${homepage}
25checksums           rmd160  857fc1fed153e72c894e3579e3b6cb92309e82fb \
26                    sha256  0f122480bef44dec4df6dae056f468c208e4e08c00771ec1b6dae2707fd945be
27
28patchfiles          patch-Makefile.diff
29
30post-patch {
31    reinplace "s|../libsvm.so.2|${prefix}/lib/libsvm.dylib|g" ${worksrcpath}/python/svm.py
32}
33
34use_configure       no
35
36variant universal {}
37
38set libver          ${version}.0
39build.target        all
40build.args          CXX="${configure.cxx} [get_canonical_archflags cxx]" \
41                    PREFIX=${prefix} \
42                    VERSION=${libver}
43
44set docdir          ${prefix}/share/doc/${name}
45set libsvm_dir      ${prefix}/share/${name}
46
47destroot {
48    xinstall -m 755 -W ${worksrcpath} svm-train svm-predict svm-scale ${destroot}${prefix}/bin
49    xinstall -m 644 -W ${worksrcpath} libsvm.a libsvm.${libver}.dylib ${destroot}${prefix}/lib
50    xinstall -m 644 -W ${worksrcpath} svm.h ${destroot}${prefix}/include
51
52    ln -sf ${name}.${libver}.dylib ${destroot}${prefix}/lib/${name}.dylib
53
54    xinstall -m 755 -d ${destroot}${docdir}
55    xinstall -m 755 -d ${destroot}${libsvm_dir}
56    xinstall -m 644 -W ${worksrcpath} COPYRIGHT README FAQ.html ${destroot}${docdir}
57    xinstall -m 644 -W ${worksrcpath} heart_scale               ${destroot}${libsvm_dir}
58
59    # install python interface.
60    xinstall -m 755 -d ${destroot}${libsvm_dir}/python
61    xinstall -m 644 -W ${worksrcpath}/python README svm.py svmutil.py ${destroot}${libsvm_dir}/python
62}
63
64variant java description {Install Java JAR files} {
65    depends_run-append  bin:java:kaffe
66
67    post-destroot {
68        set jdir ${destroot}${prefix}/share/java
69        xinstall -m 755 -d ${jdir}
70        file rename ${worksrcpath}/java ${jdir}/${name}
71    }
72}
73
74# TODO: Remove after 2016-05-14.
75variant python26 requires python27 description {Legacy variant} {}
76variant python33 requires python34 description {Legacy variant} {}
77
78variant python27 description {Install Python 2.7 interface} {
79    depends_lib-append  port:python27
80    post-destroot { install_py 2.7 }
81}
82
83variant python34 description {Install Python 3.4 interface} {
84    depends_lib-append  port:python34
85    post-destroot { install_py 3.4 }
86}
87
88proc install_py {branch} {
89    global frameworks_dir destroot worksrcpath
90    set py_prefix  ${frameworks_dir}/Python.framework/Versions/${branch}
91    set dir        ${destroot}${py_prefix}/lib/python${branch}/site-packages
92    xinstall -m 755 -d ${dir}
93    xinstall -m 644 -W ${worksrcpath}/python svm.py svmutil.py ${dir}
94}           
95
96# TODO: matlab and svm-toy.
97
98variant tools description {Install useful tools} {
99#    depends_run-append  port:gnuplot
100
101    # fselect.py, plotroc.py and gridregression.py are taken from
102    # http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/:
103    # fselect/fselect.py, roc/plotroc.py, gridsvr/gridregression.py
104    post-destroot {
105        file rename ${worksrcpath}/tools ${destroot}${libsvm_dir}
106        xinstall -m 755 -W ${filespath} \
107            fselect.py plotroc.py gridregression.py       ${destroot}${libsvm_dir}/tools
108        foreach py {easy.py grid.py fselect.py plotroc.py gridregression.py} {
109            reinplace "s|\"\\.\\./|\"${prefix}/bin/|g"    ${destroot}${libsvm_dir}/tools/${py}
110            reinplace "s|\"\\./|\"${libsvm_dir}/tools/|g" ${destroot}${libsvm_dir}/tools/${py}
111            reinplace "s|\"/usr/bin/|\"${prefix}/bin/|g"  ${destroot}${libsvm_dir}/tools/${py}
112        }
113    }
114}
115
116default_variants    +java +python27 +tools
117
118livecheck.type      regex
119livecheck.regex     {Version ([0-9.]+) }
Note: See TracBrowser for help on using the repository browser.