diff options
Diffstat (limited to 'gnu/packages/ibus.scm')
-rw-r--r-- | gnu/packages/ibus.scm | 109 |
1 files changed, 78 insertions, 31 deletions
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm index e6001efa7f..cdd4708d22 100644 --- a/gnu/packages/ibus.scm +++ b/gnu/packages/ibus.scm @@ -42,6 +42,7 @@ #:use-module (gnu packages databases) #:use-module (gnu packages datastructures) #:use-module (gnu packages dbm) + #:use-module (gnu packages docbook) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) @@ -49,18 +50,21 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages iso-codes) #:use-module (gnu packages logging) + #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) #:use-module (gnu packages serialization) #:use-module (gnu packages sqlite) #:use-module (gnu packages textutils) #:use-module (gnu packages unicode) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xdisorg)) (define-public ibus (package (name "ibus") - (version "1.5.22") + (version "1.5.24") (source (origin (method url-fetch) (uri (string-append "https://github.com/ibus/ibus/" @@ -68,12 +72,14 @@ version "/ibus-" version ".tar.gz")) (sha256 (base32 - "0jmy2w01phpmqnjnfnak7nvfna57mpgfnl87jwc4iai8ijjynw41")))) + "07s2ly75xv50bqg37mn37i9akqvcfd45k2mbplxrsqk3a2b3mwxb")))) (build-system glib-or-gtk-build-system) + (outputs '("out" "doc")) (arguments - `(#:tests? #f ; tests fail because there's no connection to dbus - #:parallel-build? #f ; race condition discovered with emoji support + `(#:parallel-build? #f ; race condition discovered with emoji support #:configure-flags (list "--enable-python-library" + "--enable-gtk-doc" + "--enable-memconf" (string-append "--with-unicode-emoji-dir=" (assoc-ref %build-inputs "unicode-emoji") @@ -88,6 +94,20 @@ "--enable-wayland") #:phases (modify-phases %standard-phases + (add-after 'unpack 'disable-failing-tests + (lambda _ + ;; These tests require /etc/machine-id. + (with-directory-excursion "src/tests" + (substitute* '("ibus-share.c" "ibus-compose.c" + "ibus-keypress.c") + (("[ \t]*return g_test_run \\(\\);") ""))))) + (add-after 'unpack 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "docs/reference/ibus" + (substitute* "ibus-docs.sgml.in" + (("http://www.oasis-open.org/docbook/xml/4.1.2/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/")))))) (add-after 'unpack 'patch-python-target-directories (lambda* (#:key outputs #:allow-other-keys) (let ((root (string-append (assoc-ref outputs "out") @@ -98,13 +118,11 @@ (("(py2?overridesdir)=.*" _ var) (string-append var "=" root "/gi/overrides/")) (("(pkgpython2dir=).*" _ var) - (string-append var root "/ibus")))) - #t)) + (string-append var root "/ibus")))))) (add-before 'configure 'disable-dconf-update (lambda _ (substitute* "data/dconf/Makefile.in" - (("dconf update") "echo dconf update")) - #t)) + (("dconf update") "echo dconf update")))) (add-after 'unpack 'delete-generated-files (lambda _ (for-each (lambda (file) @@ -112,8 +130,7 @@ (when (file-exists? c) (format #t "deleting ~a\n" c) (delete-file c)))) - (find-files "." "\\.vala")) - #t)) + (find-files "." "\\.vala")))) (add-after 'unpack 'fix-paths (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/ibusenginesimple.c" @@ -122,43 +139,73 @@ "/share/X11/locale"))) (substitute* "ui/gtk3/xkblayout.vala" (("\"(setxkbmap|xmodmap)\"" _ prog) - (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\""))) - #t)) + (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\""))))) + (add-before 'check 'pre-check + (lambda _ + ;; Tests write to $HOME. + (setenv "HOME" (getcwd)) + ;; Tests look for $XDG_RUNTIME_DIR. + (setenv "XDG_RUNTIME_DIR" (getcwd)) + ;; For missing '/etc/machine-id'. + (setenv "DBUS_FATAL_WARNINGS" "0") + ;; Tests require a running X server. + (system "Xvfb :1 +extension GLX &") + (setenv "DISPLAY" ":1") + ;; Tests require running iBus daemon. + (system "./bus/ibus-daemon --daemonize"))) + (add-after 'install 'move-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) + (mkdir-p (string-append doc "/share")) + (rename-file + (string-append out "/share/gtk-doc") + (string-append doc "/share/gtk-doc"))))) (add-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"))) + `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))) `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH") - ,(string-append out "/lib/girepository-1.0"))))) - #t))))) + ,(string-append out "/lib/girepository-1.0")))))))))) (inputs `(("dbus" ,dbus) ("dconf" ,dconf) - ("gconf" ,gconf) + ("glib" ,glib) ("gtk2" ,gtk+-2) ("gtk+" ,gtk+) + ("iso-codes" ,iso-codes) ("json-glib" ,json-glib) ("libnotify" ,libnotify) ("libx11" ,libx11) + ("libxkbcommon" ,libxkbcommon) + ("libxtst" ,libxtst) + ("pygobject" ,python-pygobject) + ("python" ,python) + ("python-dbus" ,python-dbus) ("setxkbmap" ,setxkbmap) + ("ucd" ,ucd) + ("unicode-cldr-common" ,unicode-cldr-common) + ("unicode-emoji" ,unicode-emoji) ("wayland" ,wayland) - ("xmodmap" ,xmodmap) - ("iso-codes" ,iso-codes) - ("pygobject2" ,python-pygobject) - ("python" ,python))) + ("xmodmap" ,xmodmap))) (native-inputs - `(("glib" ,glib "bin") ; for glib-genmarshal + `(("docbook-xml" ,docbook-xml-4.1.2) + ("glib" ,glib "bin") ; for glib-genmarshal ("gettext" ,gettext-minimal) + ("gnome-common" ,gnome-common) ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler - ("ucd" ,ucd) - ("unicode-emoji" ,unicode-emoji) - ("unicode-cldr-common" ,unicode-cldr-common) + ("gtk+:bin" ,gtk+ "bin") + ("gtk-doc" ,gtk-doc) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python-wrapper" ,python-wrapper) ("vala" ,vala) - ("pkg-config" ,pkg-config))) + ("which" ,which) + ("xorg-server" ,xorg-server-for-tests))) (native-search-paths (list (search-path-specification (variable "IBUS_COMPONENT_PATH") @@ -195,8 +242,8 @@ may also simplify input method development.") ;; PYTHONPATH and GI_TYPELIB_PATH. (let ((out (assoc-ref outputs "out"))) (wrap-program (string-append out "/libexec/ibus-setup-libpinyin") - `("PYTHONPATH" ":" = - (,(getenv "PYTHONPATH") + `("GUIX_PYTHONPATH" ":" prefix + (,(getenv "GUIX_PYTHONPATH") ,(string-append (assoc-ref inputs "ibus") "/lib/girepository-1.0") ,(string-append (assoc-ref outputs "out") @@ -277,8 +324,8 @@ Chinese pinyin input methods.") (for-each (lambda (prog) (wrap-program (string-append out "/libexec/" prog) - `("PYTHONPATH" ":" prefix - (,(getenv "PYTHONPATH"))) + `("GUIX_PYTHONPATH" ":" prefix + (,(getenv "GUIX_PYTHONPATH"))) `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH") ,(string-append out "/lib/girepository-1.0"))))) @@ -740,7 +787,7 @@ hanja dictionary and small hangul character classification.") (lambda* (#:key inputs outputs #:allow-other-keys) (wrap-program (string-append (assoc-ref outputs "out") "/libexec/ibus-setup-hangul") - `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))) + `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))) `("LD_LIBRARY_PATH" ":" prefix (,(string-append (assoc-ref inputs "libhangul") "/lib"))) `("GI_TYPELIB_PATH" ":" prefix |