{% set name = "wcslib" %}
{% set version = "7.3" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: ftp://ftp.atnf.csiro.au/pub/software/{{ name }}/{{ name }}-{{ version }}.tar.bz2
  sha256: 4b01cf425382a26ca4f955ed6841a5f50c55952a2994367f8e067e4183992961
  patches:
    - no-x-tests.patch  # avoid deluges of pgplot warnings
    - cross-compiling-configure.patch  # [build_platform != target_platform]

build:
  number: 1
  skip: true  # [win]

requirements:
  build:
    - gnuconfig  # [unix]
    - {{ compiler('c') }}
    - {{ compiler('fortran') }}
    - flex
  host:
    - cfitsio
    - pgplot 5.2.*  # [not win]
  run:
    - cfitsio
    - pgplot 5.2.*  # [not win]

test:
  commands:
    # Main validation performed in 'make check' stage
    - test -f $PREFIX/lib/libwcs$SHLIB_EXT

about:
  home: http://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/
  license: LGPL-3.0-or-later
  license_file: COPYING.LESSER
  summary: 'Library for World Coordinate System computations'

extra:
  recipe-maintainers:
    - pkgw
