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

build:
  merge_build_host: true  # [win]
  number: 0
  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:
    - conda-forge/r
    - khusmann
