{% set version = "2.17.3" %}
{% 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:
    - {{ cran_mirror }}/src/contrib/OpenMx_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/OpenMx/OpenMx_{{ version }}.tar.gz
  sha256: 6c95ed99a4595bf0ffd1d284f4f0907334e18c40d1a3cfc5c7e3a980c46357e8

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('m2w64_cxx') }}  # [win]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}sed               # [win]
    - {{ posix }}grep              # [win]
    - {{ posix }}autoconf
    - {{ posix }}automake          # [not win]
    - {{ posix }}automake-wrapper  # [win]
    - {{ posix }}pkg-config
    - {{ posix }}make
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [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
    - {{ native }}gcc-libs         # [win]
    - 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: http://openmx.ssri.psu.edu, https://github.com/OpenMx/OpenMx
  license: Apache 2.0
  license_file: LICENSE
  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
    - dbast
    - khusmann
