{% set name = "pgplot" %}
{% set majmin = "5.2" %}
{% set patch = "2" %}
{% set sha256 = "a5799ff719a510d84d26df4ae7409ae61fe66477e3f1e8820422a9a4727a5be4" %}

package:
  name: {{ name|lower }}
  version: {{ majmin }}.{{ patch }}

source:
  fn: {{ name }}{{ majmin }}.tar.gz
  url: ftp://ftp.astro.caltech.edu/pub/pgplot/{{ name }}{{ majmin }}.tar.gz
  sha256: {{ sha256 }}
  patches:
    - drivers.patch
    - gfortran.patch
    - png-setjmp.patch
    - sharedcpg.patch
    - prefix.patch
    - late-binding-drivers.patch
    - osx.patch  # [osx]
    - cross-compile-makemake.patch  # [build_platform != target_platform]

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

requirements:
  build:
    - {{ compiler('fortran') }}
    - {{ compiler('c') }}
  host:
    - libpng
    - xorg-libx11
    - zlib
  run:
    - libpng
    - xorg-libx11
    - zlib

test:
  commands:
    - test -x $PREFIX/bin/pgxwin_server
    - test -f $PREFIX/lib/libpgplot.a  # [unix]
    - test -f $PREFIX/lib/libpgplot.so  # [linux]
    - test -f $PREFIX/lib/libpgplot.dylib  # [osx]

about:
  home: http://www.astro.caltech.edu/~tjp/pgplot/
  license: LicenseREf-pgplot
  license_file: copyright.notice
  summary: 'A FORTRAN plotting library'

extra:
  recipe-maintainers:
    - pkgw
