Archived
1
0
Fork 0

gnu: ibus: Update to 1.5.27, use gexps and remove input labels.

* gnu/packages/ibus.scm (ibus): Update to 1.5.27.
[arguments]: Use gexps.
[configure-flags]: Use search-input-file.  Add '--disable-systemd-services'.
[make-flags]: Add the DISABLE_GUI_TEST variable.
[phases]{patch-docbook-xml}: Use this-package-native-input.
{patch-python-target-directories}: Break line.
{fix-paths}: Use format to double quote command.
[inputs, native-inputs]: Delete labels.
[inputs]: Add bash-minimal.
This commit is contained in:
Maxim Cournoyer 2022-08-22 23:21:08 -04:00
parent 46d50efd09
commit e631e122e3
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -41,6 +41,7 @@
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages anthy) #:use-module (gnu packages anthy)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages boost) #:use-module (gnu packages boost)
#:use-module (gnu packages check) #:use-module (gnu packages check)
@ -71,7 +72,7 @@
(define-public ibus (define-public ibus
(package (package
(name "ibus") (name "ibus")
(version "1.5.24") (version "1.5.27")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://github.com/ibus/ibus/" (uri (string-append "https://github.com/ibus/ibus/"
@ -79,143 +80,149 @@
version "/ibus-" version ".tar.gz")) version "/ibus-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"07s2ly75xv50bqg37mn37i9akqvcfd45k2mbplxrsqk3a2b3mwxb")))) "1pwppcy0xpidxa7db9lykjjjj1rcjrqf5l88f77hgxlnvdddmyvf"))))
(build-system glib-or-gtk-build-system) (build-system glib-or-gtk-build-system)
(outputs '("out" "doc")) (outputs '("out" "doc"))
(arguments (arguments
`(#:parallel-build? #f ; race condition discovered with emoji support (list
#:configure-flags (list "--enable-python-library" #:configure-flags #~(list "--enable-python-library"
"--enable-gtk-doc" "--enable-gtk-doc"
"--enable-memconf" "--enable-memconf"
(string-append (string-append
"--with-unicode-emoji-dir=" "--with-unicode-emoji-dir="
(assoc-ref %build-inputs "unicode-emoji") (search-input-directory %build-inputs
"/share/unicode/emoji") "share/unicode/emoji"))
(string-append (string-append
"--with-emoji-annotation-dir=" "--with-emoji-annotation-dir="
(assoc-ref %build-inputs "unicode-cldr-common") (search-input-directory
"/share/unicode/cldr/common/annotations") %build-inputs
(string-append "--with-ucd-dir=" "share/unicode/cldr/common/annotations"))
(assoc-ref %build-inputs "ucd") (string-append
"/share/ucd") "--with-ucd-dir="
"--enable-wayland") (search-input-directory %build-inputs
#:phases "share/ucd"))
(modify-phases %standard-phases "--enable-wayland"
(add-after 'unpack 'disable-failing-tests "--disable-systemd-services")
(lambda _ #:make-flags
;; These tests require /etc/machine-id. ;; The GUI tests not only require a DISPLAY, but also a window manager
(with-directory-excursion "src/tests" ;; since IBus needs to receive focus-in/out events to test IBus with GTK
(substitute* '("ibus-share.c" "ibus-compose.c" ;; applications (see: https://github.com/ibus/ibus/issues/2307).
"ibus-keypress.c") #~(list (string-append "DISABLE_GUI_TESTS=ibus-compose "
(("[ \t]*return g_test_run \\(\\);") ""))))) "ibus-inputcontext-create "
(add-after 'unpack 'patch-docbook-xml "xkb-latin-layouts "))
(lambda* (#:key inputs #:allow-other-keys) #:phases
(with-directory-excursion "docs/reference/ibus" #~(modify-phases %standard-phases
(substitute* "ibus-docs.sgml.in" (add-after 'unpack 'disable-failing-tests
(("http://www.oasis-open.org/docbook/xml/4.1.2/") (lambda _
(string-append (assoc-ref inputs "docbook-xml") ;; These tests require /etc/machine-id.
"/xml/dtd/docbook/")))))) (with-directory-excursion "src/tests"
(add-after 'unpack 'patch-python-target-directories (substitute* '("ibus-share.c" "ibus-compose.c"
(lambda* (#:key outputs #:allow-other-keys) "ibus-keypress.c")
(let ((root (string-append (assoc-ref outputs "out") (("[ \t]*return g_test_run \\(\\);") "")))))
"/lib/python" (add-after 'unpack 'patch-docbook-xml
,(version-major+minor (package-version python)) (lambda* (#:key inputs #:allow-other-keys)
"/site-packages"))) (with-directory-excursion "docs/reference/ibus"
(substitute* "configure" (substitute* "ibus-docs.sgml.in"
(("(py2?overridesdir)=.*" _ var) (("http://www.oasis-open.org/docbook/xml/4.1.2/")
(string-append var "=" root "/gi/overrides/")) (string-append #$(this-package-native-input "docbook-xml")
(("(pkgpython2dir=).*" _ var) "/xml/dtd/docbook/"))))))
(string-append var root "/ibus")))))) (add-after 'unpack 'patch-python-target-directories
(add-before 'configure 'disable-dconf-update (lambda _
(lambda _ (let ((root (string-append #$output
(substitute* "data/dconf/Makefile.in" "/lib/python"
(("dconf update") "echo dconf update")))) #$(version-major+minor
(add-after 'unpack 'delete-generated-files (package-version python))
(lambda _ "/site-packages")))
(for-each (lambda (file) (substitute* "configure"
(let ((c (string-append (string-drop-right file 4) "c"))) (("(py2?overridesdir)=.*" _ var)
(when (file-exists? c) (string-append var "=" root "/gi/overrides/"))
(format #t "deleting ~a\n" c) (("(pkgpython2dir=).*" _ var)
(delete-file c)))) (string-append var root "/ibus"))))))
(find-files "." "\\.vala")))) (add-before 'configure 'disable-dconf-update
(add-after 'unpack 'fix-paths (lambda _
(lambda* (#:key inputs #:allow-other-keys) (substitute* "data/dconf/Makefile.in"
(substitute* "src/ibusenginesimple.c" (("dconf update") "echo dconf update"))))
(("/usr/share/X11/locale") (add-after 'unpack 'delete-generated-files
(search-input-directory inputs (lambda _
"share/X11/locale"))) (for-each (lambda (file)
(substitute* "ui/gtk3/xkblayout.vala" (let ((c (string-append (string-drop-right file 4) "c")))
(("\"(setxkbmap|xmodmap)\"" _ prog) (when (file-exists? c)
(string-append "\"" (format #t "deleting ~a\n" c)
(search-input-file inputs (delete-file c))))
(string-append "bin/" prog)) (find-files "." "\\.vala"))))
"\""))))) (add-after 'unpack 'fix-paths
(add-before 'check 'pre-check (lambda* (#:key inputs #:allow-other-keys)
(lambda _ (substitute* "src/ibusenginesimple.c"
;; Tests write to $HOME. (("/usr/share/X11/locale")
(setenv "HOME" (getcwd)) (search-input-directory inputs "share/X11/locale")))
;; Tests look for $XDG_RUNTIME_DIR. (substitute* "ui/gtk3/xkblayout.vala"
(setenv "XDG_RUNTIME_DIR" (getcwd)) (("\"(setxkbmap|xmodmap)\"" _ prog)
;; For missing '/etc/machine-id'. (format #f "~s" (search-input-file
(setenv "DBUS_FATAL_WARNINGS" "0") inputs (string-append "bin/" prog)))))))
;; Tests require a running X server. (add-before 'check 'pre-check
(system "Xvfb :1 +extension GLX &") (lambda _
(setenv "DISPLAY" ":1") ;; Tests write to $HOME.
;; Tests require running iBus daemon. (setenv "HOME" (getcwd))
(system "./bus/ibus-daemon --daemonize"))) ;; Tests look for $XDG_RUNTIME_DIR.
(add-after 'install 'move-doc (setenv "XDG_RUNTIME_DIR" (getcwd))
(lambda* (#:key outputs #:allow-other-keys) ;; For missing '/etc/machine-id'.
(let* ((out (assoc-ref outputs "out")) (setenv "DBUS_FATAL_WARNINGS" "0")
(doc (assoc-ref outputs "doc"))) ;; Tests require a running X server.
(mkdir-p (string-append doc "/share")) (system "Xvfb :1 +extension GLX &")
(rename-file (setenv "DISPLAY" ":1")
(string-append out "/share/gtk-doc") ;; Tests require running iBus daemon.
(string-append doc "/share/gtk-doc"))))) (system "./bus/ibus-daemon --daemonize")))
(add-after 'wrap-program 'wrap-with-additional-paths (add-after 'install 'move-doc
(lambda* (#:key outputs #:allow-other-keys) (lambda _
;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and (mkdir-p (string-append #$output:doc "/share"))
;; GI_TYPELIB_PATH. (rename-file
(let ((out (assoc-ref outputs "out"))) (string-append #$output "/share/gtk-doc")
(wrap-program (string-append out "/bin/ibus-setup") (string-append #$output:doc "/share/gtk-doc"))))
`("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))) (add-after 'wrap-program 'wrap-with-additional-paths
`("GI_TYPELIB_PATH" ":" prefix (lambda* (#:key outputs #:allow-other-keys)
(,(getenv "GI_TYPELIB_PATH") ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
,(string-append out "/lib/girepository-1.0")))))))))) ;; GI_TYPELIB_PATH.
(wrap-program (search-input-file outputs "bin/ibus-setup")
`("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))
`("GI_TYPELIB_PATH" ":" prefix
(,(getenv "GI_TYPELIB_PATH")
,(string-append #$output "/lib/girepository-1.0")))))))))
(inputs (inputs
`(("dbus" ,dbus) (list bash-minimal
("dconf" ,dconf) dbus
("glib" ,glib) dconf
("gtk2" ,gtk+-2) glib
("gtk+" ,gtk+) gtk+-2
("iso-codes" ,iso-codes) gtk+
("json-glib" ,json-glib) iso-codes
("libnotify" ,libnotify) json-glib
("libx11" ,libx11) libnotify
("libxkbcommon" ,libxkbcommon) libx11
("libxtst" ,libxtst) libxkbcommon
("pygobject" ,python-pygobject) libxtst
("python" ,python) python-pygobject
("python-dbus" ,python-dbus) python
("setxkbmap" ,setxkbmap) python-dbus
("ucd" ,ucd) setxkbmap
("unicode-cldr-common" ,unicode-cldr-common) ucd
("unicode-emoji" ,unicode-emoji) unicode-cldr-common
("wayland" ,wayland) unicode-emoji
("xmodmap" ,xmodmap))) wayland
xmodmap))
(native-inputs (native-inputs
`(("docbook-xml" ,docbook-xml-4.1.2) (list docbook-xml-4.1.2
("glib" ,glib "bin") ; for glib-genmarshal `(,glib "bin") ;for glib-genmarshal
("gettext" ,gettext-minimal) gettext-minimal
("gnome-common" ,gnome-common) gnome-common
("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler gobject-introspection ;for g-ir-compiler
("gtk+:bin" ,gtk+ "bin") `(,gtk+ "bin")
("gtk-doc" ,gtk-doc) gtk-doc
("perl" ,perl) perl
("pkg-config" ,pkg-config) pkg-config
("python-wrapper" ,python-wrapper) python-wrapper
("vala" ,vala) vala
("which" ,which) which
("xorg-server" ,xorg-server-for-tests))) xorg-server-for-tests))
(native-search-paths (native-search-paths
(list (search-path-specification (list (search-path-specification
(variable "IBUS_COMPONENT_PATH") (variable "IBUS_COMPONENT_PATH")