Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#10064 closed bug (fixed)

Unable to use Canna input method

Reported by: X512 Owned by: bonefish
Priority: blocker Milestone: R1/beta1
Component: Servers/input_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by diver)

After introduction of package management, Canna input method doesn't work anymore. I tried to move the method in non-packaged of home folder, but nothing happens. No input method icon in deskbar and no canna looper thread in input_server. Alt+Space doesn't work either.

Attachments (7)

canna-x86.hpkg.zip (826.0 KB ) - added by mt 11 years ago.
sample canna package (gcc4)
0001-CannaIM-copy-data-files-to-user-setting-directory.patch (4.1 KB ) - added by mt 11 years ago.
0002-CannaIM-copy-data-files-to-user-setting-directory.patch (4.1 KB ) - added by mt 11 years ago.
canna-x86.hpkg (831.2 KB ) - added by mt 11 years ago.
sample canna package (gcc4)
canna-1.0.1_20140705.recipe (1.0 KB ) - added by mt 10 years ago.
CannaIM.zip (1.0 MB ) - added by mt 10 years ago.
Source code, separated from Haiku repository
canna-1.0.2_20140807.recipe (1.1 KB ) - added by mt 10 years ago.

Change History (30)

comment:1 by diver, 11 years ago

Component: Add-Ons/Input MethodsServers/input_server
Description: modified (diff)
Owner: changed from korli to bonefish
Status: newassigned

It looks like add-ons directories are being monitored:

B_USER_NONPACKAGED_ADDONS_DIRECTORY,
B_USER_ADDONS_DIRECTORY,
B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY

http://cgit.haiku-os.org/haiku/tree/src/servers/input/AddOnManager.cpp#n257

But putting canna in either non-packaged dir and restarting input_server via hey input_server -q or even rebooting doesn't result in canna add-on being loaded according to listimage | grep canna.

Changing component to input_server for now.

comment:2 by mt, 11 years ago

Hi, It seems canna fails to make "/boot/system/data/Canna/dic/user" and "/boot/system/data/Canna/dic/group" in http://cgit.haiku-os.org/haiku/tree/src/add-ons/input_server/methods/canna/rk/context.c#n98, so CannaMethod::InitCheck() fails. I think /boot/system/data/Canna/ may be read / write.

comment:3 by X512, 11 years ago

This files should be moved to /boot/home/config/settings/Canna folder.

comment:4 by mt, 11 years ago

Hi, I make canna package (gcc4), please test (put it to home/config/packages and restart). I put canna data to "home/config/settings/global" by "global-writable-files" method, because it is only method to put files under "config/settings" on package activation. any ideas?

After PM, we can choose these method to distribute canna.

  1. Make canna package, install via HaikuDepot (install to /system)
  2. Make canna package, put it in system/optional, install by user (install to /home)
  3. Make canna add-on, put it in system/optional, install by user (install to /home)

I think method 1 is better, but I can't put data files to "home/config/settings" on package activation by method 1..

by mt, 11 years ago

Attachment: canna-x86.hpkg.zip added

sample canna package (gcc4)

comment:5 by diver, 11 years ago

As a side note: no need to zip hpkg packages as they already compressed.

comment:6 by bonefish, 11 years ago

Building a package for canna is the way to go. Since the sources live in the Haiku tree, the build system should do that. Until we have a package repository for the packages the build system builds, there is no way to install it via HaikuDepot, though.

Regarding the data files, I don't know what those are and how they are used. Generally there are the following categories:

  • Read-only data should go somewhere in the "data" directory.
  • Writable data created by the software should go in "cache" or "var", depending on the nature of the data.
  • System-wide configuration/settings data should go in "/system/settings", respectively "~/config/settings/global", depending on where the package is installed. The package can provide a default configuration that can be specified via the global-writable-file attribute.
  • Per-user settings should only be created/written by the software at run-time. If the software includes a default settings file, it should be installed in "data" and it should be used as a fallback when the user's settings file is not present. When the per-user settings are written they should always be written to "~/config/settings".

comment:7 by mt, 11 years ago

Thanks for suggestion, I rewrote to copy data files to config/settings.

comment:8 by mt, 11 years ago

patch: 01

comment:9 by bonefish, 11 years ago

Thanks for the patch!

I still don't know what the data files are used for, so I can't really comment on whether copying them to the user's settings directory is a good solution. Disregarding that question, here are a few comments on your patch:

  • For finding the data directory, instead of using find_directory() to iterate through B_USER_DATA_DIRECTORY and B_SYSTEM_DATA_DIRECTORY, the new BPathFinder API should be used. That would look like:
    status = BPathFinder(B_CURRENT_IMAGE_SYMBOL).FindPath(
      B_FIND_PATH_DATA_DIRECTORY, "Canna", B_FIND_PATH_EXISTING_ONLY, path);
    
  • copyData() should rather be named _CopyData().
  • The includes should be sorted alphabetically. "CopyEngine.h" being a private header should be in a separate block.

comment:10 by mt, 11 years ago

