{% set version = "3.15.6" %}
{% set sha256 = "537e5249011ce90bdffae057994daedd89ae6351667f0aa89ab6918935caf5bc" %}

package:
  name: epics-base
  version: {{ version }}

source:
  fn: base-{{ version }}.tar.gz
  url: https://epics.anl.gov/download/base/base-{{ version }}.tar.gz
  sha256: {{ sha256 }}
  patches:
    - config_site.diff  # [not win]
    - config_common.diff  # [not win]
    - config_readline.diff  # [linux]

build:
  number: 0

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - make  # [not win]
    - m2w64-make  # [win]
    - perl  # [win]

test:
  commands:
    - test -f ${PREFIX}/epics/bin/${EPICS_HOST_ARCH}/caget  # [not win]
    - test -f ${PREFIX}/epics/include/epicsVersion.h  # [not win]
    - test -f ${PREFIX}/epics/lib/${EPICS_HOST_ARCH}/libCom${SHLIB_EXT}  # [not win]
    - if %ARCH%==32 (set EPICS_HOST_ARCH=win32-x86) else if %ARCH%==64 (set EPICS_HOST_ARCH=windows-x64)  # [win]
    - if not exist %PREFIX%\epics\bin\%EPICS_HOST_ARCH%\caget.exe exit 1  # [win]
    - if not exist %PREFIX%\epics\bin\%EPICS_HOST_ARCH%\Com.dll exit 1  # [win]
    - if not exist %PREFIX%\epics\lib\%EPICS_HOST_ARCH%\Com.lib exit 1  # [win]
    - if not exist %PREFIX%\epics\include\epicsVersion.h exit 1  # [win]

about:
  home: http://www.aps.anl.gov/epics
  license: Epics Open
  license_file: LICENSE
  summary: EPICS Base Library

extra:
  recipe-maintainers:
    - simongregorebner
    - tacaswell
