Ticket #40039: Portfile

File Portfile, 3.5 KB (added by wimmer@…, 11 years ago)
Line 
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$
3
4PortSystem          1.0
5
6name                mumps
7version             4.10.0
8revision            0
9
10categories          science
11maintainers         ilorentz.org:wimmer
12platforms           darwin
13license             {public domain}
14
15description         A sparse linear solver library
16long_description    \
17   MUMPS is a library for solving sparse linear systems. The single-core \
18   variant has "_seq" attached to the library name, as in Debian-based \
19   Linux distributions. (Currently, only the single-core version of the \
20   library is installed.)
21
22homepage            http://graal.ens-lyon.fr/MUMPS/
23master_sites        http://mumps.enseeiht.fr/
24distname            MUMPS_${version}
25
26use_bzip2           no
27
28worksrcdir          MUMPS_${version}
29
30checksums           md5     959e9981b606cd574f713b8422ef0d9f \
31                    sha1    904b1d816272d99f1f53913cbd4789a5be1838f7 \
32                    rmd160  19ae1f4773ab1643237f791085d9721932a618fc
33
34use_configure       no
35
36variant gcc44 conflicts gcc45 gcc46 gcc47 description {Build with gcc 4.4} {}
37variant gcc45 conflicts gcc44 gcc46 gcc47 description {Build with gcc 4.5} {}
38variant gcc46 conflicts gcc44 gcc45 gcc47 description {Build with gcc 4.6} {}
39variant gcc47 conflicts gcc44 gcc45 gcc46 description {Build with gcc 4.7} {}
40
41if {[variant_isset gcc44]} {
42    depends_lib-append  port:gcc44
43    configure.compiler  macports-gcc-4.4
44} elseif {[variant_isset gcc45]} {
45    depends_lib-append  port:gcc45
46    configure.compiler  macports-gcc-4.5
47} elseif {[variant_isset gcc46]} {
48    depends_lib-append  port:gcc46
49    configure.compiler  macports-gcc-4.6
50} else {
51    default_variants    +gcc47
52    depends_lib-append  port:gcc47
53    configure.compiler  macports-gcc-4.7
54}
55
56variant universal {
57}
58
59set archflags       [get_canonical_archflags]
60
61depends_lib-append  port:scotch
62
63build.env-append    LDFLAGS="[join ${configure.ldflags}] ${archflags}"
64
65pre-build {
66    copy ${worksrcpath}/Make.inc/Makefile.gfortran.SEQ ${worksrcpath}/Makefile.inc
67    reinplace "s|gfortran|${configure.fc}|" ${worksrcpath}/Makefile.inc
68    reinplace "s|gcc|${configure.cc}|" ${worksrcpath}/Makefile.inc
69    reinplace "s|#LSCOTCH    = -L\$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr|LSCOTCH    = -lesmumps -lscotch -lscotcherr|" ${worksrcpath}/Makefile.inc
70    reinplace "s|ORDERINGSF  = -Dpord|ORDERINGSF  = -Dpord -Dscotch|" ${worksrcpath}/Makefile.inc
71    reinplace "s|OPTF    = -O -DALLOW_NON_INIT|OPTF    = -O -DALLOW_NON_INIT -fPIC|" ${worksrcpath}/Makefile.inc
72    reinplace "s|OPTL    = -O|OPTL    = -O -fPIC|" ${worksrcpath}/Makefile.inc
73    reinplace "s|OPTC    = -O|OPTC    = -O -fPIC|" ${worksrcpath}/Makefile.inc
74}
75
76use_parallel_build  no
77build.target all
78
79destroot {
80    move ${worksrcpath}/lib/libsmumps.a ${worksrcpath}/lib/libsmumps_seq.a
81    move ${worksrcpath}/lib/libdmumps.a ${worksrcpath}/lib/libdmumps_seq.a
82    move ${worksrcpath}/lib/libcmumps.a ${worksrcpath}/lib/libcmumps_seq.a
83    move ${worksrcpath}/lib/libzmumps.a ${worksrcpath}/lib/libzmumps_seq.a
84    move ${worksrcpath}/lib/libmumps_common.a ${worksrcpath}/lib/libmumps_common_seq.a
85    move ${worksrcpath}/lib/libpord.a ${worksrcpath}/lib/libpord_seq.a
86    eval xinstall -m 755 [glob ${worksrcpath}/include/*] ${destroot}${prefix}/include
87    eval xinstall -m 755 [glob ${worksrcpath}/lib/*] ${destroot}${prefix}/lib
88    eval xinstall -m 755 [glob ${worksrcpath}/libseq/*] ${destroot}${prefix}/lib
89}