{% set name = "starlink-ast" %}
{% set version = "9.2.3" %}

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

source:
  url: https://github.com/Starlink/ast/releases/download/v{{ version }}/ast-{{ version }}.tar.gz
  sha256: 4d7e28a2f30cd11ded5751c9b134d2365939beb70ccd4acd75cfeec7bb76faeb
  patches:
    - patches/osx-11-configure.patch
    - patches/cross-compile-makefile.patch

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


requirements:
  build:
    - make
    - gnuconfig  # [unix]
    - {{ compiler('c') }}
    - libtool  # [unix]

  host:
    - yaml

test:
  commands:
    - test -f ${PREFIX}/include/star/ast.h
    - test -f ${PREFIX}/lib/libast${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_drama${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_ems${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_err${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_grf3d${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_grf_2.0${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_grf_3.2${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_grf_5.6${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_pgplot${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_pgplot3d${SHLIB_EXT}  # [unix]
    - test -f ${PREFIX}/lib/libast_pal${SHLIB_EXT}  # [unix]

about:
  home: http://starlink.eao.hawaii.edu/starlink/AST
  doc_url: http://starlink.eao.hawaii.edu/devdocs/sun211.htx/sun211.html
  dev_url: https://github.com/Starlink/ast
  license: LGPL-2.0-only
  license_file: COPYING
  summary: A Library for Handling World Coordinate Systems in Astronomy
  description: |
    The AST library provides a comprehensive range of facilities for attaching world coordinate systems to astronomical data, for retrieving and interpreting that information and for generating graphical output based on it. It's main selling points are:

    * Ease of use.
    * Facilities for generating plots of generalised non-linear, potentially discontinuous 2-D or 3-D coordinate systems, with detailed control of the appearance of the plot.
    * Facilities for converting transparently between different coordinate systems, including a wide range of celestial, spectral and time coordinate systems.
    * Facilities for searching a general collection of connected coordinate systems for a coordinate system with any given set of characteristics.
    * Allows code for handling WCS information to be written in a general way without regard to the specific nature of the coordinate systems being handled (i.e. whether they represent sky positions, spectral positions, focal plane positions, pixel positions, etc).
    * Flexible system for saving and retrieving WCS information, including (but not limited to) a range of different popular FITS descriptions.
    * Written in C but has interfaces for C, Fortran, Python, Java (via JNI), Perl, and UNIX shell.
    * Extensive documentation.
    * LGPL licence.

extra:
  recipe-maintainers:
    - brianv0
    - timj
