{% set version = '1.2-0' %}

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

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

source:
  fn: lsei_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/lsei_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/lsei/lsei_{{ version }}.tar.gz

  sha256: 4781ebd9ef93880260d5d5f23066580ac06061e95c1048fb25e4e838963380f6

build:
  merge_build_host: True  # [win]
  number: 1005
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://cran.r-project.org/web/packages/lsei/index.html
  license: GPL (>= 2)
  summary: It contains functions that solve least squares linear regression problems under linear
    equality/inequality constraints. Functions for solving quadratic programming problems
    are also available, which transform such problems into least squares ones first.
    It is developed based on the 'Fortran' program of Lawson and Hanson (1974, 1995),
    which is public domain and available at <http
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'
extra:
   recipe-maintainers:
    - conda-forge/r
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
