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

Last change on this file since 132910 was 132910, checked in by ryandesign@…, 5 years ago

qrupdate: do not set default variant if user has already specified conflicting variant (#46830)

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