{% set name = "Magics" %}
{% set version = "4.2.3" %}

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

source:
  url: https://confluence.ecmwf.int/download/attachments/3473464/{{ name }}-{{ version }}-Source.tar.gz
  sha256: 2f996ab4a9e86c778e73e55ff95fb156eb74fc921709c3dcd7eb566755fa19d2
  patches:
    - 0001-Find-proj_6_0.lib-if-proj.lib-isn-t-found.patch

build:
  number: 1
  skip: True  # [(win and vc<14)]
  detect_binary_files_with_prefix: true

requirements:
  build:
    - cmake
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - m2-bash  # [win]
    - m2-findutils  # [win]
    - m2-coreutils  # [win]
    - m2-grep  # [win]
    - m2-sed  # [win]
    - m2-gawk  # [win]
    - m2-diffutils  # [win]
    - m2-unzip  # [win]
  host:
    - pkg-config  # [not win]
    - boost
    - expat
    - glib  # [not win]
    - pango  # [not win]
    - cairo  # [not win]
    - proj
    - eccodes
    - libnetcdf
    - pthreads-win32  # [win]
    - libiconv  # [win]
    - jinja2
    - zlib
    - magics-python
  run:
    - expat
    - pango  # [not win]
    - cairo  # [not win]
    - proj
    - eccodes
    - simplejson
    - libnetcdf
    - pthreads-win32  # [win]
    - libiconv  # [win]
    - zlib
    - magics-python
  run_constrained:
    # magics is incompatible with magics-metview
    - magics-metview ==9999999999

test:
  commands:
    - printf "%s\n" "${MAGPLUS_HOME:?MAGPLUS_HOME is not set}"  # [not win]
    - set | grep "MAGPLUS_HOME"  # [win]
  imports:
    - Magics
    - Magics.macro
    - Magics.metgram
    - Magics.toolbox

about:
  home: https://software.ecmwf.int/wiki/display/MAGP/
  license: Apache-2.0
  license_file:
    - LICENSE_for_source_files
    - COPYING
    - LICENSE

  license_family: Apache
  summary: "ECMWF's Meteorological plotting software."

extra:
  recipe-maintainers:
    - kynan
    - carletes
    - StephanSiemen
    - dtip
    - iainrussell
