From patchwork Tue Oct 30 14:33:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meiyo Peng X-Patchwork-Id: 50 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8D8F716761; Tue, 30 Oct 2018 14:39:22 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id D627C16751 for ; Tue, 30 Oct 2018 14:39:20 +0000 (GMT) Received: from localhost ([::1]:53619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHVAu-00030q-4V for patchwork@mira.cbaines.net; Tue, 30 Oct 2018 10:39:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHV6p-0007fa-G8 for guix-patches@gnu.org; Tue, 30 Oct 2018 10:35:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHV6l-0000qD-A3 for guix-patches@gnu.org; Tue, 30 Oct 2018 10:35:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51469) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHV6k-0000pt-W6 for guix-patches@gnu.org; Tue, 30 Oct 2018 10:35:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gHV6k-0007Hd-QN for guix-patches@gnu.org; Tue, 30 Oct 2018 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#33203] [patch] Rime Input Method Engine Resent-From: Meiyo Peng Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 Oct 2018 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33203 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33203@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154091005827936 (code B ref -1); Tue, 30 Oct 2018 14:35:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Oct 2018 14:34:18 +0000 Received: from localhost ([127.0.0.1]:55727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHV5v-0007GP-3w for submit@debbugs.gnu.org; Tue, 30 Oct 2018 10:34:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHV5n-0007Fp-CH for submit@debbugs.gnu.org; Tue, 30 Oct 2018 10:34:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHV5e-00089E-5D for submit@debbugs.gnu.org; Tue, 30 Oct 2018 10:33:58 -0400 Received: from lists.gnu.org ([2001:4830:134:3::11]:40338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHV5d-000894-Uf for submit@debbugs.gnu.org; Tue, 30 Oct 2018 10:33:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHV5a-0006mH-Mq for guix-patches@gnu.org; Tue, 30 Oct 2018 10:33:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHV5W-00082w-GX for guix-patches@gnu.org; Tue, 30 Oct 2018 10:33:50 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:41123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHV5V-0007yI-17 for guix-patches@gnu.org; Tue, 30 Oct 2018 10:33:46 -0400 Received: by mail-pl1-x633.google.com with SMTP id p5-v6so5632377plq.8 for ; Tue, 30 Oct 2018 07:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=GbtoGttc6xA4gbeW4/jI6R91s4cIqUkocxqCNoFxw7Y=; b=mrN6YwHhnm8pmpLpsG6lHd9fwFBy5e+ubipujkSVVEhbMoghUQdL+Wx21iYwyHFI3R yX5yySvR/tc5O7jviMQfUfI6veg70JO0uS5ePbAxLw0cGzYFcriYCN0HUwKuzQCEGIyw /UEwtPBgoTDbH2MHojUZHZXEMf8NSTE0kVxZD8WkZdkSPGdvxst1pkCGaNYbUD9/Dnc0 r5vKQWg/4VpTn0Xzx2TJd59SiTEfld5FrFGoeBDpnFOpycXc6FQHe6YwDMJSn50XBUOj Wx547+YLXXHkVjwlqt6CNoNmy1Iynz/GRZtBbqNyg7LWG8H4PnYvvoKaQLyIBhp8RI6r dHiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=GbtoGttc6xA4gbeW4/jI6R91s4cIqUkocxqCNoFxw7Y=; b=iZjsVWa15iQ+7YQ0x+A/Qtdc6P7YhfOENoExRG5hKV4fXVHpWmoPHcSI+1ILkLk7lQ awdHFz7HK5KnfOqxX3wHhRkl8iRBbfxBKeq8a0KIoie5It1ub5qGFqo0uoU0rrzjHwFI /aQSnTB+j8lXbnFxBsoHfN8Fkkt1oOydPxGdZcfyHgKzxguNHgzd67p1ItGmw9xdWI0n XC0H4oJU0LZo+EdyK8KqudobQMhDjltaNyXvSi9uNq1xorEBYX/tQQoaSUcN6TXPkj5g 78Pr8rl4kH7Na+FN5BZ102ILOxcjicDPd5WRSnqsuIb15aIO4SwCcHmIKEQQhpg697C2 7vDA== X-Gm-Message-State: AGRZ1gLfA3Ha6una0av0zrYG/0ouyeV3RKa911wuhh6by7Ka6HM18PJm ZX5fUK3m9VG6+u1CcWwDAkB6TTiB X-Google-Smtp-Source: AJdET5d2uJ1dsprdh+93BcBbsEewpbWsXgtMqdISMTtKGLUD1eRpziMK/KPAFahSk0Bv/gwA+js+og== X-Received: by 2002:a17:902:3341:: with SMTP id a59-v6mr18951444plc.138.1540910023124; Tue, 30 Oct 2018 07:33:43 -0700 (PDT) Received: from guix (110.242.201.35.bc.googleusercontent.com. [35.201.242.110]) by smtp.gmail.com with ESMTPSA id i186-v6sm26999395pfc.86.2018.10.30.07.33.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 07:33:42 -0700 (PDT) From: Meiyo Peng Date: Tue, 30 Oct 2018 22:33:38 +0800 Message-ID: <871s874i7x.fsf@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi, These patches add Rime Input Method Engine to guix. Rime Input Method Engine is a lightweight, extensible input method engine supporting various input schemas including glyph-based input methods, romanization-based input methods as well as those for Chinese dialects. It has the ability to compose phrases and sentences intelligently and provide very accurate traditional Chinese output. Rime is very popular among Chinese users. I prefer it over libpinyin. But sadly, libpinyin (both in ibus and fcitx) is the only option for pinyin in guix. I have already tested these patches on my computer. It works fine. Please inform me if there is any issue with the code. --- Meiyo Peng From 80a75361b8c47e80495a068c810a5f5ff0a845b0 Mon Sep 17 00:00:00 2001 From: Meiyo Peng Date: Mon, 29 Oct 2018 11:46:03 +0800 Subject: [PATCH 6/6] gnu: Add ibus-rime. * gnu/packages/ibus.scm (ibus-rime): New variable. --- gnu/packages/ibus.scm | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm index 870d28562..0a07b5190 100644 --- a/gnu/packages/ibus.scm +++ b/gnu/packages/ibus.scm @@ -34,6 +34,7 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages boost) + #:use-module (gnu packages cmake) #:use-module (gnu packages databases) #:use-module (gnu packages datastructures) #:use-module (gnu packages freedesktop) @@ -586,3 +587,61 @@ traditional Chinese output.") (description "@dfn{rime-data} provides the schema data of Rime Input Method Engine.") (license lgpl3+))) + +(define-public ibus-rime + (package + (name "ibus-rime") + (version "1.3.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/rime/" name + "/archive/" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "0mfbz0vwky7n4wvxrwabnn1i9n9adnql0dd1rx57w1anaslr5amj")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no tests + #:make-flags (list (string-append "PREFIX=" %output)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Define RIME_DATA_DIR. It's required but not used by the code. + (substitute* "Makefile" + (("cmake") + (string-append "cmake -DRIME_DATA_DIR=" + (assoc-ref inputs "rime-data") + "/share/rime-data"))) + (substitute* "rime_config.h" + (("#define IBUS_RIME_INSTALL_PREFIX .*") + (string-append "#define IBUS_RIME_INSTALL_PREFIX \"" + (assoc-ref outputs "out") + "\"\n"))) + ;; rime_config.h defines the actual data directory. + (substitute* "rime_config.h" + (("#define IBUS_RIME_SHARED_DATA_DIR .*") + (string-append "#define IBUS_RIME_SHARED_DATA_DIR \"" + (assoc-ref inputs "rime-data") + "/share/rime-data\"\n"))) + #t)) + (delete 'configure)))) + (inputs + `(("gdk-pixbuf" ,gdk-pixbuf) + ("glib" ,glib) + ("ibus" ,ibus) + ("libnotify" ,libnotify) + ("librime" ,librime) + ("rime-data" ,rime-data))) + (native-inputs + `(("cmake" ,cmake) + ("pkg-config" ,pkg-config))) + (home-page "https://rime.im/") + (synopsis "Rime Input Method Engine for IBus") + (description "@dfn{Rime} Input Method Engine is a lightweight, extensible +input method engine supporting various input schemas including glyph-based +input methods, romanization-based input methods as well as those for Chinese +dialects. It has the ability to compose phrases and sentences intelligently +and provide very accurate traditional Chinese output.") + (license gpl3+))) -- 2.19.1