Creating the keyboard layout file
I too used Ukelele to generate a keyboard layout. You can then export the
.keylayout file and copy it to
sudo cp KeyboardLayout.keylayout /Library/Keyboard\ Layouts/
If you want to have the icon for the keyboard bundled in one file Ukelele offers an export to Bundle option. So in this case copy the
.bundle file instead. Alternatively, you can keep the icons separate and copy them with the same name to the same folder.
sudo cp KeyboardLayout.icns /Library/Keyboard\ Layouts/
After a reboot you can add the input source in System Preferences->Keyboard->Input Sources menu. Probably available under Others or the language if you attached a language to the keyboard in Ukelele.
How to create an .icns file
Then add the following PNGs to the folder:
# All sizes necessary
You don't need all these, but this is the official list. Some are redundant in pixel count, but indicate density.
iconutil --convert icns --output layout.icns layout.iconset/
Example project on GitHub
My Ukrainian-Russian project on GitHub is a demo that is currently working on Mavericks 10.9.5.