;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Ricardo Wurmus ;;; Copyright © 2015 Andreas Enge ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages ibus) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages databases) #:use-module (gnu packages freedesktop) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) #:use-module (gnu packages iso-codes) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python)) (define-public ibus (package (name "ibus") (version "1.5.5") (source (origin (method url-fetch) (uri (string-append "https://ibus.googlecode.com/files/ibus-" version ".tar.gz")) (sha256 (base32 "1v4a9xv2k26g6ggk4282ynfvh68j2r5hg1cdpvnryfa8c2pkdaq2")))) (build-system glib-or-gtk-build-system) (arguments `(#:tests? #f ; tests fail because there's no connection to dbus #:make-flags (list "CC=gcc" (string-append "pyoverridesdir=" (assoc-ref %outputs "out") "/lib/python2.7/site-packages/gi/overrides/")) #:phases (alist-cons-before 'configure 'disable-dconf-update (lambda _ (substitute* "data/dconf/Makefile.in" (("dconf update") "echo dconf update")) #t) (alist-cons-after 'wrap-program 'wrap-with-additional-paths (lambda* (#:key outputs #:allow-other-keys) ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and ;; GI_TYPELIB_PATH. (let ((out (assoc-ref outputs "out"))) (wrap-program (string-append out "/bin/ibus-setup") `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))) `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH") ,(string-append out "/lib/girepository-1.0")))))) %standard-phases)))) (inputs `(("dbus" ,dbus) ("dconf" ,dconf) ("gconf" ,gconf) ("gtk2" ,gtk+-2) ("intltool" ,intltool) ("libnotify" ,libnotify) ("iso-codes" ,iso-codes) ("pygobject2" ,python2-pygobject) ("python2" ,python-2))) (native-inputs `(("glib" ,glib "bin") ; for glib-genmarshal ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler ("pkg-config" ,pkg-config))) (synopsis "Input method framework") (description "IBus is an input framework providing a full-featured and user-friendly input method user interface. It comes with multilingual input support. It may also simplify input method development.") (home-page "http://ibus.googlecode.com/") (license lgpl2.1+))) (define-public ibus-pinyin (package (name "ibus-pinyin") (version "1.5.0") (source (origin (method url-fetch) (uri (string-append "https://ibus.googlecode.com/files/ibus-pinyin-" version ".tar.gz")) (sha256 (base32 "15mwpm64mjxm2j9fmjxd74xwngwb88131rj9b3b9zsjirj6lapd8")))) (build-system glib-or-gtk-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-after 'unpack 'use-full-python-path (lambda* (#:key inputs #:allow-other-keys) (substitute* "setup/ibus-setup-pinyin.in" (("exec python") (string-append "exec " (assoc-ref inputs "python") "/bin/python"))) #t)) (add-after 'wrap-program 'wrap-with-additional-paths (lambda* (#:key inputs outputs #:allow-other-keys) ;; Make sure 'ibus-setup-pinyin' runs with the correct PYTHONPATH ;; and GI_TYPELIB_PATH. ;; TODO: This doesn't work. ibus-setup-pinyin cannot be executed. (let ((out (assoc-ref outputs "out"))) (wrap-program (string-append out "/libexec/ibus-setup-pinyin") `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))) `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH") ,(string-append (assoc-ref inputs "ibus") "/lib/girepository-1.0")))) #t)))))) (inputs `(("ibus" ,ibus) ("intltool" ,intltool) ("sqlite" ,sqlite) ("python" ,python-2) ("pyxdg" ,python2-pyxdg) ("pyzy" ,pyzy))) (native-inputs `(("gobject-introspection" ,gobject-introspection) ("pkg-config" ,pkg-config))) (synopsis "Chinese Pinyin and Bopomofo input methods for IBus") (description "This package provides the Chinese Pinyin and Bopomofo input methods for IBus.") (home-page "https://github.com/ibus/ibus-pinyin") (license gpl2+))) (define-public pyzy ;; There is no release tarball, so we take the last commit. (let ((commit "6d9c3cdff")) (package (name "pyzy") (version "0.1.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/pyzy/pyzy.git") (commit commit))) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "0i7lnh5gp25wi9rk5f2pjdlhn7vzs2s7pnfbfgk9q8cmzqkgrh6g")) (patches (list (search-patch "pyzy-no-download.patch"))))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--enable-db-open-phrase" "--enable-db-android") #:phases (modify-phases %standard-phases (add-after 'unpack 'unpack-database (lambda* (#:key inputs #:allow-other-keys) (zero? (system* "tar" "-C" "data" "-xvf" (assoc-ref inputs "pyzy-database"))))) (add-before 'configure 'autoreconf (lambda _ (zero? (system* "autoreconf" "-vif"))))))) (inputs `(("glib" ,glib) ("libuuid" ,util-linux) ("sqlite" ,sqlite) ("pyzy-database" ,(origin (method url-fetch) (uri (string-append "https://pyzy.googlecode.com/files/" "pyzy-database-1.0.0.tar.bz2")) (sha256 (base32 "08f3jhk48m4pqjaaq69bgxz3djz6m3n593q0z70dzqa1kxxx1irj")))))) (native-inputs `(("python" ,python-2) ("tar" ,tar) ("pkg-config" ,pkg-config) ("autoconf" ,autoconf) ("automake" ,automake) ("libtool" ,libtool))) (synopsis "Conversion library for Chinese Pinyin and Bopomofo") (description "PyZy is a conversion library for the Chinese input methods Pinyin and Bopomofo.") (home-page "https://github.com/pyzy/pyzy") (license lgpl2.1+))))