# -*- 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 # $Id$ # Keep in sync with Geant4 (and/or implement a PortGroup) PortSystem 1.0 PortGroup app 1.0 PortGroup cmake 1.0 PortGroup github 1.0 PortGroup active_variants 1.1 set git_sha 0be152cf set git_date 20151007 github.setup OpenGATE Gate ${git_sha} name gate version 7.1 revision 5 # version 7.1-git-${git_date}-${git_sha} categories science maintainers mojca openmaintainer 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 checksums rmd160 8e5316fa5984541c6afa11f6194b970cdf74ab9b \ sha256 4fcab7083b675804397fdf91e4a79ebcb185dbb3a7ff98c8430e8a8ec0d57911 # TODO: take this data from a geant4 portgroup set geant.data_versions_10.1 { G4NDL 4.5 G4NDL G4NEUTRONHPDATA G4EMLOW 6.41 G4EMLOW G4LEDATA PhotonEvaporation 3.1 G4PhotonEvaporation G4LEVELGAMMADATA RadioactiveDecay 4.2 G4RadioactiveDecay G4RADIOACTIVEDATA G4NEUTRONXS 1.4 G4NEUTRONXS G4NEUTRONXSDATA G4PII 1.3 G4PII G4PIIDATA RealSurface 1.0 RealSurface G4REALSURFACEDATA G4SAIDDATA 1.1 G4SAIDDATA G4SAIDXSDATA G4ABLA 3.0 G4ABLA G4ABLADATA G4ENSDFSTATE 1.0 G4ENSDFSTATE G4ENSDFSTATEDATA } set geant.data_versions_10.0 { G4NDL 4.4 G4NDL G4NEUTRONHPDATA G4EMLOW 6.35 G4EMLOW G4LEDATA PhotonEvaporation 3.0 G4PhotonEvaporation G4LEVELGAMMADATA RadioactiveDecay 4.0 G4RadioactiveDecay G4RADIOACTIVEDATA G4NEUTRONXS 1.4 G4NEUTRONXS G4NEUTRONXSDATA G4PII 1.3 G4PII G4PIIDATA RealSurface 1.0 RealSurface G4REALSURFACEDATA G4SAIDDATA 1.1 G4SAIDDATA G4SAIDXSDATA G4ABLA 3.0 G4ABLA G4ABLADATA G4ENSDFSTATE 1.0 G4ENSDFSTATE G4ENSDFSTATEDATA } set geant.datadir "" set geant.data_versions "" app.name Gate app.executable Gate app.icon ${filespath}/gate.png cmake.out_of_source yes depends_lib port:root5 patchfiles-append patch-addmenu.diff configure.args-append \ -DGATE_USE_OPTICAL=ON \ -DGATE_USE_SYSTEM_CLHEP=OFF \ -DROOT_CONFIG_EXECUTABLE=${prefix}/libexec/root5/bin/root-config # ROOT is optional: we could make a variant if needed post-patch { # patch examples if needed if {[variant_isset examples]} { foreach f [exec find "${worksrcpath}/examples" -type f -name "*.mac"] { # 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 # replace "/vis/open OGLIX" with "/vis/open OGLIQt" (not sure about the difference between OGLIQt and OGLSQt; maybe even just OGL) # just in case we could check that the statement actually starts with /vis/open reinplace "s|OGLIX|OGLIQt|g" ${f} reinplace "s|OGLSX|OGLSQt|g" ${f} # TODO: create a single expression to cover both, possibly storing the variables to simplify the replacement part reinplace "s|/gate/geometry/setMaterialDatabase.*GateMaterials.db|/gate/geometry/setMaterialDatabase GateMaterials.db|g" ${f} reinplace "s|/gate/geometry/setMaterialDatabase.*GateMaterialsGPU.db|/gate/geometry/setMaterialDatabase GateMaterialsGPU.db|g" ${f} } } } pre-destroot { set destdocdir ${destroot}${prefix}/share/doc/${name} xinstall -m 755 -d ${destdocdir} # copy license copy ${worksrcpath}/license ${destdocdir} # copy examples if {[variant_isset examples]} { copy ${worksrcpath}/examples ${destdocdir} } # copy 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} # copy the initial macro files with basic setup copy ${filespath}/gui.mac ${destsharedir} copy ${filespath}/icons.mac ${destsharedir} } post-destroot { # TODO: the share folder is already set in another phase and should not repeat (actually, all the pre-destroot actions could go to post-destroot) 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 '#!/bin/bash' > ${destexecutable}" system "echo export 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 ${libexecdir}/Gate \\\$@ >> ${destexecutable}" system "chmod 755 ${destexecutable}" } variant examples description {Install examples to doc} { } variant geant4100 conflicts geant4101 description {Use Geant4 10.0 (deprecated)} { set geant.version 10.0 set geant.revision 4 set geant.port_name geant4.${geant.version} set geant.data_versions ${geant.data_versions_10.0} set geant.datadir ${prefix}/share/Geant4/Data/Geant4.${geant.version} set geant.cmakedir ${prefix}/lib/Geant4-${geant.version}.${geant.revision} depends_lib-append port:${geant.port_name} configure.args-append -DGeant4_DIR=${geant.cmakedir} } variant geant4101 conflicts geant4100 description {Use Geant4 10.1} { set geant.version 10.1 set geant.revision 1 set geant.port_name geant4.${geant.version} set geant.data_versions ${geant.data_versions_10.1} set geant.datadir ${prefix}/share/Geant4/Data/Geant4.${geant.version} set geant.cmakedir ${prefix}/lib/Geant4-${geant.version}.${geant.revision} depends_lib-append port:${geant.port_name} configure.args-append -DGeant4_DIR=${geant.cmakedir} } variant qt4 conflicts qt5 description {Use Geant4 with Qt 4} { PortGroup qt4 1.0 } variant qt5 conflicts qt4 description {Use Geant4 with Qt 5 (buggy)} { PortGroup qt5 1.0 } default_variants-append +examples if {![variant_isset geant4101] && ![variant_isset geant4100]} { default_variants-append +geant4101 } # some ugly code to make sure that the variants for Qt version used # are consistent between Gate and Geant4; looking for suggestions for improvement if {[variant_isset geant4101]} { if {![catch {set result [active_variants geant4.10.1 qt5 qt4]}]} { if {$result} { default_variants-append +qt5 } else { default_variants-append +qt4 } } if {[variant_isset qt4]} { require_active_variants geant4.10.1 qt } elseif {[variant_isset qt5]} { require_active_variants geant4.10.1 qt5 } } elseif {[variant_isset geant4100]} { if {![catch {set result [active_variants geant4.10.0 qt5 qt4]}]} { if {$result} { default_variants-append +qt5 } else { default_variants-append +qt4 } } if {[variant_isset qt4]} { require_active_variants geant4.10.0 qt } elseif {[variant_isset qt5]} { require_active_variants geant4.10.0 qt5 } } livecheck.version ${version} livecheck.regex archive/\[v\](\[^"\]+)${extract.suffix}