{% set version = '1.0.5' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/fansi_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/fansi/fansi_{{ version }}.tar.gz
  sha256: c616ce357fbfd43253c366da578549a38066459058c22fb99c82fc05992e23f6

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: unitizer, knitr, rmarkdown
requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{native}}gcc-libs         # [win]

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('fansi')"           # [not win]
    - "\"%R%\" -e \"library('fansi')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://github.com/brodieG/fansi
  license: GPL-2 | GPL-3
  summary: Counterparts to R string manipulation functions that account for the effects of ANSI
    text formatting control sequences.
  license_family: GPL3
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - mingwandroid

# The original CRAN metadata for this package was:

# Package: fansi
# Title: ANSI Control Sequence Aware String Functions
# Description: Counterparts to R string manipulation functions that account for the effects of ANSI text formatting control sequences.
# Version: 1.0.5
# Authors@R: c( person("Brodie", "Gaslam", email="brodie.gaslam@yahoo.com", role=c("aut", "cre")), person("Elliott", "Sales De Andrade", role="ctb"), person(family="R Core Team", email="R-core@r-project.org", role="cph", comment="UTF8 byte length calcs from src/util.c" ))
# Depends: R (>= 3.1.0)
# License: GPL-2 | GPL-3
# URL: https://github.com/brodieG/fansi
# BugReports: https://github.com/brodieG/fansi/issues
# VignetteBuilder: knitr
# Suggests: unitizer, knitr, rmarkdown
# Imports: grDevices, utils
# RoxygenNote: 7.2.3
# Encoding: UTF-8
# Collate: 'constants.R' 'fansi-package.R' 'internal.R' 'load.R' 'misc.R' 'nchar.R' 'strwrap.R' 'strtrim.R' 'strsplit.R' 'substr2.R' 'trimws.R' 'tohtml.R' 'unhandled.R' 'normalize.R' 'sgr.R'
# NeedsCompilation: yes
# Packaged: 2023-10-07 16:15:12 UTC; bg
# Author: Brodie Gaslam [aut, cre], Elliott Sales De Andrade [ctb], R Core Team [cph] (UTF8 byte length calcs from src/util.c)
# Maintainer: Brodie Gaslam <brodie.gaslam@yahoo.com>
# Repository: CRAN
# Date/Publication: 2023-10-08 19:30:05 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
