Portfile for GEANT4

Joshua Root jmr at macports.org
Wed Jan 13 12:49:57 PST 2010


On 2010-1-14 06:48 , Cristiano Fontana wrote:
> Hello,
> I am having problems writing a Portfile of GEANT4. Since these are my first Portfiles, I am not an expert so I need some help.
> 
> GEANT4 is a toolkit for simulating the interaction of radiation through matter.
> It is one of the most important piece of software for Particle Physicist because it is a very complex tool that can simulate about anything.
> Unfortunately it has a weird configure script that aconfigures, builds and install everything. So to install it is not just a standard configure; make; make install (why the heck do not they use standard tools?!).
> I spent the last days working on this without any success and I am getting a little bit frustrated.
> 
> What I am trying is to execute their configure script through port so I defined the following phases:
> 
> build {
>     catch { exec /bin/sh -c "cd ${worksrcpath}; ${worksrcpath}/Configure -build -d -f ${worksrcpath}/config.sh" }
> }
> 
> destroot {
>     catch { exec /bin/sh -c "cd ${worksrcpath}; ${worksrcpath}/Configure -install" }
> }

You should use the 'system' procedure to run shell commands. Like so:

build {
    system "cd ${worksrcpath} && ./Configure -build -d -f config.sh"
}

destroot {
    system "cd ${worksrcpath} && ./Configure -install" }
}

You could also achieve the same effect by setting build.cmd, build.args,
build.target, etc. as needed, but this is so different to a standard
autotools build that that is probably the messier route.

- Josh


More information about the macports-dev mailing list