# Use `conda-build-prepare` before building for a better version string.
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('v','') or '0.X.X', GIT_DESCRIBE_NUMBER|int,   GIT_DESCRIBE_HASH or 'gUNKNOWN') %}
{% set python_version = PYTHON_VERSION | default('3.7') %}
{% set py_suffix = 'py%s'|format(python_version|replace('.', '')) %}

package:
  name: yosys-uhdm
  version: {{ version }}

source:
  git_rev: uhdm-yosys
  git_url: https://github.com/antmicro/yosys.git
  patches:
    - yosys.patch

build:
  number: {{ environ.get('DATE_NUM') }}
  string: {{ environ.get('DATE_STR') }}_{{ py_suffix }}
  script_env:
    - CI

requirements:
  build:
    # These version restrictions make the dependencies resolvable with
    # packages from the `defaults` channel (libgcc-ng/libstdcxx-ng).
    - {{ compiler('c') }} <9
    - {{ compiler('cxx') }} <9
    - python {{ python_version }}
    - cmake
    - pkg-config
    - libuuid
    - gperftools
    - flex
    - libunwind
    - swig
    - ncurses
  run:
    - python {{python_version}}
    - ncurses
    - readline
    - libffi

test:
    commands:
        - uhdm-yosys --version

# Use `conda-build-prepare` before building for a better version string.
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('v','') or '0.X.X', GIT_DESCRIBE_NUMBER|int,   GIT_DESCRIBE_HASH or 'gUNKNOWN') %}
{% set python_version = PYTHON_VERSION | default('3.7') %}
{% set py_suffix = 'py%s'|format(python_version|replace('.', '')) %}

package:
  name: yosys-uhdm
  version: {{ version }}

source:
  git_rev: uhdm-yosys
  git_url: https://github.com/antmicro/yosys.git
  patches:
    - yosys.patch

build:
  number: {{ environ.get('DATE_NUM') }}
  string: {{ environ.get('DATE_STR') }}_{{ py_suffix }}
  script_env:
    - CI

requirements:
  build:
    # These version restrictions make the dependencies resolvable with
    # packages from the `defaults` channel (libgcc-ng/libstdcxx-ng).
    - {{ compiler('c') }} <9
    - {{ compiler('cxx') }} <9
    - python {{ python_version }}
    - cmake
    - pkg-config
    - libuuid
    - gperftools
    - flex
    - libunwind
    - swig
    - ncurses
    - bison
    - openjdk
  run:
    - python {{python_version}}
    - ncurses
    - readline
    - libffi

test:
    commands:
        - uhdm-yosys --version

Add missing packages used during building
yosys-uhdm: Add missing packages used during building
