91 | | |
92 | | eval xinstall -m 644 \ |
93 | | [glob ${worksrcpath}/*/Lib/*.a] \ |
94 | | ${destroot}${prefix}/lib |
95 | | |
96 | | xinstall -m 755 -d ${destroot}${prefix}/include/ufsparse |
| 114 | |
| 115 | # Do not install cerbla library. |
| 116 | foreach lname {AMD BTF CAMD CCOLAMD COLAMD CHOLMOD CSparse CXSparse KLU LDL SPQR UMFPACK} { |
| 117 | |
| 118 | set ldir ${worksrcpath}/${lname}/Lib |
| 119 | |
| 120 | foreach lib [glob -directory ${ldir} -tails *.a] { |
| 121 | xinstall -m 0644 ${ldir}/${lib} ${destroot}${prefix}/lib |
| 122 | |
| 123 | file mkdir ${ldir}/MacPorts_Temp |
| 124 | |
| 125 | if { ! [variant_isset universal] } { |
| 126 | system "cd ${ldir}/MacPorts_Temp && /usr/bin/ar -x ../${lib}" |
| 127 | } else { |
| 128 | foreach arch ${universal_archs} { |
| 129 | file mkdir ${ldir}/MacPorts_Temp/${arch} |
| 130 | system "cd ${ldir}/MacPorts_Temp/${arch} && /usr/bin/lipo -thin ${arch} ../../${lib} -output ${lib}" |
| 131 | system "cd ${ldir}/MacPorts_Temp/${arch} && /usr/bin/ar -x ${lib}" |
| 132 | } |
| 133 | foreach ofile [glob -tails -directory ${ldir}/MacPorts_Temp/[lindex ${universal_archs} 0] *.o] { |
| 134 | system "cd ${ldir}/MacPorts_Temp && lipo -create */${ofile} -output ${ofile}" |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | set insl_ver $sub_version(${lname}) |
| 139 | set cmpt_ver [join [lrange [split ${insl_ver} .] 0 0] .] |
| 140 | |
| 141 | set base [file rootname ${lib}] |
| 142 | |
| 143 | set install_name ${prefix}/lib/${base}.${cmpt_ver}.dylib |
| 144 | |
| 145 | set linker "" |
| 146 | |
| 147 | if { ${lname}=="SPQR" } { |
| 148 | lappend linker ${configure.cxx} |
| 149 | } else { |
| 150 | lappend linker ${configure.cc} |
| 151 | } |
| 152 | |
| 153 | eval lappend linker -dynamiclib ${configure.ldflags} |
| 154 | lappend linker -install_name ${install_name} -current_version ${insl_ver} -compatibility_version ${cmpt_ver} |
| 155 | lappend linker -o ${base}.${insl_ver}.dylib *.o |
| 156 | |
| 157 | if { ${lname}=="CHOLMOD" } { |
| 158 | lappend linker -L${destroot}${prefix}/lib |
| 159 | lappend linker -lcolamd |
| 160 | lappend linker -lccolamd |
| 161 | lappend linker -lcamd |
| 162 | lappend linker -lamd |
| 163 | lappend linker -lmetis |
| 164 | lappend linker -framework Accelerate |
| 165 | } elseif { ${lname}=="KLU" } { |
| 166 | lappend linker -L${destroot}${prefix}/lib |
| 167 | lappend linker -lbtf |
| 168 | lappend linker -lamd |
| 169 | lappend linker -lcolamd |
| 170 | } elseif { ${lname}=="SPQR" } { |
| 171 | lappend linker -L${destroot}${prefix}/lib |
| 172 | lappend linker -lcholmod |
| 173 | lappend linker -framework Accelerate |
| 174 | } elseif { ${lname}=="UMFPACK" } { |
| 175 | lappend linker -L${destroot}${prefix}/lib |
| 176 | lappend linker -lamd |
| 177 | lappend linker -framework Accelerate |
| 178 | } |
| 179 | |
| 180 | system "cd ${ldir}/MacPorts_Temp && ${linker}" |
| 181 | xinstall -m 0755 ${ldir}/MacPorts_Temp/${base}.${insl_ver}.dylib ${destroot}${prefix}/lib |
| 182 | |
| 183 | ln -sf ${base}.${insl_ver}.dylib ${destroot}${prefix}/lib/${base}.dylib |
| 184 | ln -sf ${base}.${insl_ver}.dylib ${destroot}${prefix}/lib/${base}.[join [lrange [split ${insl_ver} .] 0 0] .].dylib |
| 185 | ln -sf ${base}.${insl_ver}.dylib ${destroot}${prefix}/lib/${base}.[join [lrange [split ${insl_ver} .] 0 1] .].dylib |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | xinstall -m 755 -d ${destroot}${prefix}/include/suitesparse |