Skip to content

Improve and standardize input methods - #11254

Merged
21 commits merged into
NixOS:masterfrom
ericsagnes:standardize-im
Feb 22, 2016
Merged

21 commits merged into
NixOS:masterfrom
ericsagnes:standardize-im

Conversation

@ericsagnes

Copy link
Copy Markdown
Contributor

Work in progress, please do not merge yet.
implementation of #11138

Status

fcitx:

  • add nix module
  • fcitx-mozc: init at 2.17.2105.102
  • fcitx-hangul: init at 0.3.0
  • fcitx-chewing: init at 0.2.2
  • fcitx-table-other: init at 0.2.3
  • fcitx-m17n: init at 0.2.3
  • fcitx-qt5: init at 1.0.4
  • fcitx: 4.2.8.5 -> 4.2.9
  • group engines

ibus:

  • group engines
  • refactor nix module
  • add ibus-hangul
  • add ibus-m17n
  • fix ibus-mozc licence

Librairies:

  • libchewing: init at 0.4.0 Cherry picked in master

nabi:

  • add nix module

uim:

  • add nix module

Documentation:

  • add documentation for input methods

Current issues

  • fcitx-anthy: any touch beside letters and numbers is inactive. -> Fixed by upgrading ibus-anthy to 0.2.2.
  • fcitx-configtool: fails to start fcitx-config-gtk3
  • fcitx-config-gtk3: "settings" button has no effect -> Fixed by using ibus-wrapper

Current packaging issues

  • ibus-hangul:
    • ibus-hangul-setup tool is giving runtime errors Fixed by the use of ibus-wrapper
    • toolbar icon missing, seems common to all ibus engines. Need more investigation. -> fixed by adding hicolor_icon_theme to ibus_wrapper
  • sunpinyin: lib, data, fcitx packaged separately. fcitx engine miss to find the dictionary file:
    looking for /lib/sunpinyin/data/lm_sc.t3g but data is in /share/sunpinyin/lm_sc.t3g
    -> Splitting sunpinyin packaging in a future PR

Testing

preparing a custom nixpkgs

  1. get a copy of nixpkgs

    git clone https://github.com/NixOS/nixpkgs.git
    cd nixpkgs
    
  2. get this PR

    git fetch origin pull/11254/head:standardize-im
    
  3. add nixpgs-channel as a remote and get nixos-unstable

    git remote add channels https://github.com/NixOS/nixpkgs-channels.git
    git fetch channels nixos-unstable
    git checkout nixos-unstable
    
  4. create a test branch based on standardize-im

    git checkout standardize-im
    git branch test/11254
    
  5. rebase test/11254

    git rebase --onto nixos-unstable master test/11254
    

    note: A few conflicts in nixos/modules/module-list.nix might happen.

Fcitx

in /etc/nixos/configuration.nix add:

  i18n.inputMethod = {
    enabled = "fcitx";
    fcitx.engines = with pkgs.fcitx-engines; [ hangul mozc anthy chewing table-other ];
  };

and rebuild using the custom nixpkgs:

nixos-rebuild -I nixpkgs=/PATH/TO/CUSTOM/NIXPKGS switch

After restarting the X server, fcitx should be active.
note: mozc might require a computer reboot to work.

IBus

in /etc/nixos/configuration.nix add:

  i18n.inputMethod = {
    enabled = "ibus";
    ibus.engines = with pkgs.ibus-engines; [ hangul mozc anthy ];
  };

Uim

in /etc/nixos/configuration.nix add:

  i18n.inputMethod.enabled = "uim";

nabi

in /etc/nixos/configuration.nix add:

  i18n.inputMethod.enabled = "nabi";

and rebuild using the custom nixpkgs:

nixos-rebuild -I nixpkgs=/PATH/TO/CUSTOM/NIXPKGS switch

After restarting the X server, ibus should be active.
note: mozc might require a computer reboot to work.

Testing

Each input method and engine combination should be tested on as many applications toolkits as possible.

sample applications:

  • Gtk2: geany
  • Gtk3: gnome3.gedit
  • Qt4: kde4.kate
  • Qt5: quasselClient_qt5, kde5.kate
    • pyqt5: qutebrowser
  • Elementary: e19.terminology
  • wxWidgets: filezilla
  • Java: jedit

Test results

IM GTK2 GTK3 Qt4 Qt5 PyQt5 Elementary wxWidgets Java
Fcitx ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
Ibus ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯
uim ◯ ◯ ◯ -- -- ◯ ◯ ◯
nabi ◯ ◯ ◯ -- -- ◯ ◯ ◯

◯ working
X not working
-- not supported

Fcitx PyQt5

fcitx-qt5 is using qt55 but pyqt5 is using qt54, will be fixed when pyqt5 will be updated to qt55 -> Fixed

