Ticket #36889: Portfile.diff

File Portfile.diff, 1.9 KB (added by lockhart (Thomas Lockhart), 12 years ago)

Explicitly define the +atlas variant and make this the default. Support atlas with an explicit reinplace patch to the makefile. Specify atlas as a conflict if +atlas is not specified.

  • Portfile

    old new  
    55
    66name                levmar
    77version             2.6
    8 revision            2
     8revision            3
    99categories          math
    1010platforms           darwin
    1111license             GPL
     
    3232checksums           rmd160  2b29daea12804050c8d3939b8c142d27d36bffc8 \
    3333                    sha256  3bf4ef1ea4475ded5315e8d8fc992a725f2e7940a74ca3b0f9029d9e6e94bad7
    3434
    35 depends_lib-append  port:atlas
    36 
    3735# Patch taken from levmar RPM by Eric Smith <eric@brouhaha.com>
    3836patch.pre_args      -p1
    3937patchfiles          patch-Makefile.so.diff
    4038
    41 use_configure       no
     39default_variants +atlas
    4240
    4341variant universal {}
    4442
     43variant atlas description {Use MacPorts' ATLAS instead of Accelerate Framework} {
     44    depends_lib-append  port:atlas
     45}
     46
     47if {! [variant_isset atlas]} {
     48    conflicts port:atlas
     49}
     50
     51global makefile
     52set makefile ${worksrcpath}/Makefile.so
     53
     54use_configure       no
     55
    4556set ver_major [lindex [split ${version} "."] 0]
    4657set ver_minor [lindex [split ${version} "."] 1]
    4758set abi_major 2
    4859set abi_minor 2
    4960
    5061post-patch {
    51     set fl [open ${worksrcpath}/Makefile.so]
     62    set fl [open ${makefile}]
    5263    set lines [read $fl]
    5364    close $fl
    5465    foreach line [split $lines \n] {
     
    6879        return -code error
    6980    }
    7081
     82    if {[variant_isset atlas]} {
     83        reinplace "s|^LAPACKLIBS=.*$|LAPACKLIBS= -L${prefix}/lib -lsatlas|g" ${makefile}
     84    }
     85
    7186    reinplace "s|\r||g" ${worksrcpath}/README.txt
    7287    file mkdir ${worksrcpath}/sobj
    7388}
    7489
    75 build.args-append   -f Makefile.so
     90build.args-append   -f ${makefile}
    7691build.args-append   CC="${configure.cc} [get_canonical_archflags cc]"
    7792build.args-append   LDFLAGS+=-Wl,-rpath,${prefix}/lib
    7893# Add this local rpath to allow port test to run successfully