# -*- 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
PortGroup linear_algebra 1.0
compilers.setup require_fortran
checksums rmd160 9d23b2d13278c335f6208ebb6775df4b4049785c \
sha256 e2a1c711dc8ebc418e21195833814cb2f84b878b90a2774365f0166402308e08
# upstream follows a weird folder naming policy, we need last two digits of version separated by a dot
set branch [join [lrange [split ${version} .] 1 2] .]
description library for fast updates of QR and Cholesky decompositions
long_description a Fortran library for fast updates of QR and Cholesky decompositions
homepage http://sourceforge.net/projects/${name}/
master_sites sourceforge:project/qrupdate/qrupdate/${branch}
build.args PREFIX=${prefix} LAPACK=""
destroot.args PREFIX=${prefix} LAPACK=""
test.args PREFIX=${prefix} LAPACK=""
patchfiles patch-Makefile.diff
# Mac install program does not support -D flag.
reinplace "s|install -D|install|" ${worksrcpath}/src/Makefile
# Running ranlib on static libraries make universal builds a little more complicated.
reinplace "s|ar -cr |libtool -o |" ${worksrcpath}/src/Makefile
if {[variant_isset g95]} {
reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/Makefile
reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/src/Makefile
reinplace "s|Makeconf|Makeconf.g95|" ${worksrcpath}/test/Makefile
reinplace "s|gfortran|${configure.fc}|" ${worksrcpath}/Makeconf
# Fortran compilers cannot cross-compile
if {${os.arch} eq "i386"} {
set universal_archs_supported "i386 x86_64"
set universal_archs_supported "ppc ppc64"
if { ! [variant_isset universal] } {
if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
reinplace "s|^FFLAGS=|FFLAGS=-m64 |" ${worksrcpath}/Makeconf