Ticket #15615: Portfile.2

File Portfile.2, 2.7 KB (added by ajb78@…, 16 years ago)

cleaner version of portfile for py-cvxopt

Line 
1# $Id$
2
3PortSystem         1.0
4PortGroup          python24 1.0
5
6categories         python
7name               py-cvxopt
8version            1.0
9distname           cvxopt-${version}
10maintainers        nomaintainer
11platforms          darwin
12
13description        Python module for convex optimization
14long_description   CVXOPT is a free software package for convex optimization \
15based on the Python programming language. It can be used with the interactive \
16Python interpreter, on the command line by executing Python scripts, or \
17integrated in other software via Python extension modules. Its main purpose is \
18to make the development of software for convex optimization applications \
19straightforward by building on Python's extensive standard library and on the \
20strengths of Python as a high-level programming language.
21
22homepage           http://abel.ee.ucla.edu/cvxopt
23
24distfiles          cvxopt-${version}.tar.gz.gtar
25master_sites       http://abel.ee.ucla.edu/download.php
26
27checksums          md5 4fccd976f8e39d9b7f38c663f7652a8a \
28                   sha1 d05700009b1df26c97d20c5afb22386fe587fc0e \
29                   rmd160 9034093062ba66f72dd2af65f4d982bd7b5e1ce0
30
31depends_lib port:atlas
32
33variant gsl description {Allow linking to gsl} {
34  depends_lib-append port:gsl
35}
36
37variant fftw description {Link to fftw library} {
38  depends_lib-append port:fftw-3
39}
40
41variant glpk description {Link to glpk library} {
42  depends_lib-append port:glpk
43}
44
45default_variants +gsl +glpk +fftw
46
47configure {
48    reinplace "s|ATLAS_LIB_DIR = .*|ATLAS_LIB_DIR = '/opt/local/lib'|" \
49              ${worksrcpath}/src/setup.py
50
51    if {[variant_isset gsl]} {
52        reinplace "s|BUILD_GSL = .*|BUILD_GSL = 1|" \
53              ${worksrcpath}/src/setup.py
54        reinplace "s|GSL_LIB_DIR = .*|GSL_LIB_DIR = '/opt/local/lib'|" \
55              ${worksrcpath}/src/setup.py
56        reinplace "s|GSL_INC_DIR = .*|GSL_INC_DIR = '/opt/local/include'|" \
57              ${worksrcpath}/src/setup.py
58    }
59    if {[variant_isset glpk]} {
60        reinplace "s|BUILD_GLPK = .*|BUILD_GLPK = 1|" \
61              ${worksrcpath}/src/setup.py
62        reinplace "s|GLPK_LIB_DIR = .*|GLPK_LIB_DIR = '/opt/local/lib'|" \
63              ${worksrcpath}/src/setup.py
64        reinplace "s|GLPK_INC_DIR = .*|GLPK_INC_DIR = '/opt/local/include'|" \
65              ${worksrcpath}/src/setup.py
66    }
67    if {[variant_isset fftw]} {
68        reinplace "s|BUILD_FFTW = .*|BUILD_FFTW = 1|" \
69              ${worksrcpath}/src/setup.py
70        reinplace "s|FFTW_LIB_DIR = .*|FFTW_LIB_DIR = '/opt/local/lib'|" \
71              ${worksrcpath}/src/setup.py
72        reinplace "s|FFTW_INC_DIR = .*|FFTW_INC_DIR = '/opt/local/include'|" \
73              ${worksrcpath}/src/setup.py
74    }
75}
76
77build.dir ${worksrcpath}/src
78
79destroot.dir ${build.dir}