miniconda: source conda.sh setup script (#28321)

This commit is contained in:
Adam J. Stewart 2022-01-17 05:53:41 -06:00 committed by GitHub
parent 5d56a3b306
commit e7c9f05cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 0 deletions

View File

@ -6,6 +6,7 @@
from os.path import split
from spack import *
from spack.util.environment import EnvironmentModifications
class Anaconda2(Package):
@ -46,3 +47,7 @@ def install(self, spec, prefix):
dir, anaconda_script = split(self.stage.archive_file)
bash = which('bash')
bash(anaconda_script, '-b', '-f', '-p', self.prefix)
def setup_run_environment(self, env):
filename = self.prefix.etc.join('profile.d').join('conda.sh')
env.extend(EnvironmentModifications.from_sourcing_file(filename))

View File

@ -6,6 +6,7 @@
from os.path import split
from spack import *
from spack.util.environment import EnvironmentModifications
class Anaconda3(Package):
@ -56,3 +57,7 @@ def install(self, spec, prefix):
dir, anaconda_script = split(self.stage.archive_file)
bash = which('bash')
bash(anaconda_script, '-b', '-f', '-p', self.prefix)
def setup_run_environment(self, env):
filename = self.prefix.etc.join('profile.d').join('conda.sh')
env.extend(EnvironmentModifications.from_sourcing_file(filename))

View File

@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from spack.util.environment import EnvironmentModifications
class Conda4aarch64(Package):
@ -22,3 +23,7 @@ def install(self, spec, prefix):
conda_script = self.stage.archive_file
bash = which('bash')
bash(conda_script, '-b', '-f', '-p', self.prefix)
def setup_run_environment(self, env):
filename = self.prefix.etc.join('profile.d').join('conda.sh')
env.extend(EnvironmentModifications.from_sourcing_file(filename))

View File

@ -6,6 +6,7 @@
from os.path import split
from spack import *
from spack.util.environment import EnvironmentModifications
class Miniconda2(Package):
@ -28,3 +29,7 @@ def install(self, spec, prefix):
dir, script = split(self.stage.archive_file)
bash = which('bash')
bash(script, '-b', '-f', '-p', self.prefix)
def setup_run_environment(self, env):
filename = self.prefix.etc.join('profile.d').join('conda.sh')
env.extend(EnvironmentModifications.from_sourcing_file(filename))

View File

@ -7,6 +7,7 @@
from os.path import split
from spack import *
from spack.util.environment import EnvironmentModifications
_versions = {
'4.10.3': {
@ -50,3 +51,7 @@ def install(self, spec, prefix):
dir, script = split(self.stage.archive_file)
bash = which('bash')
bash(script, '-b', '-f', '-p', self.prefix)
def setup_run_environment(self, env):
filename = self.prefix.etc.join('profile.d').join('conda.sh')
env.extend(EnvironmentModifications.from_sourcing_file(filename))