[buildout]


extends =
  ../zlib/buildout.cfg
  ../cups/buildout.cfg
  ../../component/automake/buildout.cfg
  ../../component/xorg/buildout.cfg

parts = 
  java-openjdk

[bootstrap-jdk]
recipe = slapos.recipe.build:download-unpacked
url = https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
md5sum = f5da6f4dec81bdd2a096184ec1d69216
location = /tmp/bootstrap-jdk/

[java-openjdk]
recipe = slapos.recipe.cmmi
#url = https://hg.openjdk.java.net/jdk-updates/jdk12u/archive/390566f1850a.tar.gz
url = file:///srv/slapgrid/slappart9/srv/runner/390566f1850a.tar.gz 
md5sum = 5ae2dcc44ebb9f012a53af21348453e0

CFLAGS = -I${libX11:location}/include -I${xproto:location}/include -I${xorgproto:location}/include -I${libXi:location}/include -I${libXtst:location}/include -I${libXext:location}/include -I${xextproto:location}/include -I${zlib:location}/include -I${libXrender:location}/include -I${libXrandr:location}/include -I${libXtst:location}/include -I${libXt:location}/include -I${cups:location}/include -I${fontconfig:location}/include -I${alsa:location}/include

CXXFLAGS =  ${:CFLAGS}
LDFLAGS = -L${libX11:location}/lib -L${xproto:location}/lib -L${xorgproto:location}/lib -L${libXi:location}/lib -L${libXtst:location}/lib -L${libXext:location}/lib -L${xextproto:location}/lib -L${zlib:location}/lib -L${libXrandr:location}/lib -L${libXtst:location}/lib -L${libXt:location}/lib -L${libXrender:location}/lib -L${cups:location}/lib -L${fontconfig:location}/lib -L${alsa:location}/lib


rpaths = 

configure-command = ./configure

pre-configure =
  set -e
  echo $PWD 
  chmod a+x ./configure
  echo mode set

#openjdk configure ignores environment
configure-options =
  PKG_CONFIG="${pkgconfig:location}/bin/pkg-config"
  
  --x-includes='${libX11:location}/include'
  --x-libraries='${libX11:location}/lib'
  --with-stdc++lib=dynamic 
  --with-extra-cflags="${:CFLAGS}" 
  --with-extra-cxxflags="${:CXXFLAGS}" 
  --with-extra-ldflags="${:LDFLAGS}" 
  --with-boot-jdk='${bootstrap-jdk:location}'
  --enable-unlimited-crypto 
  --disable-warnings-as-errors 
  --with-cups='${cups:location}'
  --with-fontconfig='${fontconfig:location}'
  --with-freetype='bundled'
  --with-alsa='${alsa:location}'

environment = 
  PATH=${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:${pkgconfig:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${pixman:location}/lib/pkgconfig:${fontconfig:location}/lib/pkgconfig:${fontconfig:pkg_config_depends}:${libXext:location}/lib/pkgconfig:${libXext:pkg_config_depends}:${fribidi:location}/lib/pkgconfig:${harfbuzz:location}/lib/pkgconfig:${harfbuzz:pkg_config_depends}:${atk:location}/lib/pkgconfig:${alsa:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig:${libpng:location}/lib/pkgconfig
