[108226] users/mojca

mojca at macports.org mojca at macports.org
Tue Jul 16 16:03:51 PDT 2013


Revision: 108226
          https://trac.macports.org/changeset/108226
Author:   mojca at macports.org
Date:     2013-07-16 16:03:51 -0700 (Tue, 16 Jul 2013)
Log Message:
-----------
gate: add Gate.app (it's now working), licence files, new transparent png, basic gui macro file, fix/change startup script

Modified Paths:
--------------
    users/mojca/notes/Gate.txt
    users/mojca/notes/Geant4.txt
    users/mojca/ports/science/gate/Portfile
    users/mojca/ports/science/gate/files/gate.png

Added Paths:
-----------
    users/mojca/ports/science/gate/files/gui.mac

Modified: users/mojca/notes/Gate.txt
===================================================================
--- users/mojca/notes/Gate.txt	2013-07-16 20:58:43 UTC (rev 108225)
+++ users/mojca/notes/Gate.txt	2013-07-16 23:03:51 UTC (rev 108226)
@@ -14,17 +14,30 @@
 - http://suhard.fr/gate/gate6.2.dmg
 
 TODO:
-- copy license/LICENSE.txt
-- copy examples & benchmarks
-- figure out if there is some CMAKE variable to copy the examples automatically
-- maybe put the Gate binary to libexec and create a shell script in ${prefix}/bin/Gate which sets all the necessary variables (data files) and calls the real binary afterwards
-- in case of errors, Gate reports location where the file is built (that weird build path that doesn't exist any more)
 - to load the material database, it would be great if Gate would look into some predefined location
   in general/src/GateTools.cc there is
     G4String GateTools::FindGateFile(const G4String& fileName)
   which checks for the environmental variable GATEHOME and may potentially load the material database and other files from there
-  but for the start, try to copy the material database somewhere and set GATEHOME
+- check if qt4-mac is enabled for Geant4, else prevent compilation (or make a Gate variant without qt4)
+- Should examples go to share/doc/gate or to share/gate/doc?
+- replace "../../GateMaterials.db" with "GateMaterials.db" in examples
+- remove CMake files from examples (possibly add material database, but I guess it should not be needed)
+- load gui.mac
+- png icon: less transparency if possible
 
+Upstream feature requests:
+- CMAKE variable to copy the examples automatically
+- try to prevent crashing by catching errors
+- geant: figure out how file/open & friends menu works (http://geant4.in2p3.fr/spip.php?article84&lang=en)
+- prepare a nice default startup gui
+
+DONE:
+- copy license/LICENSE.txt -> OK
+- copy examples & benchmarks -> OK
+- maybe put the Gate binary to libexec and create a shell script in ${prefix}/bin/Gate which sets all the necessary variables (data files) and calls the real binary afterwards -> OK
+- try to copy the material database somewhere and set GATEHOME -> OK
+- in case of errors, Gate reports location where the file is built (that weird build path that doesn't exist any more) -> OK
+
 Something like tho following is needed for running Gate:
 	export LC_NUMERIC=C
 	export G4LEDATA="/opt/local/share/Geant4/Data/G4EMLOW6.32"

Modified: users/mojca/notes/Geant4.txt
===================================================================
--- users/mojca/notes/Geant4.txt	2013-07-16 20:58:43 UTC (rev 108225)
+++ users/mojca/notes/Geant4.txt	2013-07-16 23:03:51 UTC (rev 108226)
@@ -27,7 +27,6 @@
 		/opt/local/lib/libQtOpenGL.4.dylib (compatibility version 4.8.0, current version 4.8.2)
 		/opt/local/lib/libQtGui.4.dylib (compatibility version 4.8.0, current version 4.8.2)
 		/opt/local/lib/libQtCore.4.dylib (compatibility version 4.8.0, current version 4.8.2)
-- What is /opt/local/lib/Geant4/Geant4.10.0/Geant4-10.0.0/Darwin-clang doing there?
 - Try to move /opt/local/lib/Geant4/Geant4.10.0/Geant4-10.0.0 to a better place
 	according to http://www.cmake.org/Wiki/CMake/Tutorials/Packaging it should be
 	/opt/local/lib/Geant4-10.0.0, so maybe one should not change path to
@@ -49,9 +48,8 @@
 
 - Try to move /opt/local/share/Geant4/Geant4-10.0.0/geant4make/config to a better place
 - Check if /opt/local/share/Geant4/Geant4-10.0.0/geant4make/geant4make.sh works
-- Fix scripts in /opt/local/libexec/Geant4/Geant4.10.0 (symlinking to them doesn't work)
-- Try to get rid of one level in /opt/local/include/Geant4/Geant4.10.0/Geant4 (low priority)
-- Try to build examples and test whether they work
+- Fix scripts in /opt/local/libexec/Geant4/Geant4.10.0 (symlinking to them doesn't work, but on the other hand they are probably not needed)
+- Try to get rid of one level in /opt/local/include/Geant4/Geant4.10.0/Geant4 (low priority, maybe not needed at all)
 - Carefully check different CMake configuration options
 - geant4-config could use absolute paths instead of -L/opt/local/libexec/Geant4/Geant4.9.6/../../../lib/Geant4/Geant4.9.6
 - figure out if it is possible to hardcode paths into Geant4 sources to some extent
@@ -59,7 +57,6 @@
 		char* path = getenv("G4LEDATA");
 - Test how setting CMAKE_INSTALL_IS_NONRELOCATABLE influences different components,
   in particular GEANT4_RELATIVE_HEADER_PATH, GEANT4_INCLUDE_DIR_SETUP (cmake/Modules/Geant4BuildProjectConfig.cmake)
-- Test if examples still work if they are manually moved to libexec
 
 -- Libraries -L/opt/local/lib/root -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lpthread -lm -ldl were added to the linkage list
 CMake Warning at examples/advanced/ChargeExchangeMC/CMakeLists.txt:131 (message):
@@ -78,8 +75,6 @@
 
 
 
-- Test if setting EXECUTABLE_OUTPUT_PATH helps move examples to a different place -> NO
-
 Options:
 - DATAROOTDIR: Geant automatically adds /Geant4-9.6.2 (any way to prevent this?)
 - INCLUDEDIR: /opt/local/include/Geant4/Geant4.9.6/Geant4 (any way to prevent double Geant4?)
@@ -154,7 +149,12 @@
 	-rwxr-xr-x  1 macports  admin   547B  8 feb 20:43 README
 	./PhotonEvaporation2.2:
 
+- Try to build examples and test whether they work -> seems OK
+- Test if examples still work if they are manually moved to libexec -> OK
+- Test if setting EXECUTABLE_OUTPUT_PATH helps move examples to a different place -> NO
+- What is /opt/local/lib/Geant4/Geant4.10.0/Geant4-10.0.0/Darwin-clang doing there? -> needed by GNUmake and needs to stay there
 
+
 Release dates and package dependencies:
 
 a = G4NDL
@@ -217,6 +217,3 @@
 Bugs:
 - http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1485 "aida-config --implementation" doesn't work
 - http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1487 LC_NUMERIC confuses strtod when Qt is being used
-
-Bugs in Portfile:
-- geant4-9.6-data installs files to 10.0's data folder

Modified: users/mojca/ports/science/gate/Portfile
===================================================================
--- users/mojca/ports/science/gate/Portfile	2013-07-16 20:58:43 UTC (rev 108225)
+++ users/mojca/ports/science/gate/Portfile	2013-07-16 23:03:51 UTC (rev 108226)
@@ -3,6 +3,7 @@
 
 PortSystem          1.0
 PortGroup           cmake 1.0
+PortGroup           app 1.0
 
 # TODO: temporary - if checksums are desired
 PortGroup           github 1.0
@@ -55,6 +56,10 @@
 set geant.datadir ""
 set geant.data_versions ""
 
+app.name            Gate
+app.executable      Gate
+app.icon            ${filespath}/gate.png
+
 worksrcdir          gate_v${version}
 configure.dir       ${workpath}/build
 build.dir           ${configure.dir}
@@ -62,35 +67,42 @@
 post-extract {
     file mkdir ${configure.dir}
 }
-
 configure.post_args ${worksrcpath}
 
-# copy examples
-# TODO: this must be done in a better way
+depends_lib         port:qt4-mac
+
 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}
+    # patch examples if needed
+    if {[variant_isset examples]} {
+        # TODO: this must be done in a better way
+        # replace "/vis/open OGLIX" with "/vis/open OGLIQt" (not sure about the difference between OGLIQt and OGLSQt; maybe even just OGL)
+        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}
+        }
     }
 }
 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
+    # 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 file with basic setup
+    copy ${filespath}/gui.mac ${destsharedir}
 }
 
 post-destroot {
-    # TODO: this is already set in another phase and should not repeat
+    # TODO: the share folder 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
@@ -98,18 +110,31 @@
     set destlibexecdir ${destroot}${libexecdir}
     xinstall -m 755 -d ${destlibexecdir}
     move ${destexecutable} ${destlibexecdir}
-    system "echo \\\$GATEHOME=${sharedir} > ${destexecutable}"
+    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 export LC_NUMERIC=C >> ${destexecutable}"
+    system "echo 'if \[\[ \$1 == -psn_* ]]; then' >> ${destexecutable}"
+    system "echo ${libexecdir}/Gate --qt >> ${destexecutable}"
+    system "echo else >> ${destexecutable}"
     system "echo ${libexecdir}/Gate \\\$@ >> ${destexecutable}"
+    system "echo fi >> ${destexecutable}"
     system "chmod 755 ${destexecutable}"
+
+    # TODO:
+    # - check if qt_menu.nib is actually needed (it is needed for static qt library)
+    # - check that qt_menu.nib actually exists
+    # - the second folder should probably come from PortGroup?
+    copy $prefix/lib/Resources/qt_menu.nib ${destroot}${applications_dir}/${app.name}.app/Contents
 }
 
+variant examples description {Install examples to doc} {
+}
 variant geant495 conflicts geant496 description {Use Geant4 9.5} {
-    depends_lib port:geant4-9.5
+    depends_lib-append 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
@@ -117,7 +142,7 @@
     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
+    depends_lib-append 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

Modified: users/mojca/ports/science/gate/files/gate.png
===================================================================
(Binary files differ)

Added: users/mojca/ports/science/gate/files/gui.mac
===================================================================
--- users/mojca/ports/science/gate/files/gui.mac	                        (rev 0)
+++ users/mojca/ports/science/gate/files/gui.mac	2013-07-16 23:03:51 UTC (rev 108226)
@@ -0,0 +1,37 @@
+#
+#  This file permits to customize, with commands,
+# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
+# It has no effect with G4UIterminal.
+#
+# draws the window with the box
+/vis/open OGL 600x600-0+0
+# draws the scene tree
+/vis/drawVolume
+#
+# Run menu :
+/gui/addMenu run Run
+/gui/addButton run "beamOn 1" "/run/beamOn 1"
+/gui/addButton run "beamOn 10" "/run/beamOn 10"
+/gui/addButton run "beamOn 100" "/run/beamOn 100"
+/gui/addButton run "beamOn 1000" "/run/beamOn 1000"
+/gui/addButton run "Application Start" "/gate/application/start"
+/gui/addButton run "Application Start DAQ" "/gate/application/startDAQ"
+#
+# Viewer menu :
+/gui/addMenu viewer Viewer
+/gui/addButton viewer "Set style surface" "/vis/viewer/set/style surface"
+/gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wire"
+/gui/addButton viewer "Refresh viewer" "/vis/viewer/refresh"
+/gui/addButton viewer "Update viewer (interaction or end-of-file)" "/vis/viewer/update"
+/gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush"
+/gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers"
+#
+/gui/addMenu zoom Zoom
+/gui/addButton zoom "10%" "/vis/viewer/zoomTo 0.1"
+/gui/addButton zoom "50%" "/vis/viewer/zoomTo 0.5"
+/gui/addButton zoom "100%" "/vis/viewer/zoomTo 1.0"
+/gui/addButton zoom "150%" "/vis/viewer/zoomTo 1.5"
+/gui/addButton zoom "200%" "/vis/viewer/zoomTo 2.0"
+/gui/addButton zoom "500%" "/vis/viewer/zoomTo 5.0"
+#
+/gate/geometry/setMaterialDatabase GateMaterials.db
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130716/57334c00/attachment-0001.html>


More information about the macports-changes mailing list