Geant4 - outdated and not maintained

Ryan Schmidt ryandesign at macports.org
Fri Nov 2 04:53:57 PDT 2012


On Oct 31, 2012, at 17:58, Mojca Miklavec wrote:

> If nothing else, I would need some help with "subports" for different
> versions (in case that would make sense).

Sub-ports could be useful if the only difference between versions is the version number and checksums. But if the build system changes significantly from version to version then it may be more trouble than it's worth.

But if you wanted to use sub-ports, then you might have a port geant4 which is a meta port (i.e. a port that doesn't install any files of its own (except for a readme, since all ports must install at least one file)) and depends on a recommended version of geant4, let's say 4.9.5.


# $Id$

name                    geant4
categories              ...
platforms               ...
maintainers             ...
license                 ...

description             ...

long_description        ...

homepage                ...
master_sites            ...

if {${name} == ${subport}} {
    version             4
    supported_archs     noarch
    distfiles
    
    depends_run         port:geant495
    
    build {}
    
    destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        system "echo ${name} is a meta port > ${destroot}${docdir}/README"
    }
    
    livecheck.type      ...
} else {
    livecheck.type      none
}


Then you could declare sub-ports for each version:


subport geant494 {
    version             4.9.4
    checksums           rmd160  xxx \
                        sha256  xxx
}

subport geant495 {
    version             4.9.5
    checksums           rmd160  xxx \
                        sha256  xxx
}


And for any options common to the sub-ports (but that should not be used in the main (meta) port), you would enclose them in a block like this:


if {${name} != ${subport}} {
    configure.args      --whatever
}


This block often goes above the subport blocks, so that in the subport blocks you can append to or delete from the defaults.

For configure.args and other variables it probably doesn't matter if you declare them in the main part of the portfile, but for pre- and post-phase blocks they usually must be in the {${name} != ${subport}} block or they would prevent the meta-port from being installed.



More information about the macports-dev mailing list