{% set version = "4.9.3" %}

package:
  name: proj4
  version: {{ version }}

source:
  - url: http://download.osgeo.org/proj/proj-{{ version }}.tar.gz
    sha256: 6984542fea333488de5c82eea58d699e4aff4b359200a9971537cd7e047185f7
  - url: http://download.osgeo.org/proj/proj-datumgrid-1.6.zip
    sha256: 054e7b63b474926c79f25fbe5cd8760351e8d93e5a167b5473e993c01bb08866
    folder: nad

build:
  number: 7
  run_exports:
    # so name changes in bugfix revisions.  Pin to bugfix revision.
    #    https://abi-laboratory.pro/tracker/timeline/proj/
    - {{ pin_subpackage('proj4', max_pin='x.x.x') }}

requirements:
  build:
    - cmake  # [win]
    - {{ compiler('c') }}

test:
  commands:
    # Check if NAD27/NAD83 datum shifting is present if `conus` is present.
    - test -f $PREFIX/share/proj/conus  # [not win]
    - if not exist %PREFIX%\\Library\\SHARE\\conus exit 1  # [win]
    - echo -105 40 | proj +proj=utm +zone=13 +ellps=WGS84
    - echo -117 30 | cs2cs +proj=latlong +datum=NAD27 +to +proj=latlong +datum=NAD83
    - echo -105 40 | cs2cs +init=epsg:4326 +to +init=epsg:2975
    - conda inspect linkages -p $PREFIX proj4  # [not win]
    - conda inspect objects -p $PREFIX proj4  # [osx]

about:
  home: http://trac.osgeo.org/proj
  license: MIT
  license_file: COPYING
  summary: 'Cartographic projection software.'

extra:
  recipe-maintainers:
    - ocefpaf
    - pelson
    - msarahan
