# Copyright (c) 2018-2024, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set py_version = environ['CONDA_PY'] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
{% set date_string = environ['RAPIDS_DATE_STRING'] %}

package:
  name: cugraph
  version: {{ version }}

source:
  path: ../../..

build:
  number: {{ GIT_DESCRIBE_NUMBER }}
  string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
  script_env:
    - AWS_ACCESS_KEY_ID
    - AWS_SECRET_ACCESS_KEY
    - AWS_SESSION_TOKEN
    - CMAKE_C_COMPILER_LAUNCHER
    - CMAKE_CUDA_COMPILER_LAUNCHER
    - CMAKE_CXX_COMPILER_LAUNCHER
    - CMAKE_GENERATOR
    - PARALLEL_LEVEL
    - SCCACHE_BUCKET
    - SCCACHE_IDLE_TIMEOUT
    - SCCACHE_REGION
    - SCCACHE_S3_KEY_PREFIX=cugraph-aarch64 # [aarch64]
    - SCCACHE_S3_KEY_PREFIX=cugraph-linux64 # [linux64]
    - SCCACHE_S3_USE_SSL
    - SCCACHE_S3_NO_CREDENTIALS
  ignore_run_exports_from:
    {% if cuda_major == "11" %}
    - {{ compiler('cuda11') }}
    {% else %}
    - {{ compiler('cuda') }}
    - cuda-cudart-dev
    {% endif %}

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    {% if cuda_major == "11" %}
    - {{ compiler('cuda11') }} {{ cuda_version }}
    {% else %}
    - {{ compiler('cuda') }}
    {% endif %}
    - cuda-version ={{ cuda_version }}
    - cmake {{ cmake_version }}
    - ninja
    - sysroot_{{ target_platform }} {{ sysroot_version }}
  host:
    - cuda-version ={{ cuda_version }}
    {% if cuda_major == "11" %}
    - cudatoolkit
    {% else %}
    - cuda-cudart-dev
    {% endif %}
    - cudf ={{ minor_version }}
    - cython >=3.0.0
    - libcugraph ={{ version }}
    - pylibraft ={{ minor_version }}
    - python
    - raft-dask ={{ minor_version }}
    - rmm ={{ minor_version }}
    - scikit-build-core >=0.7.0
    - setuptools
  run:
    - aiohttp
    - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
    {% if cuda_major == "11" %}
    - cudatoolkit
    - cuda-python >=11.7.1,<12.0a0
    {% else %}
    - cuda-cudart
    - cuda-python >=12.0,<13.0a0
    {% endif %}
    - cudf ={{ minor_version }}
    - cupy >=12.0.0
    - dask-cuda ={{ minor_version }}
    - dask-cudf ={{ minor_version }}
    - fsspec>=0.6.0
    - libcugraph ={{ version }}
    - pylibcugraph ={{ version }}
    - pylibraft ={{ minor_version }}
    - python
    - raft-dask ={{ minor_version }}
    - rapids-dask-dependency ={{ minor_version }}
    - requests
    - ucx-proc=*=gpu
    - ucx-py {{ ucx_py_version }}

tests:
  requirements:
    - cuda-version ={{ cuda_version }}
  imports:
    - cugraph

about:
  home: https://rapids.ai/
  dev_url: https://github.com/rapidsai/cugraph
  license: Apache-2.0
  license_file: ../../../LICENSE
  summary: cuGraph library
