{% set version = "2.10.10" %}

package:
  name: coin-or-cbc-meta
  version: {{ version }}

source:
  url: https://github.com/coin-or/Cbc/archive/releases/{{ version }}.tar.gz
  sha256: f394efecccc40a51bf79fba2c2af0bc92561f3e6b8b6e4c6e36d5e70986f734f

build:
  number: 0
  skip: true  # [blas_impl != "openblas"]

outputs:
  - name: coin-or-cbc
    script: build_package.sh
    build:
      run_exports:
        - {{ pin_subpackage("coin-or-cbc", min_pin='x.x', max_pin='x.x') }}

    requirements:
      build:
        - gnuconfig  # [unix]
        - {{ compiler('c') }}
        - {{ compiler('cxx') }}
        - pkg-config
        - make  # [unix]
      host:
        - coin-or-cgl 0.60.5
        - coin-or-clp 1.17.7
        - coin-or-osi 0.108.7
        - coin-or-utils 2.11.6
        - openblas {{ openblas }}         # [blas_impl == "openblas"]
      run:
        - bzip2
        - zlib
        - readline
        - libopenblas                     # [blas_impl == "openblas"]
        # To stop the compiler pulling in an openmp implementation itself
        - _openmp_mutex                   # [linux]
      run_constrained:
        - coincbc * *_metapackage

    test:
      files:
        - test.lp
      commands:
        - test -f $PREFIX/lib/libCbc${SHLIB_EXT}
        - test -f $PREFIX/include/coin/CbcConfig.h
        - test -f $PREFIX/lib/libCbcSolver${SHLIB_EXT}
        - test -f $PREFIX/lib/libOsiCbc${SHLIB_EXT}
        - cbc -import test.lp -solve -solution '$' | tr -s ' ' | grep '1 y 1 0'
        - cbc test.lp solve solution '$' | tr -s ' ' | grep '1 y 1 0'

    about:
      home: https://github.com/coin-or/Cbc
      dev_url: https://github.com/coin-or/Cbc
      doc_url: https://coin-or.github.io/Cbc/Doxygen/
      license: EPL-2.0
      license_family: OTHER
      license_file: LICENSE
      summary: COIN-OR branch and cut (Cbc)
      description: |
        Cbc (Coin-or branch and cut) is an open-source mixed integer linear
        programming solver written in C++. It can be used as a callable library or
        using a stand-alone executable. It can be called through AIMMS (through the
        AIMMSlinks project), AMPL (natively), CMPL, GAMS (through the GAMSlinks
        project), JuMP, Mathematica, MiniZinc, MPL (through the CoinMP project), PuLP,
        Python (e.g., cbcpy), and OpenSolver for Excel, among others.

  - name: coincbc
    build:
      noarch: generic
      string: {{ PKG_BUILDNUM }}_metapackage
    requirements:
      run:
        - coin-or-cbc {{ version }}
    test:
      commands:
        - test -f $PREFIX/lib/libCbc${SHLIB_EXT}


about:
  home: https://github.com/coin-or/Cbc
  dev_url: https://github.com/coin-or/Cbc
  doc_url: https://coin-or.github.io/Cbc/Doxygen/
  license: EPL-2.0
  license_family: OTHER
  license_file: LICENSE
  summary: COIN-OR branch and cut (Cbc)
  description: |
    Cbc (Coin-or branch and cut) is an open-source mixed integer linear
    programming solver written in C++. It can be used as a callable library or
    using a stand-alone executable. It can be called through AIMMS (through the
    AIMMSlinks project), AMPL (natively), CMPL, GAMS (through the GAMSlinks
    project), JuMP, Mathematica, MiniZinc, MPL (through the CoinMP project), PuLP,
    Python (e.g., cbcpy), and OpenSolver for Excel, among others.


extra:
  recipe-maintainers:
    - wolfv
    - tkralphs
    - h-vetinari
  feedstock-name: coin-or-cbc
