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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/PROJ_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/PROJ/PROJ_{{ version }}.tar.gz
  sha256: dde90cfeca83864e61a7422e1573d2d55bb0377c32b9a8f550f47b8631121ce7

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: https://github.com/hypertidy/PROJ
  license: GPL-3.0-only
  summary: Currently non-operational, a harmless wrapper to allow package 'reproj' to install
    and function while relying on the 'proj4' package.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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