Migrate from using both build and install to override-build

I’m using both the build and install keywords:

Since they’re deprecated now, my snap doesn’t build any more. From the deprecation notices (dn8, dn9) i understood this was the correct way to do it:

It seems this is not entirely correct, though. I’m not exactly sure why, but snapcraft seems to try to still try to run some default build. Here’s where it’s failing:

Building desktop-gtk2 
+ snapcraftctl build
make FLAVOR=gtk2 -j4
gcc -Wall -O2 -o bindtextdomain.so -fPIC -shared ./../src/bindtextdomain.c -ldl
make FLAVOR=gtk2 install DESTDIR=/home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install
install -D -m755 desktop-launch /home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install/bin/desktop-launch
install -D -m644 flavor-select /home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install/
install -D -m644 bindtextdomain.so /home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install/
+ export XDG_DATA_DIRS=/home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install/usr/share
+ update-mime-database /home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install/usr/share/mime
+ [ -f /home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install/usr/share/icons/Adwaita//index.theme ]
+ gtk-update-icon-cache-3.0 -q /home/neothethird/Code/ubports-installer/dist/__snap-x64/parts/desktop-gtk2/install/usr/share/icons/Adwaita/
+ which gtk-update-icon-cache-3.0
/bin/sh: 36: gtk-update-icon-cache-3.0: not found
Failed to run 'override-build': Exit code was 127.
  ⨯ exit status 2

Adding gtk-update-icon-cache to the build-packages doesn’t help. Sorry for this specific support question, but i’m pretty sure this was introduced by the deprecation of these keywords…

Your yaml is showing that you wanted desktop-glib-only but your build output shows it building desktop-gtk2. The error appears to be something wrong with the desktop-gtk2 part not finding an executable file it requires for the build.

Deprecation doesn’t means it gets to break; if it really is the case (which I certainly hope not as we have tests still using build and install for such purposes), then please log a bug.