Thanks suggestion! I modified patch. I use both BPathFinder() and BPathFinder(B_CURRENT_IMAGE_SYMBOL) so that user can use either input method add-on from boot/system/optional or package.

With BPathFinder():

  • put add-on bellow system/non-packaged with /boot/system/data/Canna -> works after restarting Haiku.
  • put add-on bellow home/config/non-packaged with /boot/system/data/Canna -> works without restarting Haiku.
  • put package into system/packages with /boot/system/data/Canna -> works after restarting Haiku.
  • put package into home/config/packages with /boot/system/data/Canna -> works after restarting Haiku.
  • put package into system/packages without /boot/system/data/Canna -> works after restarting Haiku.
  • put package into home/config/packages without /boot/system/data/Canna -> do not work.

With BPathFinder(B_CURRENT_IMAGE_SYMBOL):

  • put add-on bellow system/non-packaged with /boot/system/data/Canna -> do not work.
  • put add-on bellow home/config/non-packaged with /boot/system/data/Canna -> do not work.
  • put package into system/packages with /boot/system/data/Canna -> works after restarting Haiku.
  • put package into home/config/packages with /boot/system/data/Canna -> works after restarting Haiku.
  • put package into system/packages without /boot/system/data/Canna -> works after restarting Haiku.
  • put package into home/config/packages without /boot/system/data/Canna -> works after restarting Haiku.

by mt, 11 years ago

Attachment: canna-x86.hpkg added

sample canna package (gcc4)

in reply to:  9 comment:11 by mt, 11 years ago

Replying to bonefish:

I still don't know what the data files are used for, so I can't really comment on whether copying them to the user's settings directory is a good solution.

In Ubuntu, Canna files located as:

  • Fallback dictionary list and settings file -> /etc/canna/
  • System wide dictionary -> /var/lib/canna/dic/canna
  • Group Dictionary -> /var/lib/canna/dic/group
  • Each user's dictionary -> /var/lib/canna/dic/user
  • Sample key bindings files etc. -> /usr/share/canna

So In haiku, I think files put to:

  • Fallback dictionary list and settings file -> /etc/Canna/
  • System wide dictionary -> /var/Canna/dic
  • Sample key bindings files etc. -> /boot/system/data/Canna
  • Each user's dictionary -> /boot/home/settings/config/Canna/dic
  • Each user's dictionary list and settings file -> /boot/home/settings/config/Canna

I'm trying to move user dictionary to /boot/home/settings/config/Canna/dic. If I finish it, I will change other data paths.

comment:12 by pulkomandy, 10 years ago

Milestone: R1R1/alpha5

Moving to alpha5 milestone, shipping without an input method for CJK languages is not acceptable.

comment:13 by X512, 10 years ago

Some little question: what is official way to enable this input method? Copying it manually from "optional" folder to home add-ons folder looks like a hack and not suitable for end user.

comment:14 by pulkomandy, 10 years ago

This was the official way until now. We will make a Canna package, and possibly automate its installation from ReadOnlyBootPrompt for the languages that use it.

comment:15 by mt, 10 years ago

Hi, I tried to move user dictionary, still I can't finish it. So, I make canna package for R1A5. Please test and apply it. (It seems we need restart system after install / uninstall canna via package.)

by mt, 10 years ago

Attachment: canna-1.0.1_20140705.recipe added

by mt, 10 years ago

Attachment: CannaIM.zip added

Source code, separated from Haiku repository

comment:16 by waddlesplash, 10 years ago

Priority: normalblocker

DEVS: where should this go? Part of Haiku's repo, deactivated by default but included in the normal build?

comment:17 by jessicah, 10 years ago

Resolution: fixed
Status: assignedclosed

I've added the attached recipe to HaikuPorts, and uploaded package for x86_gcc2.

However, if we're sticking with outsourcing like this, the source code should also be packaged up properly on somewhere like github.

comment:18 by mt, 10 years ago

Thanks, jessicah. I uploaded the source code to https://github.com/mt819/CannaIM, and update source, etc. I think canna works with x86_64 now.

by mt, 10 years ago

Attachment: canna-1.0.2_20140807.recipe added

comment:19 by luroh, 10 years ago

mt, since this ticket is closed, could you possibly add a pull request over at http://bb.haikuports.org/haikuports/ so that this is not forgotten? It would be the better place to track it now as well.

in reply to:  19 comment:20 by mt, 10 years ago

Replying to luroh:

mt, since this ticket is closed, could you possibly add a pull request over at http://bb.haikuports.org/haikuports/ so that this is not forgotten? It would be the better place to track it now as well.

Thanks luroh, I tried pull request from Bitbucket.

comment:21 by diver, 10 years ago

Should Canna be deleted from Haiku tree now that the package is outsourced to HaikuPorts repo?

comment:22 by pulkomandy, 10 years ago

Yes.

comment:23 by pulkomandy, 10 years ago

Milestone: R1/alpha5R1/beta1
Note: See TracTickets for help on using tickets.