{% set version = '1.1.0' %}

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

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

source:
  fn: cyclocomp_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/cyclocomp_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/cyclocomp/cyclocomp_{{ version }}.tar.gz
  sha256: cdbf65f87bccac53c1527a2f1269ec7840820c18503a7bb854910b30b71e7e3e

build:
  merge_build_host: True  # [win]
  number: 1

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-callr
    - r-crayon
    - r-desc
    - r-remotes
    - r-withr

  run:
    - r-base
    - r-callr
    - r-crayon
    - r-desc
    - r-remotes
    - r-withr

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

about:
  home: https://github.com/MangoTheCat/cyclocomp
  license: MIT
  summary: Cyclomatic complexity is a software metric (measurement), used to indicate the complexity
    of a program. It is a quantitative measure of the number of linearly independent
    paths through a program's source code. It was developed by Thomas J. McCabe, Sr.
    in 1976.
  license_family: MIT
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\MIT'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
