# this is what docs.conda.io refers to as `miniconda`

distributable:
  url: https://github.com/conda/conda/archive/refs/tags/{{version.tag}}.tar.gz
  strip-components: 1

versions:
  github: conda/conda

dependencies:
  python.org: ~3.11

build:
  dependencies:
    gnu.org/patch: '*'
  script:
    # stops conda from installing to our versioned prefix by default
    - patch -p1 < props/context.py.diff
    - python-venv.sh {{prefix}}/bin/conda

    # we desire to provide a conda that doesn’t require you to force it into
    # your shellrc this command modifies the installation to prevent it
    # erroring so we have to do prior to pkging it
    - '{{prefix}}/bin/conda init'

provides:
  - bin/conda

test:
  - conda --version | grep {{version}}
  - |
    source /dev/stdin <<<"$(conda shell.bash hook)"
    conda create --yes --name snowflakes biopython
    conda activate snowflakes
    conda info --envs | grep snowflakes
    conda deactivate

  # check env has been restored
  - |
    if ! conda info --envs | grep snowflakes; then
      exit 1
    fi
