Request for help with port organisation: how to install several versions of data files

Mojca Miklavec mojca at macports.org
Mon Jul 1 05:48:44 PDT 2013


(was: Geant4 - any volunteers?)

Hi,

I'm looking for ideas about how to best organise the port(s) for
Geant4 data files (see also https://trac.macports.org/ticket/32716).

Geant4 needs approximately 8 data files which currently looks like this:

set G4NDL_v             3.14
set G4EMLOW_v           6.19
set PhotonEvaporation_v 2.1
set RadioactiveDecay_v  3.3
set G4ABLA_v            3.0
set G4NEUTRONXS_v       1.0
set G4PII_v             1.2
set RealSurface_v       1.0

distfiles           geant${version}.tar.gz:cern \
                    G4NDL.${G4NDL_v}.tar.gz:cern \
                    G4EMLOW.${G4EMLOW_v}.tar.gz:cern \
                    G4PhotonEvaporation.${PhotonEvaporation_v}.tar.gz:cern \
                    G4RadioactiveDecay.${RadioactiveDecay_v}.tar.gz:cern \
                    G4ABLA.${G4ABLA_v}.tar.gz:mp \
                    G4NEUTRONXS.${G4NEUTRONXS_v}.tar.gz:cern \
                    G4PII.${G4PII_v}.tar.gz:cern \
                    RealSurface.${RealSurface_v}.tar.gz:cern

master_sites        http://geant4.cern.ch/support/source/:cern \
                    macports_distfiles:mp

checksums           geant${version}.tar.gz \
                    md5     d4e95badeb536d82278e690280633846 \
                    sha1    304d45b8c77a80965a54ca34228f5fdace4ba3fa \
                    rmd160  674bc1531b916dac99a15a015dd816d9ac01d329 \
                    G4NDL.${G4NDL_v}.tar.gz \
                    md5     b9b6869bc28c83d9160f674785a9f09f \
                    sha1    dc8b7a5fa0fcd06a85071c1b09730de6d04362d3 \
                    rmd160  8393b5e0301526ec747da133b6972c70b8c44210 \
                    G4EMLOW.${G4EMLOW_v}.tar.gz \
                    md5     c0fe7c8a59a2abde60d13e947f566718 \
                    sha1    f63e41a43a3d0c793a04dbb6cce0bdcfeedf6889 \
                    rmd160  ba67b3f1ee215966adc99661a1db4a5bf09c5511 \
                    G4PhotonEvaporation.${PhotonEvaporation_v}.tar.gz \
                    md5     d1ee8ac49515109c34ae3714c22d59dd \
                    sha1    56937f579e2134259963093ca735afc2b5a6ec5c \
                    rmd160  be5e5ef9db4b85f916017561cc2dfbc5a1b226d7 \
                    G4RadioactiveDecay.${RadioactiveDecay_v}.tar.gz \
                    md5     2a1b24863d5c5a4d165303f189c5b08e \
                    sha1    877a31ddf673729aad5b5f5892333495a1803784 \
                    rmd160  065769a13b45dd335a6c6bd3b265c6d0370dcf96 \
                    G4ABLA.${G4ABLA_v}.tar.gz \
                    md5     d2d4e99b14f7a5057f4c10d9c2d647dd \
                    sha1    5f38676f1650a508e49d35f9405ac96984388135 \
                    rmd160  5a032ee8e90d00f39b67114fe257ec47001f347b \
                    G4NEUTRONXS.${G4NEUTRONXS_v}.tar.gz \
                    rmd160  c8ddf1d50e7fdbc3d53959bb45bb84615467f96d \
                    sha256
577d28b7faa41caacb001a30384028cd5e3b7018755ab94a427ce0a7feeab365 \
                    G4PII.${G4PII_v}.tar.gz \
                    rmd160  de024c7462c8bca4ace2b21da116edbc9705ab7e \
                    sha256
ad03a22444c4020b9ee8e4ed88bf00cfd8b227b9d1e71e16b847e3075151f12c \
                    RealSurface.${RealSurface_v}.tar.gz \
                    md5     0dde95e00fcd3bcd745804f870bb6884 \
                    sha1    9b4bd95c647dc702458eeaf89ebf62c5885e2ece \
                    rmd160  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb

I would like to provide multiple versions of Geant4 simultaneously
(for example two or three versions) and as part of the process, Frank
Schima suggested separating the data files from the source code into
(a) different port(s).

Each version of Geant4 depends on a different version of data files,
so geant4 would need a runtime dependency like
    depend port:geant4-data-<name>-<version>
or in a way that allows specifying the exact version of a particular data file.

I don't know all the functionality that MacPorts could provide, but I
imagine that maybe one could write a single file similar to this
pseudo-code that could provide the desired functionality:

------------------------------------------------
PortSystem 1.0
PortGroup  geant 4.0

name geant4-data

subport G4NDL {
    set_shortname G4NDL
    set_variablename G4NEUTRONHPDATA
    # or: set_properties(G4NDL, G4NEUTRONHPDATA)
    add_version(4.3, 55493e74cba90e6cb167a5008e138cd7)
    add_version(4.1, ff018eca2c2ca3bc32a096c2d72df64f)
    ...
}

subport G4EMLOW {
    set_shortname G4EMLOW
    set_variablename G4LEDATA
    add_version(6.33, 0002a1c16c9b1fb5e8d49dfbce12a576)
    ...
}

...
------------------------------------------------

Each <name>-<version> would then fetch a single tar.gz file from the
server, check the md5 checksum (or some other sum - md5 is simply the
one provided upstream), and extract it to a place like this:

     /opt/local/share/Geant/Data/G4EMLOW6.31/
     /opt/local/share/Geant/Data/G4EMLOW6.32/
     /opt/local/share/Geant/Data/G4EMLOW6.33/
     /opt/local/share/Geant/Data/RealSurface1.0/
     ...

Below is part of the previous conversation.

I would be very grateful for some hints about the best way to deal
with this. I've never dealt with complex ports before.

Thank you,
    Mojca

PS: the previous maintainer of Geant4 doesn't seem to respond to any
questions or requests, but if any of you manages to contact him, that
would be great.

On Fri, Jun 28, 2013 at 9:38 PM, Mojca Miklavec wrote:
> On Fri, Jun 28, 2013 at 8:32 PM, Frank Schima wrote:
>> On Jun 28, 2013, at 11:22 AM, Mojca Miklavec wrote:
>>> On Fri, Jun 28, 2013 at 6:44 PM, Frank Schima wrote:
>>>
>>>> Another thought, I think that separating the data into a subport would be a good idea but I'm open to staying with the current all inclusive single port.
>>>
>>> I would really really like to see different versions installed
>>> side-by-side. Currently that would be 4.9.5p2, 4.9.6p2 and 4.10.0b1
>>> with geant4 defaulting to 4.9.6p2. In that case it would make sense to
>>> create a portgroup geant (or geant4). It would be very handy to be
>>> able to specify just
>>>    somefunction(G4NDL, 4.3, G4NDL, tar.gz, G4NEUTRONHPDATA,
>>> 55493e74cba90e6cb167a5008e138cd7)
>>> rather than
>>>
>>> set v_G4NDL             4.3
>>> ...
>>> distfiles           geant${version}.tar.gz:cern \
>>>                    G4NDL.${v_G4NDL}.tar.gz:cern \
>>> ...
>>> checksums           geant${version}.tar.gz \
>>>                    <checksums> \
>>>                    G4NDL.${G4NDL_v}.tar.gz \
>>>                    <checksums> \
>>> ...
>>>
>>> I didn't study the subports yet. It would be perfectly ok to use
>>>   depend geant4-data-G4NDL-4.3
>>> or something like this. That would also make it possible to share the
>>> same data file across different versions of Geant4 (also on the same
>>> place), but I don't know how to properly implement that. I'm not yet
>>> skilled enough. One needs approximately 8 data files. If we would keep
>>> 2-3 versions of Geant4 alive at the same moment, that would mean up to
>>> 24 packages.
>>
>> Given multiple ports of geant, we should definitely create separate data ports.
>
> OK.
>
>> The question is do we want 1 port called "geant4-data" or do we want a subport for each of the 8 datasets? Do they get updated individually or all at once?
>
> They are updated individually, but updates only matter when geant4 gets updated.
>
> A particular version of Geant4 needs to depend on a set of packages
> (name,version), so we need to:
> - be able to say
>     depend port:geant4-data-<name>-<version> (or in some similar way,
> possibly with a macro)
> - be able to install multiple versions of the same package <name>
>
> If one can cover that functionality by writing a single Portfile, that
> would be awesome, but if we need one portfile per each name & version,
> that's still fine. I would prefer having a single Portfile if that is
> possible, but I don't know how to achieve the desired functionality.
> Any help would be welcome.


More information about the macports-dev mailing list