Support Geant4 on Darwin

I have created a shell.nix for a development environment for a project which depends on Geant4. This seems to work fine on Linux. However, nixpkgs does not support Geant4 on Darwin, and most of the developers on this project use MacOS. For Nix to be useful to this project, the nixpkgs Geant4 package would have to work on Darwin. I do not have access to a MacOS machine myself, so it’s difficult to get insight into what would need to be done to add Darwin support for Geant4.

Can you suggest how to make some progress on this?

Are you aware of anyone who might be interested in Geant4 on Darwin?

If I try to simply build the Geant4 derivation on the unsupported Darwin system, the first stumbling block is

CMake Error at /nix/store/bjs3kjc9zkl5vgipdgi9d8w2d5brcrjq-cmake-3.18.2/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find XQuartzGL (missing: XQuartzGL_INCLUDE_DIR
  XQuartzGL_gl_LIBRARY XQuartzGL_glu_LIBRARY)
Call Stack (most recent call first):
  /nix/store/bjs3kjc9zkl5vgipdgi9d8w2d5brcrjq-cmake-3.18.2/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindXQuartzGL.cmake:69 (find_package_handle_standard_args)
  cmake/Modules/Geant4InterfaceOptions.cmake:245 (find_package)
  cmake/Modules/G4CMakeMain.cmake:64 (include)
  CMakeLists.txt:50 (include)

From which I conclude that XQuartzGL_INCLUDE_DIR, XQuartzGL_gl_LIBRARY and XQuartzGL_glu_LIBRARY should be made to point at something from one or more of

  • pkgs.darwin.apple_sdk.frameworks.Quartz
  • pkgs.darwin.apple_sdk.frameworks.QuartzCore
  • pkgs.xquartz

My questions are

  1. Which of the aforementioned quartzy packages are relevant here?

  2. How should the missing variables be set in the Geant4 compilation environment?