{% set version = "1.3-0" %}

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

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

source:
  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: 6289058f652989ca8a5ad6fa324ce1762cc9e36c42559c00929b70f762066ab6

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('fortran') }}        # [not win]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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.0-or-later
  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
