{% set version = '5.6.13' %}

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

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

source:
  fn: lpSolve_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/lpSolve_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/lpSolve/lpSolve_{{ version }}.tar.gz
  sha256: d5d41c53212dead4fd8e6425a9d3c5767cdc5feb19d768a4704116d791cf498d

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

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

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

about:
  home: https://CRAN.R-project.org/package=lpSolve
  license: LGPL-2
  summary: Lp_solve is freely available (under LGPL 2) software for solving linear, integer and
    mixed integer programs. In this implementation we supply a "wrapper" function in
    C and some R functions that solve general linear/integer problems, assignment problems,
    and transportation problems. This version calls lp_solve version 5.5.
  license_family: LGPL

extra:
  recipe-maintainers:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
