source: trunk/dports/science/geant4/Portfile

Last change on this file was 151274, checked in by mojca@…, 16 months ago

geant4: comment out the preliminary geant4.10.3 port

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 28.6 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 151274 2016-08-11 13:58:03Z ryandesign@macports.org $
3
4# Keep in sync with Gate (and/or implement a PortGroup)
5
6PortSystem          1.0
7PortGroup           cmake 1.0
8PortGroup           select 1.0
9
10name                geant4
11version             4.10.2
12categories          science
13maintainers         mojca openmaintainer
14license             Restrictive/Distributable
15#                   http://geant4.web.cern.ch/geant4/license/LICENSE.html
16description         Geant4 is a toolkit for the simulation of the passage of particles through matter.
17long_description    Geant4 is a toolkit for the simulation of the passage of particles through matter. \
18                    Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science. \
19                    The two main reference papers for Geant4 are published in Nuclear Instruments and Methods in Physics Research A 506 (2003) 250-303, \
20                    and IEEE Transactions on Nuclear Science 53 No. 1 (2006) 270-278.
21homepage            http://geant4.web.cern.ch/
22platforms           darwin
23
24master_sites        http://geant4.cern.ch/support/source/
25
26# meaning of the fields:
27# - version
28# - revision (used internally in MacPorts to force updates)
29# - revision of data files (used internally in MacPorts to force updates)
30# - patchlevel (also used in directory names)
31# - version string (used for fetching the source)
32#
33# if we start distributing betas, epoch will have to be added for the transition from version 4.x.y.b01 to 4.x.y
34set geant.versions_info {
35     9.6  1  0  4  4.9.6.p04    3dd8f6ac2e79929d26519e83fce113691a670788  997220a5386a43ac8f533fc7d5a8360aa1fd6338244d17deeaa583fb3a0f39fd
36    10.0  1  0  4  4.10.00.p04  bfd11977b55f316f5c38d82f09dc37e7c0f60ea7  f4e1fc6d5ea4d9761ba44fd7e50921ff6276e25c2f640c7615460235d8c77d74
37    10.1  0  0  3  4.10.01.p03  0b141adfceb4203f4855e0c6fb0d4c17036776ca  b198943b5bc4fd7968ef4eaa5bbe2fb094b8df1d907a05486dc05f4c92bbb174
38    10.2  0  1  2  4.10.02.p02  f4f84e4e0b5f4406ee3f577fde07f2e240014322  702fb0f7a78d4bdf1e3f14508de26e4db5e2df6a21a8066a92b7e6ce21f4eb2d
39}
40#   10.3  0  0  0  4.10.03.b01  74b5944fe50ace8650c28862967158e838ca1d6c  e1cca99d329cfca2b6f6cc7c3489fa0474b8e03462833239f4460bde58bd2e7a
41
42#   NAME               VERS  FILENAME             ENVVAR             md5                               rmd160                                    sha256
43set geant.data_versions_10.3 {
44    G4NDL              4.5   G4NDL                G4NEUTRONHPDATA    fd29c45fe2de432f1f67232707b654c0  5c03cd810e590e48bae8b52e44e0ba218fcfc5ec  cba928a520a788f2bc8229c7ef57f83d0934bb0c6a18c31ef05ef4865edcdf8e
45    G4EMLOW            6.48  G4EMLOW              G4LEDATA           844064faa16a063a6a08406dc7895b68  13ef27c1a45cd908ccd7f9d76b9bd6d35681ef80  9815be88cbbcc4e8855b20244d586552a8b1819b8bf4e538c342b27c17dff1c7
46    PhotonEvaporation  3.2   G4PhotonEvaporation  G4LEVELGAMMADATA   01d5ba17f615d3def01f7c0c6b19bd69  6bfe26eae2bba76d48509d4f15ea95a6e216972a  35ed450a47aa610ce83c9095e17e43006e0da9557bf4433ac96ce19c730492d4
47    RadioactiveDecay   4.4.1 G4RadioactiveDecay   G4RADIOACTIVEDATA  0aa6c879c17b26f1ca85d3ac915fc30e  1346b5117bd1c201ed7f1f4e4b238d95dcc59f02  cd4a0bb6f5be563ffc08ab596b861687701e56c1507eb7cccf23d521cf336755
48    G4NEUTRONXS        1.4   G4NEUTRONXS          G4NEUTRONXSDATA    665a12771267e3b31a08c622ba1238a7  41278460f9c4a720f2b9e47dee878b9ec289ebd1  57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd
49    G4PII              1.3   G4PII                G4PIIDATA          05f2471dbcdf1a2b17cbff84e8e83b37  313a2615903b0682b8aabc344bedde82c345704b  6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926
50    RealSurface        1.0   RealSurface          G4REALSURFACEDATA  0dde95e00fcd3bcd745804f870bb6884  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb  3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1
51    G4SAIDDATA         1.1   G4SAIDDATA           G4SAIDXSDATA       d88a31218fdf28455e5c5a3609f7216f  7f0c75c86eea3d227379d3dfe77e4600752f99a2  a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f
52    G4ABLA             3.0   G4ABLA               G4ABLADATA         d7049166ef74a592cb97df0ed4b757bd  656b10fc9d8022e89e99a728576d0b502161aa69  99fd4dcc9b4949778f14ed8364088e45fa4ff3148b3ea36f9f3103241d277014
53    G4ENSDFSTATE       1.3.1 G4ENSDFSTATE         G4ENSDFSTATEDATA   eddd153110184256a57ce6b753f0d527  f20a683acb2d9d902f6996adf47cf0fbdb63b17d  657c502a81f894382e6b08caaf7120a988a4e3f2dc8aaadbb604f91b053b5baf
54}
55# optional
56#   G4TENDL?           1.2   G4TENDL              G4TENDL?           8ba198ed5ef345f86c20cc657a1543bb  94a4b3f5f5c4ab7708a2a4ab5cf9272c4d42f82f  7b400807ae2e7e878a0536de3738e4454afd2a57e2f31188cd3e180442810ad8
57
58set geant.data_versions_10.2 {
59    G4NDL              4.5   G4NDL                G4NEUTRONHPDATA    fd29c45fe2de432f1f67232707b654c0  5c03cd810e590e48bae8b52e44e0ba218fcfc5ec  cba928a520a788f2bc8229c7ef57f83d0934bb0c6a18c31ef05ef4865edcdf8e
60    G4EMLOW            6.48  G4EMLOW              G4LEDATA           844064faa16a063a6a08406dc7895b68  13ef27c1a45cd908ccd7f9d76b9bd6d35681ef80  9815be88cbbcc4e8855b20244d586552a8b1819b8bf4e538c342b27c17dff1c7
61    PhotonEvaporation  3.2   G4PhotonEvaporation  G4LEVELGAMMADATA   01d5ba17f615d3def01f7c0c6b19bd69  6bfe26eae2bba76d48509d4f15ea95a6e216972a  35ed450a47aa610ce83c9095e17e43006e0da9557bf4433ac96ce19c730492d4
62    RadioactiveDecay   4.3.2 G4RadioactiveDecay   G4RADIOACTIVEDATA  ed171641682cf8c10fc3f0266c8d482e  6c3123d57765d792605e88885f4fa6375632bc4c  43b558891f02b1f4796b913b89be607827995043cb678275c06a85e03b5b5c18
63    G4NEUTRONXS        1.4   G4NEUTRONXS          G4NEUTRONXSDATA    665a12771267e3b31a08c622ba1238a7  41278460f9c4a720f2b9e47dee878b9ec289ebd1  57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd
64    G4PII              1.3   G4PII                G4PIIDATA          05f2471dbcdf1a2b17cbff84e8e83b37  313a2615903b0682b8aabc344bedde82c345704b  6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926
65    RealSurface        1.0   RealSurface          G4REALSURFACEDATA  0dde95e00fcd3bcd745804f870bb6884  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb  3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1
66    G4SAIDDATA         1.1   G4SAIDDATA           G4SAIDXSDATA       d88a31218fdf28455e5c5a3609f7216f  7f0c75c86eea3d227379d3dfe77e4600752f99a2  a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f
67    G4ABLA             3.0   G4ABLA               G4ABLADATA         d7049166ef74a592cb97df0ed4b757bd  656b10fc9d8022e89e99a728576d0b502161aa69  99fd4dcc9b4949778f14ed8364088e45fa4ff3148b3ea36f9f3103241d277014
68    G4ENSDFSTATE       1.2.3 G4ENSDFSTATE         G4ENSDFSTATEDATA   98fef898ea35df4010920ad7ad88f20b  04c0f845946eb52c8b8505fa2e06f6729ed2479f  15fb26d08a24f620f21566b5cddb7e07f0b06140899b03932d6cf76925130b75
69}
70# optional
71#   G4TENDL?           1.0   G4TENDL              G4TENDL?           bd6f381f995e1bf570c0b7cef3e40a78  88c97495862c24cf661828aaee4583fd768eb4eb  81ab22cb51f804f5c57a528e3ac3d15f0230a48b53c4443f0ddea833a4c4eb1d
72
73set geant.data_versions_10.1 {
74    G4NDL              4.5   G4NDL                G4NEUTRONHPDATA    fd29c45fe2de432f1f67232707b654c0  5c03cd810e590e48bae8b52e44e0ba218fcfc5ec  cba928a520a788f2bc8229c7ef57f83d0934bb0c6a18c31ef05ef4865edcdf8e
75    G4EMLOW            6.41  G4EMLOW              G4LEDATA           b9b2e455d08375ca9cc5201236db6d7d  f61578e1867c52626302c55d92cf7eaae5d282d4  6d878b18bf5e748e9d0ea35ef67eebab16df80cc912402986a03a5e1935f4af2
76    PhotonEvaporation  3.1   G4PhotonEvaporation  G4LEVELGAMMADATA   e7870c5ef18ba702e68c22b62233cbb8  9d287e92aa1943ffe736f9e91a678667650eb760  276ac5f7b45ce96ae0927c7a3fff0942b7007cfe9339540fc22554fea433142e
77    RadioactiveDecay   4.2   G4RadioactiveDecay   G4RADIOACTIVEDATA  2eade8116387ef67d4cd6f14b9cb1512  b1b7b0377223e6ad54aa100646053e493fcec8d5  cf1946d9e2c222ec1311e7ed94a54a6646cf519b71299e2297a6be3c85ba3c82
78    G4NEUTRONXS        1.4   G4NEUTRONXS          G4NEUTRONXSDATA    665a12771267e3b31a08c622ba1238a7  41278460f9c4a720f2b9e47dee878b9ec289ebd1  57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd
79    G4PII              1.3   G4PII                G4PIIDATA          05f2471dbcdf1a2b17cbff84e8e83b37  313a2615903b0682b8aabc344bedde82c345704b  6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926
80    RealSurface        1.0   RealSurface          G4REALSURFACEDATA  0dde95e00fcd3bcd745804f870bb6884  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb  3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1
81    G4SAIDDATA         1.1   G4SAIDDATA           G4SAIDXSDATA       d88a31218fdf28455e5c5a3609f7216f  7f0c75c86eea3d227379d3dfe77e4600752f99a2  a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f
82    G4ABLA             3.0   G4ABLA               G4ABLADATA         d7049166ef74a592cb97df0ed4b757bd  656b10fc9d8022e89e99a728576d0b502161aa69  99fd4dcc9b4949778f14ed8364088e45fa4ff3148b3ea36f9f3103241d277014
83    G4ENSDFSTATE       1.0   G4ENSDFSTATE         G4ENSDFSTATEDATA   0c153d96c74e3856288b450436a5e4db  e643d1ef8bbcfaedb6108b889e3c2cc9a05a673e  4562e7476aa2df7204a1a77263e9d2331e9ffcdb591d11814dcc2d6b605021dd
84}
85set geant.data_versions_10.0 {
86    G4NDL              4.4   G4NDL                G4NEUTRONHPDATA    cd8cc1d96aeb9b9ed37189edda26f5ad  8ba64e2f71ccaef278450d292239b889daae72fb  e9fe8800566a83ccaf9b5229a1fa1d2cd24530bbd2e9fcb96eb6b5b117233071
87    G4EMLOW            6.35  G4EMLOW              G4LEDATA           3345d693b012c80f3e7e4432ae9884a0  1f0310afff7d6429ad054185dda233a9f469356d  1564045a0acad344c8d432cd48c2c3bb2e051a81ab3099a84e0f56ba0fe82cec
88    PhotonEvaporation  3.0   G4PhotonEvaporation  G4LEVELGAMMADATA   f72d6d694f608fe10cc2126a0ac1f2a6  2502330f6e654e926eb8a0007725651644d25e95  c76a843672eca21110e97a274a6b5cd9a58b66f35235301c8e1b162926e0e7cb
89    RadioactiveDecay   4.0   G4RadioactiveDecay   G4RADIOACTIVEDATA  44a43b8f62c9f9cd4c3cb31c2b2bb7c3  cae534121a147fbd94979c1a3109e0ed130df580  ed2053bddee507920a29a27db4364fbef255b951597686b0410d5458e9b38cb5
90    G4NEUTRONXS        1.4   G4NEUTRONXS          G4NEUTRONXSDATA    665a12771267e3b31a08c622ba1238a7  41278460f9c4a720f2b9e47dee878b9ec289ebd1  57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd
91    G4PII              1.3   G4PII                G4PIIDATA          05f2471dbcdf1a2b17cbff84e8e83b37  313a2615903b0682b8aabc344bedde82c345704b  6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926
92    RealSurface        1.0   RealSurface          G4REALSURFACEDATA  0dde95e00fcd3bcd745804f870bb6884  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb  3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1
93    G4SAIDDATA         1.1   G4SAIDDATA           G4SAIDXSDATA       d88a31218fdf28455e5c5a3609f7216f  7f0c75c86eea3d227379d3dfe77e4600752f99a2  a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f
94    G4ABLA             3.0   G4ABLA               G4ABLADATA         d7049166ef74a592cb97df0ed4b757bd  656b10fc9d8022e89e99a728576d0b502161aa69  99fd4dcc9b4949778f14ed8364088e45fa4ff3148b3ea36f9f3103241d277014
95    G4ENSDFSTATE       1.0   G4ENSDFSTATE         G4ENSDFSTATEDATA   0c153d96c74e3856288b450436a5e4db  e643d1ef8bbcfaedb6108b889e3c2cc9a05a673e  4562e7476aa2df7204a1a77263e9d2331e9ffcdb591d11814dcc2d6b605021dd
96}
97set geant.data_versions_9.6 {
98    G4NDL              4.2   G4NDL                G4NEUTRONHPDATA    2302d7ffeef1a450955302f027ee1cf4  5289896235ccb84f551f642447372f286084a695  173f60a506b9176d7ff531d6a5f6195dcec74df30ffafc09644f47f979bd641b
99    G4EMLOW            6.32  G4EMLOW              G4LEDATA           9d3302072ba694b1d4505c330ed89d89  d5b1c435fb4925339175188472f1453637c98b0d  bdb3c00af89b18c21553d79fd823110429fdcf1e83c029aa450185d9caf4a7cf
100    PhotonEvaporation  2.3   G4PhotonEvaporation  G4LEVELGAMMADATA   08848ebdd536280a0629d802040b70be  8cd383005f5f8c38f69e4818cf5b1ad397925abc  60449df933794aa0ad3938886c8c023e3093ff59ad6c752923390d5c550f34cb
101    RadioactiveDecay   3.6   G4RadioactiveDecay   G4RADIOACTIVEDATA  9566ff1614bea7455343328cb66abd6f  1ed4a9707a18720d9a649fd4a7ca97faf24434b9  3502ed4be04d694115a3acf59d7a3593725a2d79f3adad0ffa135ff653f89d1d
102    G4NEUTRONXS        1.2   G4NEUTRONXS          G4NEUTRONXSDATA    092634b9258c7bc387cb83557ff1df81  5ebf3b9006a9c6249cad8e40e9661fbe3ec50f0e  9ce488505b4c3623e2d98209f708a30e3f213a1371a9110d289257a02b2d7d5c
103    G4PII              1.3   G4PII                G4PIIDATA          05f2471dbcdf1a2b17cbff84e8e83b37  313a2615903b0682b8aabc344bedde82c345704b  6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926
104    RealSurface        1.0   RealSurface          G4REALSURFACEDATA  0dde95e00fcd3bcd745804f870bb6884  030513fe340e0cccbfe0b9ae9acb3ba6b5291ebb  3e2d2506600d2780ed903f1f2681962e208039329347c58ba1916740679020b1
105    G4SAIDDATA         1.1   G4SAIDDATA           G4SAIDXSDATA       d88a31218fdf28455e5c5a3609f7216f  7f0c75c86eea3d227379d3dfe77e4600752f99a2  a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f
106}
107
108foreach {geant.version geant.revision geant.datarevision geant.patchlevel geant.version_full geant.rmd160 geant.sha256} ${geant.versions_info} {
109
110    # this variable could/should come from a PortGroup one day
111    # note that gmk files go to share/Geant4/Geant4-${geant.version}.${geant.patchlevel}
112    set geant.datadir_x ${prefix}/share/Geant4/Data/Geant4.${geant.version}
113    # or perhaps share/Geant4/Geant${geant.version_simple}/Data
114
115    subport ${name}.${geant.version}-data {
116        set                 geant.version_simple 4.${geant.version}
117        set                 geant.datadir ${geant.datadir_x}
118        version             ${geant.version_simple}
119        revision            ${geant.datarevision}
120        supported_archs     noarch
121        description         Data files for Geant${version}
122        long_description    ${description}
123
124
125        # TODO: use an array (hash) to implement this without if-else
126        if {${geant.version} == "10.3" } {
127            set geant.data_versions     ${geant.data_versions_10.3}
128        }
129        if {${geant.version} == "10.2" } {
130            set geant.data_versions     ${geant.data_versions_10.2}
131        }
132        if {${geant.version} == "10.1" } {
133            set geant.data_versions     ${geant.data_versions_10.1}
134        }
135        if {${geant.version} == "10.0" } {
136            set geant.data_versions     ${geant.data_versions_10.0}
137        }
138        if {${geant.version} == "9.6" } {
139            set geant.data_versions     ${geant.data_versions_9.6}
140        }
141        # make the distfiles list empty
142        distfiles
143        foreach {data.name data.version data.filename data.envvariable data.md5 data.rmd160 data.sha256} ${geant.data_versions} {
144            set filename ${data.filename}.${data.version}${extract.suffix}
145            # http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1849
146            # https://trac.macports.org/ticket/51603
147            # if {${geant.version} == "10.2" } {
148            #     if {${data.filename} == "G4RadioactiveDecay"} {
149            #         set filename ${data.filename}.4.4${extract.suffix}
150            #     } elseif {${data.filename} == "G4ENSDFSTATE"} {
151            #         set filename ${data.filename}.1.2.2${extract.suffix}
152            #     }
153            # }
154            distfiles-append ${filename}
155            checksums-append ${filename} md5 ${data.md5} rmd160 ${data.rmd160} sha256 ${data.sha256}
156        }
157        post-extract {
158            # only necessary for G4EMLOW 6.32
159            # but G4NEUTRONXS 1.1, 1.2, 1.3 and PhotonEvaporation 2.2 also have some weird permissions
160            system "find ${workpath} -type f -exec chmod 644 {} \\;"
161            # http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1849
162            # https://trac.macports.org/ticket/51603
163            # if {${geant.version} == "10.2" } {
164            #     move ${workpath}/RadioactiveDecay4.4 ${workpath}/RadioactiveDecay4.3.1
165            # }
166        }
167        use_configure no
168        build {}
169
170        destroot {
171            xinstall -m 755 -d ${destroot}${geant.datadir}
172            # create a script to initialize environmental variables for locating the data files & move data files to destination
173            #
174            # TODO: maybe a better name or a better location, possibly including version
175            # the filename of this file should probably come frome the portgroup
176            # one option is also to install this as part of geant4 core installation
177            xinstall -m 755 -d ${destroot}${prefix}/libexec/Geant4/Geant${geant.version_simple}
178            set filename ${destroot}${prefix}/libexec/Geant4/Geant${geant.version_simple}/geant4data
179            system "echo #!/bin/sh  > ${filename}.sh"
180            system "echo #!/bin/csh > ${filename}.csh"
181            system "echo export G4DATADIR=\\\"${geant.datadir}\\\" >> ${filename}.sh"
182            system "echo setenv G4DATADIR=\\\"${geant.datadir}\\\" >> ${filename}.csh"
183            foreach {data.name data.version data.filename data.envvariable data.md5 data.rmd160 data.sha256} ${geant.data_versions} {
184                # move data files to destination
185                move ${workpath}/${data.name}${data.version} ${destroot}${geant.datadir}
186                # add environmental variable to locate it
187                system "echo export ${data.envvariable}=\\\"\\\$G4DATADIR/${data.name}${data.version}\\\" >> ${filename}.sh"
188                system "echo setenv ${data.envvariable} \\\"\\\$G4DATADIR/${data.name}${data.version}\\\" >> ${filename}.csh"
189            }
190        }
191        livecheck.type  none
192    }
193
194    subport ${name}.${geant.version} {
195        set                 geant.version_simple 4.${geant.version}
196        set                 geant.distfilename   geant${geant.version_full}${extract.suffix}
197        set                 geant.datadir        ${geant.datadir_x}
198        # x -> x.p01 -> x.p02 works properly, but the beta x.b01 would come after x and would need an increase in epoch
199        version             ${geant.version_full}
200        revision            ${geant.revision}
201        distfiles           ${geant.distfilename}
202        checksums           ${geant.distfilename} rmd160 ${geant.rmd160} sha256 ${geant.sha256}
203
204        cmake.out_of_source yes
205        worksrcdir          geant${version}
206
207        # check if these are all the dependencies
208        depends_lib         port:${subport}-data \
209                            port:expat \
210                            port:zlib
211        depends_run         port:geant4_select
212
213        select.group        geant4
214        select.file         ${filespath}/${subport}
215
216        configure.args-append -DGEANT4_USE_SYSTEM_EXPAT=ON \
217                              -DGEANT4_USE_SYSTEM_CLHEP=OFF
218
219        # - patch-upstream-source-interfaces-common-src-G4Qt.cc:
220        #       http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1487
221        # - patch-upstream-examples-advanced-xray_fluorescence:
222        #       http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1501
223        # - patch-cmake-Modules-Geant4InterfaceOptions.cmake:
224        #       prevents linking against X11 in /usr (maybe less aggressive patch would also work)
225        # - patch-cmake-Modules-Geant4BuildProjectConfig.cmake:
226        #       allows placing *.cmake files to a different location than LIBDIR
227        if {${geant.version} == "10.3"} {
228#           PortGroup       cxx11 1.0
229            PortGroup       compiler_blacklist_versions 1.0
230            configure.cxx_stdlib libc++
231            # a bit of a guesswork (the list was not really tested)
232            compiler.blacklist-append *gcc* {clang < 500} macports-clang-3.3
233            compiler.fallback-append macports-clang-3.7 macports-clang-3.6 macports-clang-3.5
234            patchfiles      patch-cmake-Modules-Geant4InterfaceOptions.cmake.4102.diff \
235                            patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4102.diff
236        }
237        if {${geant.version} == "10.2"} {
238#           PortGroup       cxx11 1.0
239            PortGroup       compiler_blacklist_versions 1.0
240            configure.cxx_stdlib libc++
241            # a bit of a guesswork (the list was not really tested)
242            compiler.blacklist-append *gcc* {clang < 500} macports-clang-3.3
243            compiler.fallback-append macports-clang-3.7 macports-clang-3.6 macports-clang-3.5
244            patchfiles      patch-cmake-Modules-Geant4InterfaceOptions.cmake.4102.diff \
245                            patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4102.diff
246        }
247        if {${geant.version} == "10.1"} {
248            patchfiles      patch-cmake-Modules-Geant4InterfaceOptions.cmake.4101.diff \
249                            patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4101.diff
250        }
251        if {${geant.version} == "10.0"} {
252            patchfiles      patch-cmake-Modules-Geant4InterfaceOptions.cmake.4100.diff \
253                            patch-cmake-Modules-Geant4BuildProjectConfig.cmake.4100.diff
254        }
255        if {${geant.version} == "9.6"} {
256            patchfiles      patch-upstream-qt.496.diff \
257                            patch-upstream-examples-advanced-xray_fluorescence.diff \
258                            patch-cmake-Modules-Geant4InterfaceOptions.cmake.496.diff \
259                            patch-cmake-Modules-Geant4BuildProjectConfig.cmake.496.diff
260        }
261
262        post-patch {
263             reinplace "s|@PREFIX@|${prefix}|" ${worksrcpath}/cmake/Modules/Geant4InterfaceOptions.cmake
264        }
265        # arguments to -DCMAKE_INSTALL_* could be written without ${prefix}
266        # however the ${prefix} triggers the NON_RELOCATABLE flag which has some advantages like less cryptic path names
267        configure.args-delete -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
268                              -DCMAKE_INSTALL_RPATH=${prefix}/lib
269                            # -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
270        configure.args-append -DGEANT4_INSTALL_DATA=OFF \
271                              -DCMAKE_INSTALL_BINDIR=${prefix}/libexec/Geant4/Geant${geant.version_simple} \
272                              -DCMAKE_INSTALL_DATAROOTDIR=${prefix}/share/Geant4 \
273                              -DCMAKE_INSTALL_INCLUDEDIR=${prefix}/include/Geant4/Geant${geant.version_simple} \
274                              -DCMAKE_INSTALL_LIBDIR=${prefix}/lib/Geant4/Geant${geant.version_simple} \
275                              -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/Geant4/Geant${geant.version_simple} \
276                              -DCMAKE_INSTALL_RPATH=${prefix}/lib/Geant4/Geant${geant.version_simple}
277
278        if {${geant.version} != "9.5"} {
279            configure.args-append -DGEANT4_INSTALL_DATADIR=${geant.datadir} \
280        }
281
282        # this is only needed when +examples is used
283        post-destroot {
284            # two examples with some broken links
285            foreach example {exampleP01 exampleP02 readHits} {
286                if [file exists ${destroot}${prefix}/bin/${example}] {
287                    delete ${destroot}${prefix}/bin/${example}
288                }
289            }
290            # there is no option to build/install the examples elsewhere, so we move them to libexec (they have nothing to do in bin)
291            if [file exists ${destroot}${prefix}/bin] {
292                move ${destroot}${prefix}/bin ${destroot}${prefix}/libexec/Geant4/Geant${geant.version_simple}/examples
293            }
294        }
295        notes-append "
296NOTE: Use 'sudo port select geant4 ${subport}'
297      if you need geant4-config or geant4.(c)sh in PATH.
298      Otherwise source ${prefix}/libexec/Geant4/Geant${geant.version_simple}/geant4.(c)sh
299"
300
301        variant qt conflicts qt5 description {Build with Qt 4 support} {
302            PortGroup qt4         1.0
303            configure.args-append -DGEANT4_USE_QT=ON
304        }
305        # TODO: figure out which versions of Geant4 are compatible with Qt 5
306        variant qt5 conflicts qt description {Build with Qt 5 support} {
307            PortGroup qt5         1.0
308            configure.args-append -DGEANT4_USE_QT=ON
309        }
310
311        # From installation notes:
312        #
313        # It is recommended that Windows and Mac users prefer the Geant4 Qt4 GUI. Note
314        # also that on Mac you can only pick Qt4 OR X11/Motif interfaces. This is due
315        # to incompatibilities between Apple's native OpenGL Framework and the OpenGL
316        # supplied with X11 on this platform.
317        #
318        # (The variants opengl_x11/motif_x11 actually end up linking both against mesa's OpenGL
319        # and system's OpenGL libraries which seems like a problem on its own.)
320
321        # or simply x11? The option name in geant4-config is opengl-x11
322        variant opengl_x11 description {Build with X11 visualisation drivers} {
323        #   configure.args-delete -DGEANT4_USE_OPENGL_X11=OFF
324            configure.args-append -DGEANT4_USE_OPENGL_X11=ON
325        }
326        ## This could belong to x11 (opengl_x11 & motif_x11 combined into a single option), but see also the comment above
327        ## previous name (geant4 9.4): motif; name in geant4-config: motif
328        variant motif_x11 description {Build with Motif (X11) user interface and visualization driver} {
329            depends_lib-append    port:openmotif
330        #   configure.args-delete -DGEANT4_USE_XM=OFF
331            configure.args-append -DGEANT4_USE_XM=ON
332        }
333        ## previous name (geant4 9.4): raytracerx; name in geant4-config: raytracer-x11
334        variant raytracer_x11 description {Build with Raytracer (X11) visualization driver} {
335        #   configure.args-delete -DGEANT4_USE_RAYTRACER_X11=OFF
336            configure.args-append -DGEANT4_USE_RAYTRACER_X11=ON
337        }
338        if {[variant_isset opengl_x11] || [variant_isset motif_x11]} {
339            depends_lib-append    port:mesa \
340                                  port:xorg-libXmu
341        }
342        if {[variant_isset opengl_x11] || [variant_isset motif_x11] || [variant_isset raytracer_x11]} {
343            depends_lib-append    port:xorg-libice \
344                                  port:xorg-libsm \
345                                  port:xorg-libX11 \
346                                  port:xorg-libXext
347        }
348
349        variant gdml description {Build with Geometry Description Markup Language (GDML)} {
350            depends_lib-append    port:xercesc3
351            # configure.args-delete -DGEANT4_USE_GDML=OFF
352            configure.args-append -DGEANT4_USE_GDML=ON
353            # check that XERCESC_ROOT_DIR is properly set
354        }
355
356        variant debug description {Compile with debug flags on} {
357            configure.args-append -DCMAKE_BUILD_TYPE=Debug
358        }
359
360        # this option should be used with care
361        variant examples description {Build and install examples (not recommended)} {
362            # optional
363            # depends_lib-append    port:gccxml-devel
364            configure.args-append -DGEANT4_BUILD_EXAMPLES=ON \
365                                  -DGEANT4_INSTALL_EXAMPLES=ON
366        }
367
368        # a temporary variant just for the sake of testing (built-in clhep should be sufficient)
369        variant clhep description {Use external clhep} {
370            depends_lib-append    port:clhep
371            configure.args-replace \
372                                  -DGEANT4_USE_SYSTEM_CLHEP=OFF -DGEANT4_USE_SYSTEM_CLHEP=ON
373            configure.args-append -DGEANT4_USE_SYSTEM_EXPAT=ON \
374                                  -DGEANT4_USE_SYSTEM_CLHEP=ON \
375                                  -DCLHEP_CONFIG_EXECUTABLE=${prefix}/bin/clhep-config \
376                                  -DCLHEP_INCLUDE_DIR=${prefix}/include \
377                                  -DCLHEP_LIBRARY=${prefix}/lib/libCLHEP.dylib
378        }
379
380        if {${geant.version} >= "10.0"} {
381            variant threads description {Build with multi-threading support} {
382                configure.args-append -DGEANT4_BUILD_MULTITHREADED=ON
383            }
384        }
385
386        default_variants-append +gdml
387        if {![variant_isset qt5]} {
388            default_variants-append +qt
389        }
390
391        set geant.version_full_no_patch [join [lrange [split ${geant.version_full} .] 0 2] \\.]
392        livecheck.type      regex
393        if {${geant.version} == "10.2"} {
394            livecheck.url   http://geant4.cern.ch/support/download.shtml
395        } else {
396            livecheck.url   http://geant4.cern.ch/support/source_archive.shtml
397        }
398        # http://geant4.cern.ch/support/source/geant4.xx.xx[.pxx].tar.gz
399        livecheck.regex     geant(${geant.version_full_no_patch}(\\.\[bp\]\[0-9\]+)?)\\.tar\\.gz
400    }
401}
402
403# stub port
404if {$subport eq $name} {
405    # default replacement for geant4 which used to provide geant4.9.4
406    # other users should install geant4.10.x directly
407    depends_lib   port:geant${version}
408
409    fetch         {}
410    checksum      {}
411    extract       {}
412    patch         {}
413    use_configure no
414    build         {}
415    destroot {
416        set geant.docdir ${prefix}/share/doc/${name}
417        xinstall -m 755 -d ${destroot}${geant.docdir}
418        system "echo $name is a stub port > ${destroot}${geant.docdir}/README"
419    }
420    livecheck.type  none
421}
Note: See TracBrowser for help on using the repository browser.