{% set version = "3.1-13" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/sem_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/sem/sem_{{ version }}.tar.gz
  sha256: 07749f710ad800f43cacdff8f1aa4f20105a619c72be4465f29860c381242f65

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_cxx') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-mass
    - r-boot
    - r-matrixcalc
    - r-mi >=0.9_99
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-mass
    - r-boot
    - r-matrixcalc
    - r-mi >=0.9_99

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

about:
  home: http://socserv.socsci.mcmaster.ca/jfox/
  license: GPL-2.0-or-later
  summary: Functions for fitting general linear structural equation models (with observed and latent variables) using the RAM approach, and for fitting structural equations in observed-variable models by two-stage least squares.
  license_family: GPL3
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  recipe-maintainers:
    - conda-forge/r