Possible improvements

  • The ibus-wrapper and fcitx-wrapper code (taken from pidgin plugins) feels like it could be improved.

Updates

  • 10 Feb: added ibus related commits
  • 13 Feb fixed ibus icon issues, updated the testing section
  • 17 Feb: added uim and nabi commits
    resolved conflicts with release-notes
  • 19 Feb: fixed typo in description (configure.nix -> configuration.nix)
    removed module rename for programs.ibus.enable
  • 20 Feb: added fcitx-m17n and ibus-m17n, updated the changelog accordingly

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @iyzsong and @cdepillabout to be potential reviewers.

@ericsagnes ericsagnes changed the title {WIP] Improve and standardize input methods [WIP] Improve and standardize input methods Nov 25, 2015
@ericsagnes
ericsagnes force-pushed the standardize-im branch 2 times, most recently from 97e0061 to 0b65771 Compare November 25, 2015 11:04
@ghost

ghost commented Nov 25, 2015

Copy link
Copy Markdown

the preInstall hook of fcitx-qt5:

    substituteInPlace platforminputcontext/cmake_install.cmake \
       --replace ${qt5.base} $out

fails for me.

it seems that in the generated cmake_install.cmake file,
a qtbase path refered by extra-cmake-modules is used,
but it is different with qt5.base from buildInputs.

And:

$ nix-store -qR /nix/store/*extra-cmake-module*/ | grep qtbase
 /nix/store/52zc0n2m872yjr2zs6janc6v26ggb62l-qtbase-5.5.1
