{% set version = '2.9.6' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-openmx
  version: {{ version|replace("-", "_") }}

source:
  fn: OpenMx_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/OpenMx_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/OpenMx/OpenMx_{{ version }}.tar.gz
  sha256: c8275de2eb2c8b711b8a58854057dcd11a202ddbc5586704598adfcbb3c18104

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - make
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-bh >=1.60
    - r-mass
    - r-matrix
    - r-rcpp
    - r-rcppeigen
    - r-stanheaders >=2.10.0.2
    - r-digest
    - r-rpf >=0.45

  run:
    - r-base
    - r-bh >=1.60
    - r-mass
    - r-matrix
    - r-rcpp
    - r-rcppeigen
    - r-stanheaders >=2.10.0.2
    - r-digest
    - r-rpf >=0.45

test:
  commands:
    - $R -e "library('OpenMx')"  # [not win]
    - "\"%R%\" -e \"library('OpenMx')\""  # [win]

about:
  home: https://github.com/OpenMx/OpenMx
  license: Apache 2.0
  summary: 'Facilitates treatment of statistical model specifications as things that can be generated
    and manipulated programmatically. Structural equation models may be specified with
    reticular action model matrices or paths, linear structural relations matrices or
    paths, or directly in matrix algebra. Fit functions include full information maximum
    likelihood, maximum likelihood, and weighted least squares. Example models include
    confirmatory factor, multiple group, mixture distribution, categorical threshold,
    modern test theory, differential equations, state space, and many others.  MacOS
    users can download the most up-to-date  package binaries from <http://openmx.ssri.psu.edu>.
    See Neale, Hunter, Pritikin, Zahery, Brick, Kirkpatrick, Estabrook, Bates, Maes, & Boker
    (2016) <doi:10.1007/s11336-014-9435-8>.'
  license_family: APACHE

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
