1 | # $Id: Portfile 147594 2016-04-09 13:44:38Z khindenburg@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup muniversal 1.0 |
---|
5 | |
---|
6 | name glpk |
---|
7 | epoch 1 |
---|
8 | version 4.60 |
---|
9 | license GPL-3+ |
---|
10 | categories math lang |
---|
11 | platforms darwin |
---|
12 | maintainers nomaintainer |
---|
13 | description GNU Linear Programming Kit |
---|
14 | |
---|
15 | long_description \ |
---|
16 | The GLPK (GNU Linear Programming Kit) package is intended for \ |
---|
17 | solving large-scale linear programming (LP), mixed integer \ |
---|
18 | programming (MIP), and other related problems. It is a set of \ |
---|
19 | routines written in ANSI C and organized in the form of a \ |
---|
20 | callable library. |
---|
21 | |
---|
22 | homepage http://www.gnu.org/software/${name}/ |
---|
23 | master_sites gnu |
---|
24 | |
---|
25 | checksums rmd160 a1fb4b2730c5f2faad47b9014e2e70c384f63db9 \ |
---|
26 | sha256 1356620cb0a0d33ac3411dd49d9fd40d53ece73eaec8f6b8d19a77887ff5e297 |
---|
27 | |
---|
28 | depends_lib port:gmp |
---|
29 | |
---|
30 | configure.args --with-gmp |
---|
31 | |
---|
32 | if { [variant_isset odbc] || [variant_isset iodbc] || [variant_isset mysql5] || [variant_isset mysql56] } { |
---|
33 | depends_lib-append port:libtool |
---|
34 | configure.args-append --enable-dl |
---|
35 | patchfiles-append patch-configure.diff |
---|
36 | } |
---|
37 | |
---|
38 | use_parallel_build yes |
---|
39 | |
---|
40 | test.run yes |
---|
41 | test.target check |
---|
42 | |
---|
43 | set docdir ${prefix}/share/doc/${name} |
---|
44 | |
---|
45 | post-destroot { |
---|
46 | xinstall -d ${destroot}${docdir} |
---|
47 | xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog NEWS README \ |
---|
48 | doc/glpk.pdf doc/gmpl.pdf doc/cnfsat.pdf doc/gmpl_es.pdf doc/graphs.pdf \ |
---|
49 | ${destroot}${docdir} |
---|
50 | |
---|
51 | set examplesdir ${prefix}/share/examples/${name} |
---|
52 | xinstall -d ${destroot}${examplesdir} |
---|
53 | eval xinstall -m 644 \ |
---|
54 | [glob -directory ${worksrcpath}/examples *.{c,mod,lp,mps,dat}] \ |
---|
55 | ${destroot}${examplesdir} |
---|
56 | |
---|
57 | xinstall -d ${destroot}${examplesdir}/sql |
---|
58 | eval xinstall -m 644 \ |
---|
59 | [glob -directory ${worksrcpath}/examples/sql *.{mod,sql}] \ |
---|
60 | ${destroot}${examplesdir}/sql |
---|
61 | } |
---|
62 | |
---|
63 | variant odbc conflicts iodbc description {enable MathProg ODBC support using unixODBC} { |
---|
64 | depends_lib-append port:unixODBC |
---|
65 | |
---|
66 | configure.args-append --enable-odbc=unix |
---|
67 | post-patch { |
---|
68 | reinplace \ |
---|
69 | "s|__MACPORTS__ODBC__LIB__|${prefix}/lib|g" \ |
---|
70 | ${worksrcpath}/configure |
---|
71 | } |
---|
72 | } |
---|
73 | |
---|
74 | variant iodbc description {enable MathProg ODBC support using iODBC} { |
---|
75 | depends_lib-append port:libiodbc |
---|
76 | |
---|
77 | configure.args-append --enable-odbc |
---|
78 | post-patch { |
---|
79 | reinplace \ |
---|
80 | "s|__MACPORTS__IODBC__LIB__|${prefix}/lib|g" \ |
---|
81 | ${worksrcpath}/configure |
---|
82 | } |
---|
83 | } |
---|
84 | |
---|
85 | variant mysql requires mysql5 description {legacy variant, use +mysql5 instead} {} |
---|
86 | |
---|
87 | variant mysql5 conflicts mysql56 description {enable MathProg MySQL support using MySQL 5.1} { |
---|
88 | depends_lib-append path:bin/mysql_config5:mysql5 |
---|
89 | |
---|
90 | configure.args-append --enable-mysql |
---|
91 | post-patch { |
---|
92 | reinplace \ |
---|
93 | "s|__MACPORTS__MYSQL__INCLUDE__|${prefix}/include/mysql5/mysql|g" \ |
---|
94 | ${worksrcpath}/configure |
---|
95 | reinplace \ |
---|
96 | "s|__MACPORTS__MYSQL__LIB__|${prefix}/lib/mysql5/mysql|g" \ |
---|
97 | ${worksrcpath}/configure |
---|
98 | } |
---|
99 | } |
---|
100 | |
---|
101 | variant mysql56 conflicts mysql5 description {enable MathProg MySQL support using MySQL 5.6} { |
---|
102 | depends_lib-append port:mysql56 |
---|
103 | |
---|
104 | configure.args-append --enable-mysql |
---|
105 | post-patch { |
---|
106 | reinplace \ |
---|
107 | "s|__MACPORTS__MYSQL__INCLUDE__|${prefix}/include/mysql56/mysql|g" \ |
---|
108 | ${worksrcpath}/configure |
---|
109 | reinplace \ |
---|
110 | "s|__MACPORTS__MYSQL__LIB__|${prefix}/lib/mysql56/mysql|g" \ |
---|
111 | ${worksrcpath}/configure |
---|
112 | } |
---|
113 | } |
---|