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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/Rdsdp_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/Rdsdp/Rdsdp_{{ version }}.tar.gz
  sha256: 5718973839ab5e9213755726c9f7995c75d31bae5230b7a5037a795fc705970a

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [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]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - libblas
    - liblapack
    - r-base
  run:
    - libblas
    - liblapack
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: https://www.mcs.anl.gov/hs/software/DSDP
  license: GPL-3.0-only
  summary: R interface to DSDP semidefinite programming library. The DSDP software is a free open source implementation of an interior-point method for semidefinite programming. It provides primal and dual solutions, exploits low-rank structure and sparsity in the data, and has relatively low memory requirements for an interior-point
    method.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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