{% set name = "plumed" %}
{% set version = environ['VERSION'] %}

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

source:
  path: ../..

build:
  number: 0
  skip: True  # [win]
# Most programs should link libplumedWrapper.a so that libplumedKernel.so will be loaded
# with dlopen. There is no need for pinning thus.
# Programs linking libplumed.so should pin to min_pin='x.x', max_pin='x'.
# Programs linking libplumedKernel.so should pin to min_pin='x.x.x'. max_pin='x.x.x'.

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - llvm-openmp  # [osx]
    - make
# xxd is provided by package vim and used during build
    - vim  # [linux]
  host:
    - fftw
    - gsl
    - libblas
    - liblapack
    - llvm-openmp  # [osx]
    - xdrfile
    - zlib
  run:
    - gawk
    - llvm-openmp  # [osx]

test:
  commands:
    - plumed info --root
    - plumed info --long-version
    - plumed-patch -h
    - plumed config has external_blas external_lapack fftw gsl xdrfile zlib
    - $PREFIX/lib/plumed/plumed-runtime -h
    - test -f $PREFIX/lib/libplumed$SHLIB_EXT
    - test -f $PREFIX/lib/libplumedWrapper.a
    - test -f $PREFIX/lib/libplumedKernel$SHLIB_EXT
    - conda inspect linkages -p $PREFIX $PKG_NAME
    - conda inspect objects -p $PREFIX $PKG_NAME  # [osx]

about:
  home: http://www.plumed.org/
  license: LGPL-3.0
  license_family: GPL
  license_file: COPYING.LESSER
  summary: 'Free energy calculations in molecular systems'
  description: |
    PLUMED is an open source library for free energy calculations in
    molecular systems which works together with some of the most
    popular molecular dynamics engines.
  doc_url: https://www.plumed.org/doc
  dev_url: https://github.com/plumed/plumed2

extra:
  recipe-maintainers:
    - GiovanniBussi
