post_install() {
  mkdir -p mingw32/lib/gtk-3.0
  mingw32/bin/gtk-query-immodules-3.0.exe > mingw32/lib/gtk-3.0/immodules.cache
  mingw32/bin/gtk-update-icon-cache-3.0 -q -t -f mingw32/share/icons/hicolor
  mingw32/bin/gtk-update-icon-cache-3.0 -q -t -f mingw32/share/icons/Adwaita
  mingw32/bin/glib-compile-schemas.exe mingw32/share/glib-2.0/schemas

  settingsfile=mingw32/etc/gtk-3.0/settings.ini
  if test ! -f $settingsfile
  then
    echo [Settings]>>$settingsfile
    echo gtk-xft-antialias=1>>$settingsfile
    echo gtk-xft-hinting=1>>$settingsfile
    echo gtk-xft-hintstyle=hintfull>>$settingsfile
    echo gtk-xft-rgba=rgb>>$settingsfile
  fi
}

post_upgrade() {
  post_install
}

post_remove() {
  rm -f mingw32/lib/gtk-3.0/immodules.cache
  mingw32/bin/glib-compile-schemas.exe mingw32/share/glib-2.0/schemas
  mingw32/bin/gtk-update-icon-cache-3.0 -q -t -f mingw32/share/icons/hicolor
  mingw32/bin/gtk-update-icon-cache-3.0 -q -t -f mingw32/share/icons/Adwaita
}
