3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

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 anthy)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
#:use-module (gnu packages base)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
@ -71,7 +72,7 @@
(define-public ibus
(package
(name "ibus")
(version "1.5.24")
(version "1.5.27")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/ibus/ibus/"
@ -79,143 +80,149 @@
version "/ibus-" version ".tar.gz"))
(sha256
(base32
"07s2ly75xv50bqg37mn37i9akqvcfd45k2mbplxrsqk3a2b3mwxb"))))
"1pwppcy0xpidxa7db9lykjjjj1rcjrqf5l88f77hgxlnvdddmyvf"))))
(build-system glib-or-gtk-build-system)
(outputs '("out" "doc"))
(arguments
`(#: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")
"/share/unicode/emoji")
(string-append
"--with-emoji-annotation-dir="
(assoc-ref %build-inputs "unicode-cldr-common")
"/share/unicode/cldr/common/annotations")
(string-append "--with-ucd-dir="
(assoc-ref %build-inputs "ucd")
"/share/ucd")
"--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")
"/lib/python"
,(version-major+minor (package-version python))
"/site-packages")))
(substitute* "configure"
(("(py2?overridesdir)=.*" _ var)
(string-append var "=" root "/gi/overrides/"))
(("(pkgpython2dir=).*" _ var)
(string-append var root "/ibus"))))))
(add-before 'configure 'disable-dconf-update
(lambda _
(substitute* "data/dconf/Makefile.in"
(("dconf update") "echo dconf update"))))
(add-after 'unpack 'delete-generated-files
(lambda _
(for-each (lambda (file)
(let ((c (string-append (string-drop-right file 4) "c")))
(when (file-exists? c)
(format #t "deleting ~a\n" c)
(delete-file c))))
(find-files "." "\\.vala"))))
(add-after 'unpack 'fix-paths
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "src/ibusenginesimple.c"
(("/usr/share/X11/locale")
(search-input-directory inputs
"share/X11/locale")))
(substitute* "ui/gtk3/xkblayout.vala"
(("\"(setxkbmap|xmodmap)\"" _ prog)
(string-append "\""
(search-input-file inputs
(string-append "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")
`("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))
`("GI_TYPELIB_PATH" ":" prefix
(,(getenv "GI_TYPELIB_PATH")
,(string-append out "/lib/girepository-1.0"))))))))))
(list
#:configure-flags #~(list "--enable-python-library"
"--enable-gtk-doc"
"--enable-memconf"
(string-append
"--with-unicode-emoji-dir="
(search-input-directory %build-inputs
"share/unicode/emoji"))
(string-append
"--with-emoji-annotation-dir="
(search-input-directory
%build-inputs
"share/unicode/cldr/common/annotations"))
(string-append
"--with-ucd-dir="
(search-input-directory %build-inputs
"share/ucd"))
"--enable-wayland"
"--disable-systemd-services")
#:make-flags
;; The GUI tests not only require a DISPLAY, but also a window manager
;; since IBus needs to receive focus-in/out events to test IBus with GTK
;; applications (see: https://github.com/ibus/ibus/issues/2307).
#~(list (string-append "DISABLE_GUI_TESTS=ibus-compose "
"ibus-inputcontext-create "
"xkb-latin-layouts "))
#: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 #$(this-package-native-input "docbook-xml")
"/xml/dtd/docbook/"))))))
(add-after 'unpack 'patch-python-target-directories
(lambda _
(let ((root (string-append #$output
"/lib/python"
#$(version-major+minor
(package-version python))
"/site-packages")))
(substitute* "configure"
(("(py2?overridesdir)=.*" _ var)
(string-append var "=" root "/gi/overrides/"))
(("(pkgpython2dir=).*" _ var)
(string-append var root "/ibus"))))))
(add-before 'configure 'disable-dconf-update
(lambda _
(substitute* "data/dconf/Makefile.in"
(("dconf update") "echo dconf update"))))
(add-after 'unpack 'delete-generated-files
(lambda _
(for-each (lambda (file)
(let ((c (string-append (string-drop-right file 4) "c")))
(when (file-exists? c)
(format #t "deleting ~a\n" c)
(delete-file c))))
(find-files "." "\\.vala"))))
(add-after 'unpack 'fix-paths
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "src/ibusenginesimple.c"
(("/usr/share/X11/locale")
(search-input-directory inputs "share/X11/locale")))
(substitute* "ui/gtk3/xkblayout.vala"
(("\"(setxkbmap|xmodmap)\"" _ prog)
(format #f "~s" (search-input-file
inputs (string-append "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 _
(mkdir-p (string-append #$output:doc "/share"))
(rename-file
(string-append #$output "/share/gtk-doc")
(string-append #$output: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.
(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
`(("dbus" ,dbus)
("dconf" ,dconf)
("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)))
(list bash-minimal
dbus
dconf
glib
gtk+-2
gtk+
iso-codes
json-glib
libnotify
libx11
libxkbcommon
libxtst
python-pygobject
python
python-dbus
setxkbmap
ucd
unicode-cldr-common
unicode-emoji
wayland
xmodmap))
(native-inputs
`(("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
("gtk+:bin" ,gtk+ "bin")
("gtk-doc" ,gtk-doc)
("perl" ,perl)
("pkg-config" ,pkg-config)
("python-wrapper" ,python-wrapper)
("vala" ,vala)
("which" ,which)
("xorg-server" ,xorg-server-for-tests)))
(list docbook-xml-4.1.2
`(,glib "bin") ;for glib-genmarshal
gettext-minimal
gnome-common
gobject-introspection ;for g-ir-compiler
`(,gtk+ "bin")
gtk-doc
perl
pkg-config
python-wrapper
vala
which
xorg-server-for-tests))
(native-search-paths
(list (search-path-specification
(variable "IBUS_COMPONENT_PATH")