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 138751 2015-07-18 04:27:50Z hum@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name liblinear |
---|
7 | version 2.01 |
---|
8 | categories math |
---|
9 | maintainers hum openmaintainer |
---|
10 | |
---|
11 | description A simple package for solving large-scale regularized linear classification. |
---|
12 | |
---|
13 | long_description LIBLINEAR is a simple package for solving large-scale regularized \ |
---|
14 | linear classification. It currently supports L2-regularized logistic \ |
---|
15 | regression/L2-loss support vector classification/L1-loss support vector \ |
---|
16 | classification, and L1-regularized L2-loss support vector classification/ \ |
---|
17 | logistic regression. |
---|
18 | |
---|
19 | homepage http://www.csie.ntu.edu.tw/~cjlin/liblinear/ |
---|
20 | platforms darwin |
---|
21 | license BSD |
---|
22 | |
---|
23 | master_sites ${homepage} |
---|
24 | checksums rmd160 35a5dc7179a0d5198609ae9c478d848816b27928 \ |
---|
25 | sha256 ebc71999224f5779574b11e248f1e2ef647b5d839c0380c1c5a4ac8789aa95a9 |
---|
26 | |
---|
27 | patchfiles patch-Makefile.diff |
---|
28 | |
---|
29 | use_configure no |
---|
30 | |
---|
31 | variant universal {} |
---|
32 | |
---|
33 | build.target all |
---|
34 | build.args CC="${configure.cc} ${configure.cflags} [get_canonical_archflags]" \ |
---|
35 | CXX="${configure.cxx} ${configure.cxxflags} [get_canonical_archflags cxx]" \ |
---|
36 | PREFIX=${prefix} |
---|
37 | |
---|
38 | destroot { |
---|
39 | xinstall -m 755 -W ${worksrcpath} train predict ${destroot}${prefix}/bin |
---|
40 | xinstall -m 644 -W ${worksrcpath} liblinear.dylib ${destroot}${prefix}/lib |
---|
41 | xinstall -m 644 -W ${worksrcpath} linear.h tron.h ${destroot}${prefix}/include |
---|
42 | |
---|
43 | # Copy additional documents. |
---|
44 | set dest_doc ${destroot}${prefix}/share/doc/${name} |
---|
45 | xinstall -m 755 -d ${dest_doc} |
---|
46 | xinstall -m 644 -W ${worksrcpath} COPYRIGHT README ${dest_doc} |
---|
47 | |
---|
48 | # Copy sample data. |
---|
49 | set dest_ex ${destroot}${prefix}/share/examples/${name} |
---|
50 | xinstall -m 755 -d ${dest_ex} |
---|
51 | xinstall -m 644 -W ${worksrcpath} heart_scale ${dest_ex} |
---|
52 | |
---|
53 | # Copy python scripts. |
---|
54 | set dest_py ${dest_ex}/python |
---|
55 | xinstall -m 755 -d ${dest_py} |
---|
56 | xinstall -m 644 -W ${worksrcpath}/python \ |
---|
57 | README liblinear.py liblinearutil.py \ |
---|
58 | ${dest_py} |
---|
59 | } |
---|
60 | |
---|
61 | # TODO: Remove after 2015-12-26. |
---|
62 | variant python24 requires python27 description {Legacy variant} {} |
---|
63 | variant python25 requires python27 description {Legacy variant} {} |
---|
64 | variant python31 requires python34 description {Legacy variant} {} |
---|
65 | variant python32 requires python34 description {Legacy variant} {} |
---|
66 | |
---|
67 | # TODO: Remove after 2016-05-14. |
---|
68 | variant python26 requires python27 description {Legacy variant} {} |
---|
69 | variant python33 requires python34 description {Legacy variant} {} |
---|
70 | |
---|
71 | variant python27 description {Install Python 2.7 interface} { |
---|
72 | depends_lib-append port:python27 |
---|
73 | post-destroot { install_py 2.7 } |
---|
74 | } |
---|
75 | |
---|
76 | variant python34 description {Install Python 3.4 interface} { |
---|
77 | depends_lib-append port:python34 |
---|
78 | post-destroot { install_py 3.4 } |
---|
79 | } |
---|
80 | |
---|
81 | proc install_py {branch} { |
---|
82 | global frameworks_dir destroot worksrcpath |
---|
83 | set py_prefix ${frameworks_dir}/Python.framework/Versions/${branch} |
---|
84 | set dir ${destroot}${py_prefix}/lib/python${branch}/site-packages |
---|
85 | xinstall -m 755 -d ${dir} |
---|
86 | xinstall -m 644 -W ${worksrcpath}/python liblinear.py liblinearutil.py ${dir} |
---|
87 | } |
---|
88 | |
---|
89 | if {![variant_isset python27] && ![variant_isset python34]} { |
---|
90 | default_variants +python27 |
---|
91 | } |
---|
92 | |
---|
93 | livecheck.type regex |
---|
94 | livecheck.regex {Version *([0-9.]+) *} |
---|