{% set version = '1.1-1' %}

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

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

source:
  fn: goftest_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/goftest_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/goftest/goftest_{{ version }}.tar.gz
  sha256: db6cb1ff6e18520b172e93fca5d7d953bd2d06f4af73bf90aa0a09df8cad71a0

build:
  number: 0
  script: R CMD INSTALL --build .
  skip: True  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/


requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - libgcc  # [linux]
    - libgfortran  # [osx]

test:
  commands:
    - $R -e "library('goftest')"  # [not win]
    - "\"%R%\" -e \"library('goftest')\""  # [win]
    - conda inspect linkages -p $PREFIX r-goftest  # [not win]
    - conda inspect objects -p $PREFIX r-goftest  # [osx]

about:
  home: https://CRAN.R-project.org/package=goftest
  license: GPL (>= 2)
  summary: Cramer-Von Mises and Anderson-Darling tests of goodness-of-fit for continuous univariate
    distributions, using efficient algorithms.
  license_family: GPL3

extra:
  recipe-maintainers:
    - jsignell
