post_install() {
  echo "You need to login again or 'source /clang64/etc/profile.d/emscripten.sh'"
  echo "in your already running shells to be able to use emscripten."
  # Install config file
  WIN_PATH=$(cygpath -m /clang64)
  rm -rf ${WIN_PATH}/lib/emscripten/.emscripten
  cat > ${WIN_PATH}/lib/emscripten/.emscripten <<EOF
# .emscripten file for MSYS2 MinGW

import os
LLVM_ROOT='${WIN_PATH}/opt/emscripten-llvm/bin'
NODE_JS='${WIN_PATH}/bin/node.exe'
EOF
}

post_upgrade() {
  echo "You may need to manually clear your emscripten cache as clang may not link"
  echo "the new library versions with cached data properly. Use this command:"
  echo "$ emcc --clear-cache"
  echo "You may also need to delete ~/.emscripten if emscripten complains about old paths"
  echo "or executables not found."
}
