[email protected] writes: > On Jan 2, 2014, at 16:24, [email protected] wrote: > >> Revision >> 115467 >> Author >> [email protected] >> Date >> 2014-01-02 14:24:41 -0800 (Thu, 02 Jan 2014) >> Log Message >> >> ufc: add new port for finite element assembly >> Added Paths >> >> • trunk/dports/math/ufc/ >> • trunk/dports/math/ufc/Portfile >> Diff >> >> Added: trunk/dports/math/ufc/Portfile (0 => 115467) > > >> +set pythons_suffixes {25 26 27 31 32} >> + >> +set pythons_ports {} >> +foreach s ${pythons_suffixes} { >> + lappend pythons_ports python${s} >> +} >> + >> +proc python_dir {} { >> + global pythons_suffixes >> + foreach s ${pythons_suffixes} { >> + if {[variant_isset python${s}]} { >> + set p python[string index ${s} 0].[string index ${s} 1] >> + return [file normalize [exec ${p} -c "import sys; >> print(sys.prefix)"]/lib/${p}/site-packages] >> + } >> + } >> + error "Python support not enabled." >> +} >> + >> +foreach s ${pythons_suffixes} { >> + set p python${s} >> + set v [string index ${s} 0].[string index ${s} 1] >> + set i [lsearch -exact ${pythons_ports} ${p}] >> + set c [lreplace ${pythons_ports} ${i} ${i}] >> + eval [subst { >> + variant ${p} description "Build UFC for Python ${v}" conflicts ${c} >> { >> + >> + post-destroot { >> + xinstall -d >> ${destroot}${frameworks_dir}/Python.framework/Versions/${v} >> + move ${destroot}${prefix}/lib >> ${destroot}${frameworks_dir}/Python.framework/Versions/${v}/lib >> + xinstall -d ${destroot}${prefix}/lib >> + move >> ${destroot}${frameworks_dir}/Python.framework/Versions/${v}/lib/pkgconfig >> ${destroot}${prefix}/lib/pkgconfig >> + } >> + >> + } >> + }] >> +} >> + >> +default_variants +python27 > > python27 should only be a default variant if the user has not already > requested a different conflicting variant. Otherwise: > > $ sudo port install ufc +python26 > Error: ufc: Variant python26 conflicts with python27 > Error: Unable to open port: Error evaluating variants > > > https://trac.macports.org/wiki/PortfileRecipes#default_variants
Oops, bad copy+paste on my part. Should be fixed now. _______________________________________________ macports-dev mailing list [email protected] https://lists.macosforge.org/mailman/listinfo/macports-dev
