{% set xorg_name = "libXdmcp" %}
{% set xorg_category = "lib" %}
{% set name = "xorg-" ~ xorg_name %}
{% set version = "1.1.5" %}
{% set sha256 = "d8a5222828c3adab70adf69a5583f1d32eb5ece04304f7f8392b6a353aa2228c" %}
{% set am_version = "1.16" %} # keep synchronized with build.sh

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

source:
  url: https://www.x.org/releases/individual/{{ xorg_category }}/{{ xorg_name }}-{{ version }}.tar.xz
  sha256: {{ sha256 }}
  patches:
    - windows.patch  # [win]

build:
  number: 1
  run_exports:
    - {{ pin_subpackage(name|lower) }}

requirements:
  build:
    - m2-autoconf                   # [win]
    - m2-automake{{ am_version }}   # [win]
    - m2-libtool                    # [win]
    - pkg-config                    # [unix]
    - m2-pkg-config                 # [win]
    - gnuconfig                     # [unix]
    - m2-base                       # [win]
    - make                          # [unix]
    - m2-make                       # [win]
    - {{ compiler("c") }}           # [unix]
    - {{ stdlib("c") }}             # [unix]
    - {{ compiler("m2w64_c") }}     # [win]
    - {{ stdlib("m2w64_c") }}       # [win]
    - autoconf                      # [unix]
    - automake                      # [unix]
    - gettext                       # [unix]
    - libtool                       # [unix]
  host:
    - xorg-util-macros
    - xorg-xorgproto

test:
  commands:
    {% set lib_idents = [ "Xdmcp" ] %}
    {% for lib_ident in lib_idents %}
    - test -f $PREFIX/lib/lib{{ lib_ident }}.dylib  # [osx]
    - test -f $PREFIX/lib/lib{{ lib_ident }}.so  # [linux]
    - if not exist %PREFIX%/Library/lib/lib{{ lib_ident }}.dll.a exit /b 1  # [win]
    - if not exist %PREFIX%/Library/bin/msys-{{ lib_ident }}-*.dll exit /b 1  # [win]
    {% endfor %}

about:
  home: https://www.x.org/
  dev_url: https://gitlab.freedesktop.org/xorg/lib/libxdmcp
  license: MIT
  license_family: MIT
  license_file: COPYING
  summary: 'The X-windows display manager client protocol library.'

extra:
  recipe-maintainers:
    - pkgw
