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 93792 2012-05-31 09:18:09Z and.damore@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup muniversal 1.0 |
---|
6 | |
---|
7 | name qrupdate |
---|
8 | version 1.1.2 |
---|
9 | revision 1 |
---|
10 | # upstream follows a weird folder naming policy, we need last two digits of version separated by a dot |
---|
11 | set branch [join [lrange [split ${version} .] 1 2] .] |
---|
12 | categories math |
---|
13 | license GPL-3+ |
---|
14 | maintainers nomaintainer |
---|
15 | description library for fast updates of QR and Cholesky decompositions |
---|
16 | long_description \ |
---|
17 | a Fortran library for fast updates of QR and Cholesky decompositions |
---|
18 | homepage http://sourceforge.net/projects/${name}/ |
---|
19 | platforms darwin |
---|
20 | master_sites sourceforge:project/qrupdate/qrupdate/${branch} |
---|
21 | |
---|
22 | checksums rmd160 9d23b2d13278c335f6208ebb6775df4b4049785c \ |
---|
23 | sha256 e2a1c711dc8ebc418e21195833814cb2f84b878b90a2774365f0166402308e08 |
---|
24 | |
---|
25 | use_configure no |
---|
26 | build.target lib solib |
---|
27 | |
---|
28 | build.args PREFIX=${prefix} |
---|
29 | destroot.args PREFIX=${prefix} |
---|
30 | test.args PREFIX=${prefix} |
---|
31 | |
---|
32 | patchfiles patch-Makefile.diff |
---|
33 | |
---|
34 | post-patch { |
---|
35 | # Mac install program does not support -D flag. |
---|
36 | reinplace "s|install -D|install|" ${worksrcpath}/src/Makefile |
---|
37 | |
---|
38 | # Running ranlib on static libraries make universal builds a little more complicated. |
---|
39 | reinplace "s|ar -cr |libtool -o |" ${worksrcpath}/src/Makefile |
---|
40 | } |
---|
41 | |
---|
42 | # Fortran compilers can not cross-compile |
---|
43 | if { ${os.arch}=="i386" } { |
---|
44 | set universal_archs_supported "i386 x86_64" |
---|
45 | } else { |
---|
46 | set universal_archs_supported "ppc ppc64" |
---|
47 | } |
---|
48 | |
---|
49 | post-configure { |
---|
50 | if { ! [variant_isset universal] } { |
---|
51 | if { ${build_arch} == "x86_64" || ${build_arch} == "ppc64" } { |
---|
52 | reinplace "s|^FFLAGS=|FFLAGS=-m64 |" ${worksrcpath}/Makeconf |
---|
53 | } else { |
---|
54 | reinplace "s|^FFLAGS=|FFLAGS=-m32 |" ${worksrcpath}/Makeconf |
---|
55 | } |
---|
56 | } else { |
---|
57 | foreach arch ${universal_archs_to_use} { |
---|
58 | if { ${arch}=="x86_64" || ${arch}=="ppc64" } { |
---|
59 | reinplace "s|^FFLAGS=|FFLAGS=-m64 |" ${worksrcpath}-${arch}/Makeconf |
---|
60 | } else { |
---|
61 | reinplace "s|^FFLAGS=|FFLAGS=-m32 |" ${worksrcpath}-${arch}/Makeconf |
---|
62 | } |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|
66 | |
---|
67 | |
---|
68 | variant no_atlas description {Legacy compatibility variant} {} |
---|
69 | |
---|
70 | variant atlas description {build with atlas instead of Accelerate framework} { |
---|
71 | depends_lib-append port:atlas |
---|
72 | build.args-append BLAS="-L${prefix}/lib -latlas" LAPACK="-L${prefix}/lib -llapack" |
---|
73 | destroot.args-append BLAS="-L${prefix}/lib -latlas" LAPACK="-L${prefix}/lib -llapack" |
---|
74 | test.args-append BLAS="-L${prefix}/lib -latlas" LAPACK="-L${prefix}/lib -llapack" |
---|
75 | } |
---|
76 | if {![variant_isset atlas]} { |
---|
77 | build.args-append BLAS="-framework Accelerate" LAPACK="-framework Accelerate" |
---|
78 | destroot.args-append BLAS="-framework Accelerate" LAPACK="-framework Accelerate" |
---|
79 | test.args-append BLAS="-framework Accelerate" LAPACK="-framework Accelerate" |
---|
80 | } |
---|
81 | |
---|
82 | if {[variant_isset g95] || [variant_isset no_atlas]} { |
---|
83 | default_variants -atlas |
---|
84 | } else { |
---|
85 | default_variants +atlas |
---|
86 | } |
---|
87 | |
---|
88 | |
---|
89 | variant g95 conflicts gcc45 gcc46 gcc47 universal description {build with g95} { |
---|
90 | depends_build-append port:g95 |
---|
91 | post-patch { |
---|
92 | reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile |
---|
93 | reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile |
---|
94 | } |
---|
95 | } |
---|
96 | |
---|
97 | variant gcc45 conflicts g95 gcc46 gcc47 universal description {build with gcc45 fortran} { |
---|
98 | depends_lib-append port:gcc45 |
---|
99 | post-patch { |
---|
100 | reinplace "s|gfortran|gfortran-mp-4.5|" ${worksrcpath}/Makeconf |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | variant gcc46 conflicts g95 gcc45 gcc47 description {build with gcc46 fortran} { |
---|
105 | depends_lib-append port:gcc46 |
---|
106 | post-patch { |
---|
107 | reinplace "s|gfortran|gfortran-mp-4.6|" ${worksrcpath}/Makeconf |
---|
108 | } |
---|
109 | } |
---|
110 | |
---|
111 | variant gcc47 conflicts g95 gcc45 gcc46 description {build with gcc47 fortran} { |
---|
112 | depends_lib-append port:gcc47 |
---|
113 | post-patch { |
---|
114 | reinplace "s|gfortran|gfortran-mp-4.7|" ${worksrcpath}/Makeconf |
---|
115 | } |
---|
116 | } |
---|
117 | |
---|
118 | if {![variant_isset gcc46] && ![variant_isset gcc47] \ |
---|
119 | && ![variant_isset g95]} { |
---|
120 | default_variants +gcc45 |
---|
121 | } |
---|
122 | |
---|
123 | |
---|
124 | test.run yes |
---|