Gate & Geant4: how to pass the variables from one port to the other

Mojca Miklavec mojca at macports.org
Sat Jul 6 17:25:50 PDT 2013


Hello,

A few more questions are popping up in my head during the development
of a Portfile for Geant4 & Gate.

The first one is the following: Let's say that Gate can depend either
on Geant4 9.5 or on 9.6 and that I decide to provide two port
variants, geant495 and geant496.

In case of dependence on 9.6 I need to provide the following:

variant geant496 conflicts geant495 description {Use Geant4 9.6} {
    depends_lib port:geant4.9.6
    configure.args-append
-DGeant4_DIR=${prefix}/lib/Geant4/Geant4.9.6/Geant4-9.6.2
    # 9.6.2 stands for "version 9.6, patch 2"
}

If/when patch 3 for Geant4 9.6 comes out, the second argument would
need to change into
    configure.args-append
-DGeant4_DIR=${prefix}/lib/Geant4/Geant4.9.6/Geant4-9.6.3
and Gate would need to be rebuilt anyway.

In case of dependence on 9.5, I would need:

variant geant495 conflicts geant496 description {Use Geant4 9.5} {
   depends_lib port:geant4.9.5
    configure.args-append
-DGeant4_DIR=${prefix}/lib/Geant4/Geant4.9.5/Geant4-9.5.2
}

Even though I can hardcode the value of Geant4_DIR in Gate, it is
probably cleaner/safer if the value would come from the Geant4
PortGroup, but then again I'm not sure how to handle the version
numbers. (The value comes from
-DCMAKE_INSTALL_LIBDIR=lib/Geant4/Geant${simpleversion} in the Geant4
port - simpleversion is set to "4.9.6" in the Geant's Portfile and
"Geant4-9.6.2" is added automatically by the installation scripts.)


What solution would you suggest for this? Supporting two versions of
Geant4 for Gate is not really required, but I still need to get the
variable for Geant4_DIR from somewhere (unless it's ok to hardcode
that value.)

Thank you,
    Mojca


More information about the macports-dev mailing list