summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/miniconda3/package.py
blob: f66d91e2382595c25203a13b22336e2ace4f1e27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import platform
from os.path import split

from spack.package import *
from spack.util.environment import EnvironmentModifications

_versions = {
    "22.11.1": {
        "Linux-x86_64": (
            "00938c3534750a0e4069499baf8f4e6dc1c2e471c86a59caa0dd03f4a9269db6",
            "https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-Linux-x86_64.sh",
        )
    },
    "4.10.3": {
        "Linux-x86_64": (
            "1ea2f885b4dbc3098662845560bc64271eb17085387a70c2ba3f29fff6f8d52f",
            "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh",
        )
    },
    "4.9.2": {
        "Linux-ppc64le": (
            "2b111dab4b72a34c969188aa7a91eca927a034b14a87f725fa8d295955364e71",
            "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.9.2-Linux-ppc64le.sh",
        ),
        "Linux-x86_64": (
            "1314b90489f154602fd794accfc90446111514a5a72fe1f71ab83e07de9504a7",
            "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.9.2-Linux-x86_64.sh",
        ),
    },
    "4.8.2": {
        "Linux-x86_64": (
            "5bbb193fd201ebe25f4aeb3c58ba83feced6a25982ef4afa86d5506c3656c142",
            "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh",
        )
    },
    "4.7.12.1": {
        "Linux-x86_64": (
            "bfe34e1fa28d6d75a7ad05fd02fa5472275673d5f5621b77380898dee1be15d2",
            "https://repo.continuum.io/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh",
        )
    },
    "4.6.14": {
        "Linux-x86_64": (
            "0d6b23895a91294a4924bd685a3a1f48e35a17970a073cd2f684ffe2c31fc4be",
            "https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh",
        )
    },
    "4.5.11": {
        "Linux-x86_64": (
            "ea4594241e13a2671c5b158b3b813f0794fe58d514795fbf72a1aad24db918cf",
            "https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh",
        )
    },
    "4.5.4": {
        "Linux-x86_64": (
            "80ecc86f8c2f131c5170e43df489514f80e3971dd105c075935470bbf2476dea",
            "https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh",
        )
    },
    "4.3.30": {
        "Linux-x86_64": (
            "66c822dfe76636b4cc2ae5604816e0e723aa01620f50087f06410ecf5bfdf38c",
            "https://repo.continuum.io/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh",
        )
    },
    "4.3.14": {
        "Linux-x86_64": (
            "902f31a46b4a05477a9862485be5f84af761a444f8813345ff8dad8f6d3bccb2",
            "https://repo.continuum.io/miniconda/Miniconda3-4.3.14-Linux-x86_64.sh",
        )
    },
    "4.3.11": {
        "Linux-x86_64": (
            "b9fe70ce7b6fa8df05abfb56995959b897d0365299f5046063bc236843474fb8",
            "https://repo.continuum.io/miniconda/Miniconda3-4.3.11-Linux-x86_64.sh",
        )
    },
}


class Miniconda3(Package):
    """The minimalist bootstrap toolset for conda and Python3."""

    homepage = "https://conda.io/miniconda.html"

    for ver, packages in _versions.items():
        key = "{0}-{1}".format(platform.system(), platform.machine())
        pkg = packages.get(key)
        if pkg:
            version(ver, sha256=pkg[0], url=pkg[1], expand=False)

    def install(self, spec, prefix):
        # peel the name of the script out of the pathname of the
        # downloaded file
        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))