[115467] trunk/dports/math

Ryan Schmidt ryandesign at macports.org
Thu Jan 2 20:59:33 PST 2014


On Jan 2, 2014, at 16:24, sean at macports.org wrote:

> Revision
> 115467
> Author
> sean at macports.org
> 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



More information about the macports-dev mailing list