{% set version = "2.48.0" %}

package:
  name: graphviz
  version: {{ version }}

source:
  - url: https://gitlab.com/graphviz/graphviz/-/archive/{{ version }}/graphviz-{{ version }}.tar.gz
    sha256: 85a2beca9a1a58da3ba7237a63aad2e612f7e3afa990591a9971d2077f1f5937
    patches:
      - patches/0001-Rename-vpsc-block.h-vpsc-v_block.h.patch
      - patches/0002-Add-CMake-option-INSTALL_DEPENDENCY_DLLS-default-off.patch
      - patches/0003-Specify-dependency-on-expat-for-lib-common.patch
      - patches/0004-Always-link-to-getopt-on-Windows.patch
      - patches/0005-Remove-requirement-of-hard-coded-DLLs-in-PATH.patch
      - patches/0006-Add-support-for-GTS-in-CMake-builds.patch
      - patches/0007-Fix-logic-for-finding-harfbuzz.patch
    # Prefer header only compat layer, even though m2-libtool might work
  - url: https://gitlab.com/graphviz/graphviz-windows-dependencies/-/raw/c7eafb3c/x64/include/ltdl.h
    sha256: a3cf376bca2965634ba05926d4065a46331e71c487d84a4c6aceb795e9458bfd
    folder: ltdl_compat

build:
  number: 0
  detect_binary_files_with_prefix: true  # [unix]

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - pkg-config                                          # [unix]
    - make                                                # [unix]
    - bison                                               # [unix]
    - libtool                                             # [unix]
    - automake                                            # [unix]
    - autoconf                                            # [unix]
    - cmake                                               # [win]
    - ninja                                               # [win]
    - python >=3
    - m2-gawk                                             # [win]
    - m2-flex                                             # [win]
    - m2-bison                                            # [win]
    - perl                                                # [win]
  host:
    # --with-pangocairo=yes
    - cairo
    # --with-expat=yes
    - expat
    # --with-freetype2
    - freetype                                            # [unix]
    # --with-fontconfig=yes
    - fontconfig                                          # [unix]
    # --with-gts=yes
    - gts
    # --with-gdk-pixbuf=yes
    - gdk-pixbuf                                          # [unix]
    # --with-gdk=yes
    - gtk2                                                # [unix]
    # pangocairo requires glib
    - glib
    - libglib
    # --with-libgd=yes
    - libgd
    # --with-rsvg=yes
    - librsvg                                             # [unix]
    # --enable-ltdl
    - libtool                                             # [unix]
    # --with-webp=yes
    - libwebp-base                                        # [unix]
    # --with-pangocairo=yes
    - pango
    # default requirement
    - zlib                                                # [unix]
    # Windows only deps
    - getopt-win32                                        # [win]

  run:
    # A few satisfy needs via run_exports, rest rely on pin_run_as_build
    # Add all of them anyway ¯\_(ツ)_/¯
    - cairo
    - expat                                               # [unix]
    - gts
    - gtk2                                                # [unix]
    - libgd
    - libglib
    - librsvg                                             # [unix]
    - libtool                                             # [unix]
    - libwebp-base                                        # [unix]
    - pango
    - zlib                                                # [unix]
    - fonts-conda-ecosystem                               # [unix]
    # Not linked in directly, likely interface deps? add 'em anyway!
    - gdk-pixbuf                                          # [unix]
    - fontconfig                                          # [unix]
    - freetype                                            # [unix]

test:
  files:
    - sample.dot

about:
  home: http://www.graphviz.org/
  license: EPL-1.0
  license_family: Other
  license_file: COPYING
  summary: Open Source graph visualization software.
  description: |
    Graphviz is an open source graph visualization software. Graph visualization
    is a way of representing structural information as diagrams of abstract
    graphs and networks.
  doc_url: https://graphviz.gitlab.io/documentation/
  dev_url: https://gitlab.com/graphviz/graphviz/

extra:
  recipe-maintainers:
    - jakirkham
    - ccordoba12
    - ocefpaf
    - johanneskoester
    - nehaljwani
