Ryan Schmidt ryandesign at
Fri Dec 28 15:26:30 PST 2012

On Dec 28, 2012, at 15:40, Vincent Habchi wrote:

>> Right, so I was thinking you could do something like:
>> variant qt4 {
>>   require_active_variants gmsh {qt4} {}
>>   ...
>> }
>> if {![variant_isset qt4]} {
>>   require_active_variants gmsh {} {qt4}
>> }
> But that would mean that the user would have to respecify manually all gmsh variants he/she already chose. I had in mind that the pyXX-gmsh port would be smart enough to select automatically the proper variants to make the bindings work with the installed version of gmsh…

You should at least provide variants to handle all possible ways in which the gmsh python bindings could be built.

If you don't do that, and you just make the port build differently based on the variants of gmsh that are installed, you will run into problems like this: gmsh does not have a qt4 variant but I presume you are planning on adding one. Let us assume qt4 is not a default_variant. Therefore the buildbot only builds gmsh without qt4 support. Assume the user installs gmsh with the qt4 variant. It build from source on his machine because no binary with that variant was built by the buildbot. Assume the user now installs the python bindings port. The user wants the bindings to support qt4, but the user receives a binary from the buildbot which was built without qt4 support.

Additionally, if you wish, you can go the extra mile and make the gmsh python bindings port auto-select its variant(s) based on the variant(s) of the installed gmsh port. But that would be secondary to making sure the bindings port has all the needed variants.

More information about the macports-dev mailing list