Ticket #35018: Portfile.diff

File Portfile.diff, 4.7 KB (added by zan@…, 12 years ago)

Unified diff of Portfile

  • Portfile

    old new  
    1 # $Id: Portfile 84527 2011-09-27 18:05:29Z jmr@macports.org $
     1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
     2# $Id$
    23
    3 PortSystem 1.0
     4PortSystem              1.0
    45
    56name                    metis
    6 version                 4.0.3
    7 revision                1
     7version                 5.0.2
    88categories              math
    99# Included license is for "evaluation purposes" only (whatever that means) if
    1010# you're not a non-profit or US government agency.
     
    1919and \[KK95e\]. METIS provides high quality partitions, is extremely fast, and \
    2020produces low fill orderings.
    2121
    22 homepage                http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
     22homepage                        http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
    2323master_sites            http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/ freebsd
    2424
    25 # 4.0.3 was stealth-updated (#28930)
    26 dist_subdir             ${name}/${version}_${revision}
     25checksums                       sha1    b5a278fa06c581e068a8296d158576a4b750f983 \
     26                                        rmd160  737bac9b1c50ea0cf950d16c44ef8f7f9fa0b8f8
    2727
    28 checksums               sha1    63303786414a857eaeea2b2a006521401bccda5e \
    29                         rmd160  9d67c92a2a90ece012443fa623442027c0c21297
    30 
    31 patchfiles              patch-Makefile.diff
    32 
    33 build.target
    34 
    35 # Prevent -lmetis from finding library ${prefix}/lib
     28# Metis uses a GNU make file to fire off a cmake command.
     29# Used for configure, build, and install.
     30depends_build           port:cmake
     31
     32# Building static
     33configure.cmd           /usr/bin/make
     34configure.pre_args      {}
     35configure.args          config \
     36                                        cc=${configure.cc} \
     37                                        prefix=${prefix}
    3638configure.ldflags-delete   -L${prefix}/lib
    3739
    38 set ver0 [join [lrange [split ${version} .] 0 0] .]
    39 set ver1 [join [lrange [split ${version} .] 0 1] .]
     40configure.universal_args        {}
    4041
    41 configure {
    42         # ensure that the correct compiler and compiler options are used.
    43         set optflags ${configure.cflags}
    44         set ldflags ${configure.ldflags}
    45        
    46         if {[variant_isset universal]} {
    47                 append optflags " " ${configure.universal_cflags}
    48                 append ldflags " " ${configure.universal_ldflags}
    49         } else {
    50                 append optflags " " ${configure.cc_archflags}
    51                 append ldflags " " ${configure.cc_archflags}
    52         }
     42build.cmd                       /usr/bin/make
     43build.pre_args          {}
     44build.args                      {}
     45
     46destroot.cmd            /usr/bin/make
     47destroot.pre_args       {}
     48destroot.args           install
     49
     50post-destroot {
     51        # Move metis.h to include/metis/metis.h
     52        xinstall -d -m 755 ${destroot}${prefix}/include/metis
     53        file rename ${destroot}${prefix}/include/metis.h \
     54                                ${destroot}${prefix}/include/metis/metis.h
    5355       
    54         reinplace "s|CC = .*|CC = ${configure.cc}|" ${worksrcpath}/Makefile.in
    55         reinplace "s|OPTFLAGS = .*|OPTFLAGS = ${optflags}|" ${worksrcpath}/Makefile.in
    56         if { [info exists ldflags] } {
    57                 reinplace "s|LDOPTIONS = .*|LDOPTIONS = ${ldflags}|" ${worksrcpath}/Makefile.in
    58         }
    59 
    60         reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/Makefile
    61         reinplace "s|__VERSION__|${version}|g" ${worksrcpath}/Lib/Makefile
    62         reinplace "s|__COMPAT_VER__|${ver0}|g" ${worksrcpath}/Lib/Makefile
    63 }
    64 
    65 destroot {
    66         xinstall -m 755 -d ${destroot}${prefix}/include/metis \
    67                 ${destroot}${prefix}/share/doc/${name}
    68         xinstall -m 755 -W ${worksrcpath} graphchk kmetis mesh2dual mesh2nodal \
    69                 oemetis onmetis partdmesh partnmesh pmetis ${destroot}${prefix}/bin
    70         xinstall -W ${worksrcpath}/Lib -m 644 defs.h macros.h metis.h proto.h rename.h \
    71                 struct.h ${destroot}${prefix}/include/metis
    72         reinplace "s,#include <defs.h>,#include <metis/defs.h>," ${destroot}${prefix}/include/metis/metis.h
    73         reinplace "s,#include <struct.h>,#include <metis/struct.h>," ${destroot}${prefix}/include/metis/metis.h
    74         reinplace "s,#include <macros.h>,#include <metis/macros.h>," ${destroot}${prefix}/include/metis/metis.h
    75         reinplace "s,#include <rename.h>,#include <metis/rename.h>," ${destroot}${prefix}/include/metis/metis.h
    76         reinplace "s,#include <proto.h>,#include <metis/proto.h>," ${destroot}${prefix}/include/metis/metis.h
    77         xinstall -m 644 ${worksrcpath}/libmetis.a ${destroot}${prefix}/lib
    78         xinstall -m 644 ${worksrcpath}/Doc/manual.ps \
     56        # Install documentation
     57        xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
     58        xinstall -m 644 ${worksrcpath}/manual/manual.pdf \
    7959                ${destroot}${prefix}/share/doc/${name}
     60}
    8061
    81         xinstall -m 0755 ${worksrcpath}/libmetis.dylib ${destroot}${prefix}/lib/libmetis.${version}.dylib
    82         ln -s libmetis.${version}.dylib ${destroot}${prefix}/lib/libmetis.dylib
    83         ln -s libmetis.${version}.dylib ${destroot}${prefix}/lib/libmetis.${ver0}.dylib
    84         ln -s libmetis.${version}.dylib ${destroot}${prefix}/lib/libmetis.${ver1}.dylib
     62variant openmpi description {Build Metis with MPI support} {
     63        depends_build-append    port:openmpi
     64        configure.args-append   openmp=1
    8565}
    8666
    8767livecheck.type  regex