# Prior to conda-forge, Copyright 2018-2019 Peter Williams and collaborators.
# This file is licensed under a 3-clause BSD license; see LICENSE.txt.

{% set name = "epoxy" %}
{% set version = "1.5.4" %}
{% set sha256 = "0bd2cc681dfeffdef739cb29913f8c3caa47a88a451fd2bc6e606c02997289d2" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://github.com/anholt/libepoxy/releases/download/{{ version }}/libepoxy-{{ version }}.tar.xz
  sha256: {{ sha256 }}

build:
  number: 2
  skip: true  # [win and vc<14]
  run_exports:
    - {{ pin_subpackage('epoxy', max_pin='x.x') }}

requirements:
  build:
    - meson
    - ninja
    - pkg-config
    - pthread-stubs  # [linux]
    - {{ compiler('c') }}
    - {{ cdt('mesa-libEGL-devel') }}  # [linux]
    - {{ cdt('mesa-libGL-devel') }}  # [linux]
    - {{ cdt('libx11-devel') }}  # [linux]
    - {{ cdt('xorg-x11-proto-devel') }}  # [linux]
    - {{ cdt('xorg-x11-util-macros') }}  # [linux]

test:
  commands:
    - test -f $PREFIX/include/epoxy/common.h  # [unix]
    - test -f $PREFIX/lib/libepoxy${SHLIB_EXT}  # [unix]
    - if not exist %PREFIX%\\Library\\include\\epoxy\\common.h exit 1  # [win]
    - if not exist %PREFIX%\\Library\\bin\\epoxy-0.dll exit 1  # [win]
    - if not exist %PREFIX%\\Library\\lib\\epoxy.lib exit 1  # [win]

about:
  home: https://github.com/anholt/libepoxy
  license: MIT
  license_family: MIT
  license_file: COPYING
  summary: 'A library for handling OpenGL function pointer management for you.'
  description: |
    Epoxy is a library for handling OpenGL function pointer management for you.

    It hides the complexity of dlopen(), dlsym(), glXGetProcAddress(),
    eglGetProcAddress(), etc. from the app developer, with very little
    knowledge needed on their part. They get to read GL specs and write code
    using undecorated function names like glCompileShader().

    Don't forget to check for your extensions or versions being present before
    you use them, just like before! We'll tell you what you forgot to check
    for instead of just segfaulting, though.
  dev_url: https://github.com/anholt/libepoxy

extra:
  recipe-maintainers:
    - ryanvolz
    - stuarteberg
    - tschoonj
