{% set name = "openjdk" %}
{% set version = "11.0.1" %}
{% set zulu_build = "11.2.3" %}
{% set openjdk_revision = "13" %}
{% set build_number = 1018 %}

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

source:
  - url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-linux_x64.tar.gz  # [linux64]
    sha256: 232b1c3511f0d26e92582b7c3cc363be7ac633e371854ca2f2e9f2b50eb72a75  # [linux64]

  - url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-macosx_x64.zip  # [osx]
    sha256: 1b7baa8b24f3185d6913e38d204321c8ba45b9cf35461c88d7dffc577508837d  # [osx]

  - url: https://cdn.azul.com/zulu/bin/zulu{{ zulu_build }}-jdk{{ version }}-win_x64.zip  # [win64]
    sha256: 8e1e2b8347de6746f3fd1538840dd643201533ab113abc4ed93678e342d28aa3  # [win64]

  - url: https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.zip  # [linux64]
    sha256: 7576310b219e04159d35ff61dd4a4ec4cdba4f35c00e002a136f00e96a908b0a  # [linux64]
    folder: fonts  # [linux64]

  - url: https://hg.openjdk.java.net/jdk-updates/jdk{{ version.split(".")[0] }}u/archive/jdk-{{ version }}+{{ openjdk_revision }}.tar.bz2   # [linux64]
    sha256: c6a50a814008d80f489bbb7e761e417f24db4461b6a6df5e210f484b738b1ff6  # [linux64]
    folder: src    # [linux64]

build:
  number: {{ build_number }}

requirements:
  build:
    - {{ compiler('cxx') }}   # [linux]
    - pkg-config        # [linux]
    - autoconf          # [linux]
    - unzip             # [linux]
    - zip               # [linux]
  host:
    - zlib              # [linux or osx]
    - freetype          # [linux]
    - harfbuzz          # [linux]
    - libpng            # [linux]
    - giflib            # [linux]
    - jpeg              # [linux]
    - libcups           # [linux]
    - alsa-lib          # [linux]
    - fontconfig        # [linux]
    - xorg-libx11       # [linux]
    - xorg-libxext      # [linux]
    - xorg-libxt        # [linux]
    - xorg-libxtst      # [linux]
    - xorg-libxrender   # [linux]
    - xorg-libxrandr    # [linux]
    - xorg-libxi        # [linux]
    - lcms2             # [linux]
    - vs2013_runtime    # [win]
  run:
    - xorg-libx11       # [linux]
    - xorg-libxext      # [linux]
    - xorg-libxtst      # [linux]
    - xorg-libxrender   # [linux]
    - xorg-libxi        # [linux]
    - {{ pin_compatible("alsa-lib", max_pin="x.x.x") }}     # [linux]
    - vs2013_runtime    # [win]

test:
  requires:
    - {{ compiler('c') }}  # [not win]
  files:
    - test-jni  # [not win]
    - test-jni.sh  # [not win]
    - test-nio
  commands:
    - java -version
    - ./test-jni.sh  # [not win]

about:
  home: https://www.azul.com/products/zulu/  # [not linux]
  home: https://openjdk.java.net             # [linux]
  license: GPL-2.0
  license_family: GPL
  license_file:
    - LICENSE
    - fonts/LICENSE   # [linux]
  summary: The Zulu OpenJDK build.           # [not linux]
  summary: An open-source implementation of the JDK   # [linux]
  description: Zulu OpenJDK is an open source build of the Java JDK.   # [not linux]

extra:
  recipe-maintainers:
    - johanneskoester
    - sodre
    - mingwandroid
    - hadim
