{% set version = "4.5.2" %}

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

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

source:
  fn: bit64_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/bit64_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/bit64/bit64_{{ version }}.tar.gz
  sha256: a321563fd8830800ad51697055a2e580cda4fb84102420e4caeae44a5b6ac72e

build:
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - r-bit >=4.0.0              # [build_platform != target_platform]
    - {{ compiler('c') }}        # [not win]
    - {{ stdlib("c") }}          # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ stdlib("m2w64_c") }}          # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base
    - r-bit >=4.0.0

  run:
    - r-base
    - r-bit >=4.0.0

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

about:
  home: http://ff.r-forge.r-project.org/
  license: GPL-2.0-only
  summary: " Package 'bit64' provides serializable S3 atomic 64bit (signed) integers.  These are useful for handling database keys and exact counting in +-2^63. WARNING: do not use them as replacement for 32bit integers, integer64 are not supported for subscripting by R-core and they have different semantics when  combined
    with double, e.g. integer64 + double => integer64.  Class integer64 can be used in vectors, matrices, arrays and data.frames.  Methods are available for coercion from and to logicals, integers, doubles,  characters and factors as well as many elementwise and summary functions.  Many fast algorithmic operations such as
    'match' and 'order' support inter- active data exploration and manipulation and optionally leverage caching."
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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