[haiku-commits] Re: haiku: hrev46901 - build/jam/packages src/data/keymaps src/preferences/keymap

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 22 Feb 2014 00:45:51 +0100

On 02/21/2014 11:56 PM, John Scipione wrote:
On Fri, Feb 21, 2014 at 12:22 AM,  <jscipione@xxxxxxxxx> wrote:
374cf8c: Localize keymap names in Keymap preferences

                                     [ Ingo Weinhold <ingo_weinhold@xxxxxx> ]

Hey Ingo, this was a long time coming, sorry I took so long to getting
around to committing this. What are the changes that I can convince
you to do a similar thing for keyboard layouts?

Unfortunately I don't have much time ATM.

If you don't have time, which I'd understand, I can try to do it
myself... I was thinking of moving the layout files to
src/data/keyboards and giving them a .keyboard extension because I
don't know the build system well enough to localize them unless I copy
the keymap localization method above.

Moving/renaming the file really isn't necessary, though it probably is a good idea to create a directory src/data/keyboard_layouts with a Jamfile for the necessary operations to create the header.

You should move all the keyboard layout related jam code from build/jam/packages/Haiku there, save for the three AddFilesToPackage invocations. Rename the variables keyboardLayoutFiles, appleAluminumFiles, thinkPadFiles to HAIKU_KEYBOARD_LAYOUT_FILES[_APPLE_ALUMINUM,THINKPAD] and make them non-local.

You can then copy and adjust the GenerateKeymapLocalizationHeader rule (I just noticed the keymaps parameter is superfluous and can be omitted) and GenerateKeymapLocalizationHeader1 actions. You can actually even pull the code out of the rule; only the actions are really needed.

You'll probably also want to localize the subdirectory names, so introduce global variables for the directory names and create header entries for them as well.

As an improvement -- due to the fact that the keyboard layout names are all listed in the Jamfile -- you can replace the "Always $(header)" by something like:

local jamfile = [ FGristFiles Jamfile ] ;
SEARCH on $(jamfile) = $(SUBDIR) ;
Depends $(header) : $(jamfile) ;

CU, Ingo


Other related posts: