package:
  name: oommf
  version: "2.0a1"

# On Windows, we install from precompiled binary packages.
# On Unix, we build from source.
source:
   url: https://github.com/fangohr/oommf/archive/20a1_20180930.tar.gz  # [not win]
   url: https://github.com/fangohr/oommf/raw/master/precompiled/oommf20a1_20180930_86_x64.zip  # [win]
   sha256: c871e0dbb1522c3c1314af6c084b90cdbe69fd869b55ac94443851b74f818ed2  # [not win]
   sha256: f5c0caf758399b88e18b5798dc947cf0394865b2a4926f70362b5fd1c7299364  # [win]
   patches:
     - mmarchive.patch
     - oc.patch

build:
  number: 1001

requirements:
  build:
    - {{ compiler('c') }}  # [not win]
    - {{ compiler('cxx') }}  # [not win]
    - {{ cdt('xorg-x11-proto-devel') }}  # [linux]
    - {{ cdt('libx11-devel') }}  # [linux]
    - {{ cdt('libxau') }}  # [linux]
    - {{ cdt('libxcb') }}  # [linux]
    - curl  # [win]
    - 7za  # [win]
  host:
    - tk
    - zlib
  run:
    - tk
    - zlib

test:
  commands:
    - oommf +version  # [unix]
    - tclsh %PREFIX%\opt\oommf\oommf.tcl boxsi +fg %PREFIX%\opt\oommf\app\oxs\examples\stdprob4.mif -exitondone 1  # [win]

about:
  home: http://math.nist.gov/oommf/
  license_file: oommf/LICENSE  # [unix]
  license_file: LICENSE  # [win]
  license: Custom
  summary: 'Object Oriented MicroMagnetic Framework (OOMMF)'

  description: |
    The Object Oriented MicroMagnetic Framework (OOMMF) forms a
    completely functional micromagnetics package. OOMMF is written in
    C++. For portable user interfaces, it uses Tcl/Tk so that OOMMF
    operates across a wide range of Unix, Windows, and MacOSX
    platforms.

    The recipe for building OOMMF conda package was developed by
    Thomas Kluyver, Ryan A. Pepper, Marijan Beg, and Hans Fangohr
    at the University of Southampton and European XFEL GmbH as a part of
    OpenDreamKit – Horizon 2020 European Research Infrastructure project (676541).

    This conda package version contains Dzyaloshinskii-Moriya extensions,  # [unix]
    for crystallographic classes Cnv, T(O), and D2d, which  # [unix]
    which are not included in the OOMMF binaries and tarballs from NIST.  # [unix]
    For details about these extensions please visit https://github.com/fangohr/oommf.git.  # [unix]

  doc_url: http://math.nist.gov/oommf/doc/

extra:
  recipe-maintainers:
    - fangohr
    - marijanbeg
    - takluyver
    - davidcortesortuno
    - rpep
    - sergii-mamedov
