{% set version = "2.22.1" %}

package:
  name: coda
  version: {{ version }}

source:
  url: https://github.com/stcorp/coda/releases/download/{{ version }}/coda-{{ version }}.tar.gz
  sha256: dd1cd0112d09cea29afa1568d644f54eccffdad2f5909708b519c1d7c647e9f1
  patches:
    - findjpeg.patch

build:
  number: 1

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - cmake
    - make  # [not win]
    - bison  # [not win]
    - flex  # [not win]
    - m2-bison  # [win]
    - m2-flex  # [win]

  host:
    - python
    - jpeg
    - zlib
    - hdf4
    - hdf5

  run:
    - python
    - numpy
    - cffi

test:
  commands:
    - test -f $PREFIX/lib/libcoda$SHLIB_EXT  # [unix]
    - if not exist "%LIBRARY_PREFIX%/lib/libcoda.lib" exit 1  # [win]
    - if not exist "%LIBRARY_PREFIX%/bin/codacmp.exe" exit 1  # [win]
  imports:
    - coda

about:
  home: https://github.com/stcorp/coda
  license: BSD-3-Clause-Clear
  license_family: BSD
  license_file: COPYING
  summary: CODA is the Common Data Access framework that allows reading of scientific data from various data formats, including structured ascii, structured binary, XML, netCDF, CDF, HDF4, HDF5, GRIB, RINEX and SP3. It provides a single consistent hierarchical view on data independent of the underlying storage format.

extra:
  recipe-maintainers:
    - srepmub
    - svniemeijer
