[107922] users/mojca/ports/science
mojca at macports.org
mojca at macports.org
Tue Jul 9 02:57:58 PDT 2013
Revision: 107922
https://trac.macports.org/changeset/107922
Author: mojca at macports.org
Date: 2013-07-09 02:57:58 -0700 (Tue, 09 Jul 2013)
Log Message:
-----------
gate: add two variants: geant495 & 496, create a loader that sets environmental variables
Modified Paths:
--------------
users/mojca/ports/science/gate/Portfile
users/mojca/ports/science/geant/Portfile
Modified: users/mojca/ports/science/gate/Portfile
===================================================================
--- users/mojca/ports/science/gate/Portfile 2013-07-09 08:56:22 UTC (rev 107921)
+++ users/mojca/ports/science/gate/Portfile 2013-07-09 09:57:58 UTC (rev 107922)
@@ -26,6 +26,29 @@
checksums rmd160 b21ab59aa0d7dec9771a9e5a213ee8d739c5666e \
sha256 843424c70c27e4f26cf64b99ddc73b614a0be2abed25a7a48af739eaa5f881f3
+set geant.data_versions_9.6 {
+ G4NDL 4.2 G4NDL G4NEUTRONHPDATA
+ G4EMLOW 6.32 G4EMLOW G4LEDATA
+ PhotonEvaporation 2.3 G4PhotonEvaporation G4LEVELGAMMADATA
+ RadioactiveDecay 3.6 G4RadioactiveDecay G4RADIOACTIVEDATA
+ G4NEUTRONXS 1.2 G4NEUTRONXS G4NEUTRONXSDATA
+ G4PII 1.3 G4PII G4PIIDATA
+ RealSurface 1.0 RealSurface G4REALSURFACEDATA
+ G4SAIDDATA 1.1 G4SAIDDATA G4SAIDXSDATA
+}
+set geant.data_versions_9.5 {
+ G4NDL 4.2 G4NDL G4NEUTRONHPDATA
+ G4EMLOW 6.32 G4EMLOW G4LEDATA
+ PhotonEvaporation 2.3 G4PhotonEvaporation G4LEVELGAMMADATA
+ RadioactiveDecay 3.6 G4RadioactiveDecay G4RADIOACTIVEDATA
+ G4ABLA 3.0 G4ABLA G4ABLADATA
+ G4NEUTRONXS 1.1 G4NEUTRONXS G4NEUTRONXSDATA
+ G4PII 1.3 G4PII G4PIIDATA
+ RealSurface 1.0 RealSurface G4REALSURFACEDATA
+}
+set geant.datadir ""
+set geant.data_versions ""
+
worksrcdir gate_v${version}
configure.dir ${workpath}/build
build.dir ${configure.dir}
@@ -47,34 +70,57 @@
}
}
pre-destroot {
+ # copy examples
+ # Should examples go to share/doc/gate or to share/gate/doc?
set destdocdir ${destroot}${prefix}/share/doc/${name}
xinstall -m 755 -d ${destdocdir}
- file copy ${worksrcpath}/examples ${destdocdir}
+ copy ${worksrcpath}/examples ${destdocdir}
# TODO: remove CMake files and add material database
+ # add materials database
+ set sharedir ${prefix}/share/${name}
+ set destsharedir ${destroot}${sharedir}
+ xinstall -m 755 -d ${destsharedir}
+ copy ${worksrcpath}/GateMaterials.db ${destsharedir}
+ copy ${worksrcpath}/GateMaterialsGPU.db ${destsharedir}
}
-depends_lib port:geant4.9.6
-# clhep implied with geant4
+post-destroot {
+ # TODO: this is already set in another phase and should not repeat
+ set sharedir ${prefix}/share/${name}
+ # move the binary and set environmental variables
+ set destexecutable ${destroot}${prefix}/bin/Gate
+ set libexecdir ${prefix}/libexec/${name}
+ set destlibexecdir ${destroot}${libexecdir}
+ xinstall -m 755 -d ${destlibexecdir}
+ move ${destexecutable} ${destlibexecdir}
+ system "echo \\\$GATEHOME=${sharedir} > ${destexecutable}"
+ system "echo export G4DATADIR=${geant.datadir} > ${destexecutable}"
+ foreach {data.name data.version data.filename data.envvariable} ${geant.data_versions} {
+ system "echo export ${data.envvariable}=\\\$G4DATADIR/${data.name}${data.version} >> ${destexecutable}"
+ }
+ system "echo export LC_NUMERIC=C >> ${destexecutable}"
+ system "echo ${libexecdir}/Gate \\\$@ >> ${destexecutable}"
+ system "chmod 755 ${destexecutable}"
+}
-# depends_lib port:clhep \
-# port:zlib
-
-# WITH_GEANT4_UIVIS=ON
-variant qt description {Build with Qt support} {
- depends_lib-append port:qt4-mac
-
- # configure.args-append -DGEANT4_USE_QT=ON
- # maybe we need more variables?
+variant geant495 conflicts geant496 description {Use Geant4 9.5} {
+ depends_lib port:geant4-9.5
+ # TODO: this can probably be done in a more elegant way
+ set geant.data_versions ${geant.data_versions_9.5}
+ set geant.datadir ${prefix}/share/Geant4/Data/Geant4.9.5
+ # TODO: how to copy this from geant4 suports?
+ configure.args-append -DGeant4_DIR=${prefix}/lib/Geant4/Geant4.9.6/Geant4-9.5.2
}
+variant geant496 conflicts geant495 description {Use Geant4 9.6} {
+ depends_lib port:geant4-9.6
+ # TODO: this can probably be done in a more elegant way
+ set geant.data_versions ${geant.data_versions_9.6}
+ set geant.datadir ${prefix}/share/Geant4/Data/Geant4.9.6
+ # TODO: how to copy this from geant4 suports?
+ configure.args-append -DGeant4_DIR=${prefix}/lib/Geant4/Geant4.9.6/Geant4-9.6.2
+}
+if {![variant_isset geant495] && ![variant_isset geant496]} {
+ default_variants +geant496
+}
configure.args-append -DGATE_USE_SYSTEM_CLHEP=ON
-# configure.args-append -DGEANT4_INSTALL_DATA=ON \
-# -DGEANT4_BUILD_EXAMPLES=ON \
-# -DGEANT4_INSTALL_EXAMPLES=ON \
-# -DWITH_GEANT4_UIVIS=ON \
-# -DGEANT4_USE_OPENGL_X11=ON
-
-# TODO: this should come from Geant4 PortGroup
-configure.args-append -DGeant4_DIR=${prefix}/lib/Geant4/Geant4.9.6/Geant4-9.6.2
-
-default_variants +qt
Modified: users/mojca/ports/science/geant/Portfile
===================================================================
--- users/mojca/ports/science/geant/Portfile 2013-07-09 08:56:22 UTC (rev 107921)
+++ users/mojca/ports/science/geant/Portfile 2013-07-09 09:57:58 UTC (rev 107922)
@@ -7,7 +7,7 @@
# TODO: this will probably be called geant4
name geant
# TODO: not sure what the version should be (version should be specific to each subport)
-version 4.0
+version 4.0
categories science
maintainers mojca openmaintainer
# TODO: what licence is needed to make sure that Geant can be installed as a binary package
@@ -195,6 +195,124 @@
}
}
+# subport geant4-gate {
+# PortGroup github 1.0
+#
+# # TODO: just temporary
+# github.setup mojca opengate f14c352c92
+#
+# name gate
+# version 6.2
+# revision 0
+# # license LGPL
+# # description GATE description
+# # long_description GATE is dedicated to numerical simulations in medical imaging and radiotherapy. \
+# # It currently supports simulations of Emission Tomography (PET and SPECT), \
+# # Computed Tomography (CT) and Radiotherapy experiments.
+# # homepage http://www.opengatecollaboration.org
+# # platforms darwin
+#
+# # distfiles gate_v6_2_tar_gz_15843.gz
+# # master_sites http://www.opengatecollaboration.org/sites/opengatecollaboration.org/files/gate_release/2012/08/
+#
+# checksums rmd160 b21ab59aa0d7dec9771a9e5a213ee8d739c5666e \
+# sha256 843424c70c27e4f26cf64b99ddc73b614a0be2abed25a7a48af739eaa5f881f3
+#
+# worksrcdir gate_v${version}
+# configure.dir ${workpath}/build
+# build.dir ${configure.dir}
+#
+# post-extract {
+# file mkdir ${configure.dir}
+# }
+#
+# configure.post_args ${worksrcpath}
+#
+# # copy examples
+# # TODO: this must be done in a better way
+# post-patch {
+# # replace "/vis/open OGLIX" with "/vis/open OGLIQt" (not sure about the difference between OGLIQt and OGLSQt)
+# foreach examplefile {gpumacros/ct/mac/visu.mac gpumacros/optical/macro_biolum_cpu.mac gpumacros/optical/macro_biolum_gpu.mac gpumacros/pet/mac/visu.mac gpumacros/photradthera/mac/visu.mac example_CT/classic/visu.mac example_CT/fast/visu.mac example_CT/vrt/visu.mac example_OPTICAL/macro/Visualisation.mac example_PET/PET_CylindricalPET_System.mac example_PET/PET_Ecat_System.mac example_PHANTOM_SOURCE/Voxelized_Phantom_Source/mainMacro.mac example_SPECT/vis.mac example_TimeActivityCurve/vis.mac example_TrackerDetector/visu.mac} {
+# reinplace "s|OGLIX|OGLIQt|g" ${worksrcpath}/examples/${examplefile}
+# reinplace "s|OGLSX|OGLIQt|g" ${worksrcpath}/examples/${examplefile}
+# system "echo ${examplefile}"
+# }
+# }
+# pre-destroot {
+# # copy examples
+# # Should examples go to share/doc/gate or to share/gate/doc?
+# set destdocdir ${destroot}${prefix}/share/doc/${name}
+# xinstall -m 755 -d ${destdocdir}
+# copy ${worksrcpath}/examples ${destdocdir}
+# # TODO: remove CMake files and add material database
+# # add materials database
+# set sharedir ${prefix}/share/${name}
+# set destsharedir ${destroot}${sharedir}
+# copy ${worksrcpath}/GateMaterials.db ${destsharedir}
+# copy ${worksrcpath}/GateMaterialsGPU.db ${destsharedir}
+# }
+# post-destroot {
+# # TODO: use some more elegant way
+# # if [variant_isset geant496] {
+# # set geant.data_versions ${geant.data_versions_9.6}
+# # }
+# # if [variant_isset geant495] {
+# # set geant.data_versions ${geant.data_versions_9.5}
+# # }
+#
+# # move the binary and set environmental variables
+# set destexecutable ${destroot}${prefix}/bin/Gate
+# set libexecdir ${prefix}/libexec/${name}
+# set destlibexecdir ${destroot}${libexecdir}
+# xinstall -m 755 -d ${destlibexecdir}
+# move ${destexecutable} ${destlibexecdir}
+# xinstall -m 755 ${destexecutable}
+# system "echo \\\$GATEHOME=${sharedir} >> ${destexecutable}"
+# system "echo export G4DATADIR=${geant.datadir} > ${destexecutable}"
+# foreach {data.name data.version data.filename data.envvariable data.md5 data.rmd160 data.sha256} ${geant.data_versions} {
+# system "echo export ${data.envvariable}=\\\$G4DATADIR/${data.name}${data.version} >> ${destexecutable}"
+# }
+# system "echo ${libexecdir}/Gate \\\$@ >> ${destexecutable}"
+# }
+#
+# # depends_lib port:geant4.9.6
+# # clhep implied with geant4
+#
+# # depends_lib port:clhep \
+# # port:zlib
+#
+# variant geant495 conflicts geant496 description {Use Geant4 9.5} {
+# depends_lib port:geant4-9.5
+# # TODO: this can probably be done in a more elegant way
+# set geant.data_versions ${geant.data_versions_9.5}
+# # TODO: how to copy this from geant4 suports?
+# # set geant.datadir ${prefix}/share/Geant4/Data/Geant4.9.5
+# configure.args-append -DGeant4_DIR=${prefix}/share/Geant4/Data/Geant4.9.5
+# }
+# variant geant496 conflicts geant495 description {Use Geant4 9.6} {
+# depends_lib port:geant4-9.5
+# # TODO: this can probably be done in a more elegant way
+# set geant.data_versions ${geant.data_versions_9.6}
+# # TODO: how to copy this from geant4 suports?
+# # set geant.datadir ${prefix}/share/Geant4/Data/Geant4.9.6
+# configure.args-append -DGeant4_DIR=${prefix}/share/Geant4/Data/Geant4.9.6
+# }
+# if {![variant_isset geant495] && ![variant_isset geant496]} {
+# default_variants +geant496
+# }
+#
+# configure.args-append -DGATE_USE_SYSTEM_CLHEP=ON
+# # configure.args-append -DGEANT4_INSTALL_DATA=ON \
+# # -DGEANT4_BUILD_EXAMPLES=ON \
+# # -DGEANT4_INSTALL_EXAMPLES=ON \
+# # -DWITH_GEANT4_UIVIS=ON \
+# # -DGEANT4_USE_OPENGL_X11=ON
+#
+# # TODO: this should come from Geant4 PortGroup
+# # configure.args-append -DGeant4_DIR=${geant.datadir}
+# }
+
+
# stub port
if {$subport == $name || $subport == ""} {
fetch {}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130709/5967c5cd/attachment.html>
More information about the macports-changes
mailing list