$ nix-build -A qt5.base`, show:
 /nix/store/h11crcgkl89v3pixrdbp65syc3qpz2na-qtbase-5.4.2

@ttuegel , how to get the qtbase that ECM using?

@ttuegel

ttuegel commented Nov 25, 2015

Copy link
Copy Markdown
Member

@iyzsong The package needs to be upgraded to Qt 5.5; the manual describes how Qt packaging has changed. If your package requires extra-cmake-modules, you should add it to kf5PackagesFun if it provides a library or use kf5_stable.callPackage instead of callPackage if it is simply an application; this will ensure that the package expression is provided a consistent set of dependencies.

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@iyzsong I updated the commit, could you try again?
The new path of fcitx-qt5 is kf5Packages.fcitx-qt5.

@ttuegel Thanks for the information. The updated module works fine with kf5Packages.quassel_client but fails with qutebrowser that is using pyqt5. Am I missing something in the derivation?

@ghost

ghost commented Nov 26, 2015

Copy link
Copy Markdown

ah, cool! I have to do my homework though :-)

@ghost

ghost commented Nov 26, 2015

Copy link
Copy Markdown

I have cherry-pick 3 commit to master, hope it's ok.

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@iyzsong As I tested so far, there are some issues with fcitx and qutebrowser that is a qt5 application using pyqt5. On my dev env, I have some problems with uim and Qt applications.
Toolkits modules seems a little tricky to make work and are quite tedious to test.

I would suggest to test each input method and engine on a different set of applications (Qt, GTK, ..), and if possible gather some feedback from multiple users to be sure it is working before further merging to master.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide a better description of what Fctix input method is.

@nbp nbp added 0.kind: enhancement Add something new or improve an existing system. 9.needs: reporter feedback This issue needs the person who filed it to respond 9.needs: changelog This PR needs a changelog entry 9.needs: documentation This needs to be documented well. 8.has: package (new) This PR adds a new package 8.has: module (new) This PR adds a module in `nixos/` 2.status: work-in-progress labels Nov 26, 2015
@laMudri

laMudri commented Dec 5, 2015

Copy link
Copy Markdown
Contributor

I'm the maintainer of ibus-table and ibus-table-others. They currently don't do anything, and I plan on working on them over the next few weeks. If I manage to make something useful, how should I share it? Should I pretend that this PR doesn't exist and structure things in the old way, or do some IBus refactoring before starting?

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@laMudri Thanks for the input. This PR might take some take to get ready as it still require some work, tests and documentation. I hope we can get some more work done during this month Tokyo NixOS meetup.

I should be able to push an updated version of the PR based on current master with a few more commits for uim and ibus this week so you could use it and push your updates on that branch.

But as your work is more likely to be merged in master before this PR, using the current structure and a dedicated PR should be easier and faster (and would just require to rebase this PR on the new master).

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@ttuegel I am stuck trying to make the fcitx-qt5 plugin work with PyQt5 application (qutebrowser).

I thought the problem was on the qutebrowser/pyqt5 side as fcitx-qt5 works fine with normal Qt5 applications, so I tried to use the wrapQtProgram and calling the qutebrowser package with qt5Libs.callPackage but it didn't solve the issue.

What do you think could be the cause?

@ttuegel

ttuegel commented Dec 18, 2015

Copy link
Copy Markdown
Member

@ericsagnes Currently, PyQt5 in Nixpkgs is built with Qt 5.4, so it isn't going to be compatible with fcitx-qt5 built with Qt 5.5. This is a pretty common problem with Qt plugins. Perhaps the maintainers (@svanderburg @iyzsong) can tell us if PyQt5 can be upgraded to Qt 5.5? It would be best if we could add it to qt5LibsFun so that there would always be a version of PyQt5 available for every version of Qt 5 in Nixpkgs.

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@ttuegel Thanks, I tried to update pyqt to use Qt 5.5 and the input method worked fine.
Just by curiosity, is there any special reason to have qt5 defaulting to qt54 while qt5Libs is defaulting to qt55?

@ttuegel

ttuegel commented Dec 18, 2015

Copy link
Copy Markdown
Member

@ericsagnes Most packages that depend on Qt 5 have not been updated to the new Qt infrastructure yet, so I can't automatically switch their Qt version. I'm waiting on the package maintainers, basically.

@ericsagnes

Copy link
Copy Markdown
Contributor Author

update: I just saw that @astsmtl packaged m17n so I added the fcitx-m17n and ibus-m17n packages to the PR. Thank you @astsmtl!

So now, this PR should bring input support for most non-alphabet languages.
Non alphabet input support being a must have feature in many countries, it would be great if we can have this PR merged for 16.03!
Please let me know if there is anything I can do to speed up the review/merge process.

@ghost ghost added 8.has: package (update) This PR updates a package to a newer version 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS and removed 2.status: work-in-progress labels Feb 20, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no services for input method before, so I think just add them to the "new services" para should be enough.

@ericsagnes ericsagnes changed the title [WIP] Improve and standardize input methods Improve and standardize input methods Feb 20, 2016
@ghost

ghost commented Feb 20, 2016

Copy link
Copy Markdown

Expect the release-note, all commits look good to me, I think it's mergeable.
But I haven't actually test them (my setup is out of sync with master, low speed to hydra, etc.).

You should send an email to the nix-dev to draw more attention :-)

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@iyzsong Thanks for the review! I updated the release notes.

@laMudri

laMudri commented Feb 20, 2016

Copy link
Copy Markdown
Contributor

IBus works on my machine. ibus-hangul doesn't (I mean, switching to it doesn't affect the input), but that's a different issue. I'll look into it.

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@laMudri ibus-hangul need some special setup to work.

  1. add hangul to the ibus methods
  2. hit alt+space until hangul is active
  3. hit shift+space to enable hangul mode

If you left click the hangul symbol in the systray, you should be able to change the shortcut for the hangul mode and other different settings. You can also launch the tool directly by running ibus-setup-hangul.

@laMudri

laMudri commented Feb 20, 2016

Copy link
Copy Markdown
Contributor

Yep, all working, then.

@grahamc

grahamc commented Feb 20, 2016

Copy link
Copy Markdown
Member

Another note is these lint issues:

22:06:18.262 > ibus-with-plugins: Lacks a maintainer
22:06:18.263 > ibus-with-plugins: Lacks a platform
22:06:18.263 > ibus-with-plugins: Lacks a license
22:06:18.263 > ibus-with-plugins: Lacks a description

Not sure if they need to be fixed, just a reminder.

@ericsagnes

Copy link
Copy Markdown
Contributor Author

@grahamc Thanks for pointing. Yes, I raised some concerns in the issues description related *-with-plugins package. Actually the code is coming from fcitx-with-plugins that is in turn based on pidgin-with-plugins.
I created a dedicated issue ( #13156 ) about on this, as it has a wider scope than this PR.

@taku0

taku0 commented Feb 21, 2016

Copy link
Copy Markdown
Contributor

Confirmed that uim (Anthy and SKK) works on Konsole (Qt4) and Firefox (GTK+2).

It does not work on Flash nor text fields on uim-pref-gtk and uim-pref-gtk3, but it seems not related to this PR because it does not work on stable branch neither.

ghost pushed a commit that referenced this pull request Feb 22, 2016
Improve and standardize input methods
@ghost
ghost merged commit 7fcecec into NixOS:master Feb 22, 2016
@ghost

ghost commented Feb 22, 2016

Copy link
Copy Markdown

I have test fcitx with various plugins, work fine.
Merged, thanks your work!

@ericsagnes

Copy link
Copy Markdown
Contributor Author

Thanks for merging!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: enhancement Add something new or improve an existing system. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 8.has: package (update) This PR updates a package to a newer version 9.needs: changelog This PR needs a changelog entry 9.needs: documentation This needs to be documented well. 9.needs: reporter feedback This issue needs the person who filed it to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants