[buildout]
extends =
  ../nspr/buildout.cfg
  ../sqlite3/buildout.cfg
  ../zlib/buildout.cfg

[nss]
recipe = slapos.recipe.cmmi
url = https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_45_RTM/src/nss-3.45.tar.gz
md5sum = f1752d7223ee9d910d551e57264bafa8
location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-command = make -j1 -C nss/coreconf/nsinstall all
# XXX How to build nss-config and pkg-config files ?
make-options =
  -j1
  -C nss
  NSPR_INCLUDE_DIR="${nspr:location}/include/nspr -I${zlib:location}/include"
  NSPR_LIB_DIR="${nspr:location}/lib -L${zlib:location}/lib"
  SQLITE_INCLUDE_DIR=${sqlite3:location}/include
  SQLITE_LIB_DIR=${sqlite3:location}/lib
  LDFLAGS="-Wl,-rpath=${:location}/lib -Wl,-rpath=${nspr:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${zlib:location}/lib"
  RPATH="-Wl,-rpath=${:location}/lib -Wl,-rpath=${nspr:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${zlib:location}/lib"
  all
post-install =
  cp -aLr dist/*OBJ/* ${:location}/
  mkdir -p ${:location}/include
  cp -aLr dist/public/nss ${:location}/include/
environment =
  BUILD_OPT=1
  USE_64=1
  NSS_USE_SYSTEM_SQLITE=1
