source: trunk/dports/math/qrupdate/Portfile @ 148974

Last change on this file since 148974 was 148974, checked in by dstrubbe@…, 3 years ago

qrupdate: Fix test phase with +g95 (needed to modify test/Makefile too). Remove useless patch. Consolidate blocks.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
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: Portfile 148974 2016-05-24 01:57:49Z dstrubbe@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6PortGroup           compilers 1.0
7PortGroup           linear_algebra 1.0
8
9compilers.choose    fc
10compilers.setup     require_fortran -dragonegg
11
12name                qrupdate
13version             1.1.2
14revision            4
15# upstream follows a weird folder naming policy, we need last two digits of version separated by a dot
16set branch          [join [lrange [split ${version} .] 1 2] .]
17categories          math
18license             GPL-3+
19maintainers         nomaintainer
20description         library for fast updates of QR and Cholesky decompositions
21long_description    a Fortran library for fast updates of QR and Cholesky decompositions
22homepage            http://sourceforge.net/projects/${name}/
23platforms           darwin
24master_sites        sourceforge:project/qrupdate/qrupdate/${branch}
25
26checksums           rmd160  9d23b2d13278c335f6208ebb6775df4b4049785c \
27                    sha256  e2a1c711dc8ebc418e21195833814cb2f84b878b90a2774365f0166402308e08
28
29use_configure       no
30build.target        lib solib
31
32build.args          PREFIX=${prefix} LAPACK=""
33destroot.args       PREFIX=${prefix} LAPACK=""
34test.args           PREFIX=${prefix} LAPACK=""
35
36post-extract {
37    # Mac install program does not support -D flag.
38    reinplace "s|install -D|install|"  ${worksrcpath}/src/Makefile
39
40    # Running ranlib on static libraries make universal builds a little more complicated.
41    reinplace "s|ar -cr |libtool -o |"  ${worksrcpath}/src/Makefile
42
43    if {[variant_isset g95]} {
44        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile
45        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile
46        reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/test/Makefile
47    } else {
48        reinplace "s|gfortran|${configure.fc}|" ${worksrcpath}/Makeconf
49    }
50}
51
52# Fortran compilers cannot cross-compile
53if {${os.arch} eq "i386"} {
54    set universal_archs_supported "i386 x86_64"
55} else {
56    set universal_archs_supported "ppc ppc64"
57}
58
59post-configure {
60    if { ! [variant_isset universal] } {
61        if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
62            reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}/Makeconf
63        } else {
64            reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}/Makeconf
65        }
66    } else {
67        foreach arch ${universal_archs_to_use} {
68            if {${arch} eq "x86_64" || ${arch} eq "ppc64"} {
69                reinplace "s|^FFLAGS=|FFLAGS=-m64 |"  ${worksrcpath}-${arch}/Makeconf
70            } else {
71                reinplace "s|^FFLAGS=|FFLAGS=-m32 |"  ${worksrcpath}-${arch}/Makeconf
72            }
73        }
74    }
75
76    build.args-append       BLAS="${linalglib}"
77    destroot.args-append    BLAS="${linalglib}"
78    test.args-append        BLAS="${linalglib}"
79}
80
81test.run    yes
Note: See TracBrowser for help on using the repository browser.