{% set version = "0.13.0" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-sits
  version: {{ version|replace("-", "_") }}

source:
  url:
    - https://github.com/e-sensing/sits/archive/refs/tags/v{{ version }}.tar.gz
  sha256: f66d3a747effd7a0d5c1e7599886f7b9687d9e2cb5abedf8fd9b70b93fc3a234

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}sed               # [win]
    - {{ posix }}grep              # [win]
    - {{ posix }}autoconf
    - {{ posix }}automake          # [not win]
    - {{ posix }}automake-wrapper  # [win]
    - {{ posix }}pkg-config
    - {{ posix }}make
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - libblas
    - liblapack
    - _openmp_mutex                # [linux]
    - llvm-openmp                  # [osx]
    - r-base
    - r-rcpp
    - r-rcpparmadillo
    - r-base
    - r-magrittr
    - r-assertthat
    - r-config
    - r-data.table >=1.13
    - r-dplyr >=1.0.0
    - r-furrr
    - r-gdalutilities
    - r-ggplot2
    - r-lubridate >=1.7.0
    - r-purrr >=0.3.0
    - r-raster >=3.4
    - r-reshape2
    - r-rCurl
    - r-rstac
    - r-scales
    - r-sf >=0.9
    - r-slider >=0.1.5
    - r-tibble >=3.0
    - r-terra >=1.0.10
  run:
    - r-base
    - r-magrittr
    - r-assertthat
    - r-config
    - r-data.table >=1.13
    - r-dplyr >=1.0.0
    - r-furrr
    - r-gdalutilities
    - r-ggplot2
    - r-lubridate >=1.7.0
    - r-purrr >=0.3.0
    - r-raster >=3.4
    - r-reshape2
    - r-rCurl
    - r-rstac
    - r-scales
    - r-sf >=0.9
    - r-slider >=0.1.5
    - r-tibble >=3.0
    - r-terra >=1.0.10

test:
  commands:
    - $R -e "library('sits')"           # [not win]
    - "\"%R%\" -e \"library('sits')\""  # [win]

about:
  home: https://github.com/e-sensing/sits
  license: GPL-3.0-or-later
  summary: |
    The sits R package provides a set of tools for analysis, visualization and classification of satellite image time series. The main aim of SITS is to support land cover and land change classification of image data cubes using machine learning methods. The basic workflow in SITS is:

    1. Create a data cube using image collections available in the cloud or in local machines.
    2. Extract time series from the data cube which are used as training data.
    3. Perform quality control and filtering on the samples.
    4. Train a machine learning model using the extracted samples.
    5. Classify the data cube using the trained model.
    6. Post-process the classified images.
    7. Evaluate the accuracy of the classification using best practices.

  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3
    - LICENSE

extra:
  recipe-maintainers:
    - conda-forge/r
    - TomAugspurger
