2019-12-31 14:36:56 +08:00
|
|
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
2019-02-14 12:51:26 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
|
|
|
|
|
|
|
from spack import *
|
|
|
|
|
|
|
|
|
|
|
|
class G4neutronxs(Package):
|
|
|
|
"""Geant4 data for evaluated neutron cross-sections on natural composition
|
|
|
|
of elements"""
|
|
|
|
homepage = "http://geant4.web.cern.ch"
|
|
|
|
url = "http://geant4-data.web.cern.ch/geant4-data/datasets/G4NEUTRONXS.1.4.tar.gz"
|
|
|
|
|
2020-02-28 23:34:08 +08:00
|
|
|
maintainers = ['drbenmorgan']
|
|
|
|
|
2020-03-31 16:54:31 +08:00
|
|
|
# Only versions relevant to Geant4 releases built by spack are added
|
|
|
|
# Dataset not used after Geant4 10.4.x
|
2019-10-11 13:44:41 +08:00
|
|
|
version('1.4', sha256='57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd')
|
2019-02-14 12:51:26 +08:00
|
|
|
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
mkdirp(join_path(prefix.share, 'data'))
|
2019-08-03 02:48:35 +08:00
|
|
|
install_path = join_path(prefix.share, 'data', 'G4NEUTRONXS{0}'
|
|
|
|
.format(self.version))
|
2019-02-14 12:51:26 +08:00
|
|
|
install_tree(self.stage.source_path, install_path)
|
|
|
|
|
2020-03-31 16:54:31 +08:00
|
|
|
def setup_dependent_run_environment(self, env, dependent_spec):
|
|
|
|
install_path = join_path(self.prefix.share, 'data', 'G4NEUTRONXS{0}'
|
|
|
|
.format(self.version))
|
|
|
|
env.set('G4NEUTRONXSDATA', install_path)
|
|
|
|
|
2019-02-14 12:51:26 +08:00
|
|
|
def url_for_version(self, version):
|
|
|
|
"""Handle version string."""
|
|
|
|
return "http://geant4-data.web.cern.ch/geant4-data/datasets/G4NEUTRONXS.%s.tar.gz" % version
|