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

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

source:
  fn: BASIX_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/BASIX_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/BASIX/BASIX_{{ version }}.tar.gz
  sha256: 2d06b08d5880650707dbd50423ea5d8baa8b1f6b3177432fb56e6a1ec3deb3a1

build:
  merge_build_host: True  # [win]
  number: 1002
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed  # [win]
    - {{ posix }}coreutils  # [win]
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: https://CRAN.R-project.org/package=BASIX
  license: GPL-2
  summary: 'BASIX provides some efficient C/C++ implementations to speed up calculations in R. '
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - conda-forge/r
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
    - npavlovikj
