source: trunk/dports/math/glpk/Portfile

Last change on this file was 147594, checked in by khindenburg@…, 20 months ago

glpk: update to 4.60 maintainer #50674; rev-bump deps

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1# $Id: Portfile 147594 2016-04-09 13:44:38Z ryandesign@macports.org $
2
3PortSystem      1.0
4PortGroup       muniversal 1.0
5
6name            glpk
7epoch           1
8version         4.60
9license         GPL-3+
10categories      math lang
11platforms       darwin
12maintainers     nomaintainer
13description     GNU Linear Programming Kit
14
15long_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
22homepage        http://www.gnu.org/software/${name}/
23master_sites    gnu
24
25checksums       rmd160  a1fb4b2730c5f2faad47b9014e2e70c384f63db9 \
26                sha256  1356620cb0a0d33ac3411dd49d9fd40d53ece73eaec8f6b8d19a77887ff5e297
27
28depends_lib     port:gmp
29
30configure.args  --with-gmp
31
32if { [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
38use_parallel_build  yes
39
40test.run        yes
41test.target     check
42
43set docdir ${prefix}/share/doc/${name}
44
45post-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
63variant 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
74variant 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
85variant mysql requires mysql5 description {legacy variant, use +mysql5 instead} {}
86
87variant 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
101variant 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}
Note: See TracBrowser for help on using the repository browser.