{% set version = "4.0.5" %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' 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: 25df6826ea5e93241c4874cad4fa8dadc87a40f4ff74c9107aa12a9e033e1578

build:
  merge_build_host: true  # [win]
  number: 2
  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]
    - {{ compiler('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
    - {{ native }}gcc-libs         # [win]
    - 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
