source: trunk/dports/math/glpk/Portfile @ 58230

Last change on this file since 58230 was 58230, checked in by ryandesign@…, 11 years ago

rewrite mysql5 dependency so mysql5-devel can satisfy it

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1# $Id: Portfile 58230 2009-09-24 16:45:22Z ryandesign@macports.org $
2
3PortSystem      1.0
4PortGroup       muniversal 1.0
5
6name            glpk
7version         4.39
8categories      math lang
9platforms       darwin
10maintainers     fastmail.fm:lutz.horn
11description     GNU Linear Programming Kit
12
13long_description \
14    The GLPK (GNU Linear Programming Kit) package is intended for \
15    solving large-scale linear programming (LP), mixed integer \
16    programming (MIP), and other related problems. It is a set of \
17    routines written in ANSI C and organized in the form of a \
18    callable library.
19
20homepage        http://www.gnu.org/software/${name}/
21master_sites    gnu
22
23checksums       md5     95f276ef6c94c6de1eb689f161f525f3 \
24                sha1    99d8d0e576fee63fa0d411d92c7c70a7be090ec6 \
25                rmd160  ffb8b7214bba04c387ce67837ca05664ee7a53f8
26
27depends_lib     port:gmp port:zlib
28
29configure.args  --with-gmp --with-zlib
30
31if { [variant_isset odbc] || [variant_isset mysql] } {
32    depends_lib-append port:libtool
33    configure.args-append --enable-dl
34}
35
36use_parallel_build  yes
37
38test.run        yes
39test.target     check
40
41post-patch {
42    # glpk uses nmedit to make certain symbols local.
43    # octave 3.0.3 relies on the obsolete __glp_lib_print_hook and __glp_lib_fault_hook symbols, so they must be kept global.
44    # See http://www.nabble.com/octave-3.0.3-build-problem-due-to-glpk-td19945239.html for a discussion.
45    reinplace \
46        "s|export-symbols-regex '^(glp_\\|_glp_lpx_).*'|export-symbols-regex '^(glp_\\|_glp_lpx_\\|_glp_lib_fault_hook\\|_glp_lib_print_hook).*'|g" \
47        ${worksrcpath}/src/Makefile.in
48}
49
50variant examples description {install examples} {
51    post-destroot {
52        set examplesdir ${destroot}${prefix}/share/doc/${name}/examples
53        xinstall -m 755 -d ${examplesdir}
54        foreach fl [glob -tails -directory ${worksrcpath}/examples *.{c,mod,lp,mps,dat}] {
55            xinstall -m 644 -W ${worksrcpath}/examples $fl ${examplesdir}
56        }
57        xinstall -m 755 -d ${examplesdir}/sql
58        foreach fl [glob -tails -directory ${worksrcpath}/examples/sql *.{mod,sql}] {
59            xinstall -m 644 -W ${worksrcpath}/examples/sql $fl ${examplesdir}/sql
60        }
61    }
62}
63
64variant doc description {build and install documentation} {
65    depends_build-append path:${prefix}/bin/pdflatex:texlive \
66        path:${prefix}/bin/texi2pdf:texinfo
67    post-destroot {
68        set docdir ${destroot}${prefix}/share/doc/${name}
69        xinstall -m 755 -d ${docdir}
70        system "cd ${worksrcpath}/doc && ${prefix}/bin/pdflatex glpk.tex && ${prefix}/bin/pdflatex glpk.tex"
71        system "cd ${worksrcpath}/doc && ${prefix}/bin/texi2pdf gmpl.texi"
72        xinstall -m 644 -W ${worksrcpath}/doc glpk.pdf gmpl.pdf glpk_faq.txt ${docdir}
73        xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog INSTALL NEWS README ${docdir}
74    }
75}
76
77variant odbc description {enable MathProg ODBC support} {
78    depends_lib-append port:unixODBC
79    configure.args-append --enable-odbc=unix
80    post-patch {
81        reinplace \
82            "s|libodbc.so|${prefix}/lib/libodbc.dylib|g" \
83            ${worksrcpath}/configure
84    }
85}
86
87variant mysql description {enable MathProg MySQL support} {
88    depends_lib-append path:bin/mysql_config5:mysql5
89    configure.args-append --enable-mysql
90    post-patch {
91        reinplace \
92            "s|/usr/include/mysql|${prefix}/include/mysql5/mysql|g" \
93            ${worksrcpath}/configure
94        reinplace \
95            "s|libmysqlclient.so|${prefix}/lib/mysql5/mysql/libmysqlclient.dylib|g" \
96            ${worksrcpath}/configure
97    }
98}
99
100livecheck.type  regex
101livecheck.url   http://ftp.gnu.org/gnu/${name}/?C=M&O=D
102livecheck.regex ${name}-(\\d+\\.\\d+)
Note: See TracBrowser for help on using the repository browser.