From fa60ad8e79034bfd415cb8e443e355b51846c6c8 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Wed, 8 Jul 2020 12:57:45 -0400 Subject: [PATCH 01/62] gnu: ibus: Update package definition. * gnu/packages/ibus.scm (ibus): Update package definition. [source][method]: Change from url-fetch to git-fetch. [uri]: Add git-reference, url and commit. [file-name]: Add git-file-name. [sha256]: Modify base32. [patches]: Add ibus-disable-failing-tests.patch. [outputs]: New output 'doc'. [arguments]<#:tests?>: Remove argument. <#:parallel-build?>: Remove argument. <#:configure-flags>[--enable-appindicator]: New flag. [--enable-gtk-doc]: New flag. [--enable-memconf]: New flag. <#:phases>['delete-generated-files]: Remove phase. ['patch-docbook-xml]: New phase. ['pre-check]: New phase. ['move-docs]: New phase. [native-inputs]: Remove ucd, unicode-emoji and unicode-cldr-common. Add autoconf, automake, docbook-xml, gnome-common, gtk+:bin, gtk-doc, libtool, perl, which and xorg-server-for-tests. [inputs]: Add python-dbus, python2-dbus, glib, python-pygobject, python-wrapper, python-2, python-3, ucd, unicode-cldr-common, unicode-emoji, libxkbcommon and libxtst. [search-paths]: New field. [synopsis]: Modify. * gnu/packages/patches/ibus-disable-failing-tests.patch: New file. * gnu/local.mk (ibus-disable-failing-tests.patch): New reference. --- gnu/local.mk | 1 + gnu/packages/ibus.scm | 193 +++++++++++------- .../patches/ibus-disable-failing-tests.patch | 75 +++++++ 3 files changed, 197 insertions(+), 72 deletions(-) create mode 100644 gnu/packages/patches/ibus-disable-failing-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5c1eb7224f..b36b91ce74 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1093,6 +1093,7 @@ dist_patch_DATA = \ %D%/packages/patches/hurd-xattr.patch \ %D%/packages/patches/hplip-remove-imageprocessor.patch \ %D%/packages/patches/hydra-disable-darcs-test.patch \ + %D%/packages/patches/ibus-disable-failing-tests.patch \ %D%/packages/patches/icecat-makeicecat.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ %D%/packages/patches/icecat-use-older-reveal-hidden-html.patch \ diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm index 0793635b7d..2d430f2f3c 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,70 +50,64 @@ #: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") - (source (origin - (method url-fetch) - (uri (string-append "https://github.com/ibus/ibus/" - "releases/download/" - version "/ibus-" version ".tar.gz")) - (sha256 - (base32 - "0jmy2w01phpmqnjnfnak7nvfna57mpgfnl87jwc4iai8ijjynw41")))) + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/ibus/ibus.git") + (commit version))) + (file-name + (git-file-name name version)) + (sha256 + (base32 "09ynn7gq84q18hhbg6wq2yrliwil42qbzxbwbpggry1s955jg5xb")) + (patches + (search-patches "ibus-disable-failing-tests.patch")))) (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 - #:configure-flags (list "--enable-python-library" - (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") + `(#:configure-flags + (list + "--enable-wayland" + "--enable-appindicator" + "--enable-gtk-doc" + "--enable-memconf" + "--enable-python-library" + (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")) #:phases (modify-phases %standard-phases - (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")))) - #t)) - (add-before 'configure 'disable-dconf-update - (lambda _ - (substitute* "data/dconf/Makefile.in" - (("dconf update") "echo dconf update")) - #t)) - (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 '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/")))) #t)) (add-after 'unpack 'fix-paths (lambda* (#:key inputs #:allow-other-keys) @@ -124,50 +119,104 @@ (("\"(setxkbmap|xmodmap)\"" _ prog) (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\""))) #t)) + (add-after 'unpack 'disable-dconf-update + (lambda _ + (substitute* "data/dconf/Makefile.am" + (("dconf update") + "echo dconf update")) + #t)) + (add-before 'configure '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")))) + #t)) + (add-before 'check 'pre-check + (lambda _ + ;; Tests write to $HOME. + (setenv "HOME" (getcwd)) + ;; Tests require running iBus daemon. + (system "./bus/ibus-daemon --daemonize") + #t)) + (add-after 'install 'move-docs + (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")) + #t))) (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"))) + (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"))))) #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("docbook-xml" ,docbook-xml-4.1.2) + ("gettext" ,gettext-minimal) + ("glib" ,glib "bin") + ("gnome-common" ,gnome-common) + ("gobject-introspection" ,gobject-introspection) + ("gtk+:bin" ,gtk+ "bin") + ("gtk-doc" ,gtk-doc) + ("libtool" ,libtool) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("vala" ,vala) + ("which" ,which) + ("xorg-server" ,xorg-server-for-tests))) (inputs `(("dbus" ,dbus) + ("dbus-python" ,python-dbus) + ("dbus-python2" ,python2-dbus) ("dconf" ,dconf) ("gconf" ,gconf) + ("glib" ,glib) ("gtk2" ,gtk+-2) - ("gtk+" ,gtk+) + ("gtk3" ,gtk+) + ("iso-codes" ,iso-codes) ("json-glib" ,json-glib) ("libnotify" ,libnotify) - ("libx11" ,libx11) + ("pygobject" ,python-pygobject) + ("pygobject2" ,python2-pygobject) + ("python" ,python-wrapper) + ("python2" ,python-2) + ("python3" ,python-3) ("setxkbmap" ,setxkbmap) - ("wayland" ,wayland) - ("xmodmap" ,xmodmap) - ("iso-codes" ,iso-codes) - ("pygobject2" ,python-pygobject) - ("python" ,python))) - (native-inputs - `(("glib" ,glib "bin") ; for glib-genmarshal - ("gettext" ,gettext-minimal) - ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler ("ucd" ,ucd) - ("unicode-emoji" ,unicode-emoji) ("unicode-cldr-common" ,unicode-cldr-common) - ("vala" ,vala) - ("pkg-config" ,pkg-config))) + ("unicode-emoji" ,unicode-emoji) + ("wayland" ,wayland) + ("x11" ,libx11) + ("xkbcommon" ,libxkbcommon) + ("xmodmap" ,xmodmap) + ("xtst" ,libxtst))) (native-search-paths - (list (search-path-specification - (variable "IBUS_COMPONENT_PATH") - (files '("share/ibus/component"))))) - (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.") + (list + (search-path-specification + (variable "IBUS_COMPONENT_PATH") + (files '("share/ibus/component"))))) + ;; To load iBus components. + (search-paths native-search-paths) + (synopsis "Intelligent Input Bus") + (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 "https://github.com/ibus/ibus/wiki") (license lgpl2.1+))) diff --git a/gnu/packages/patches/ibus-disable-failing-tests.patch b/gnu/packages/patches/ibus-disable-failing-tests.patch new file mode 100644 index 0000000000..6c55550d7a --- /dev/null +++ b/gnu/packages/patches/ibus-disable-failing-tests.patch @@ -0,0 +1,75 @@ +From 402e545ee411f9ef758636a6ac12b4741476b7e0 Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Sun, 5 Jul 2020 09:44:03 -0400 +Subject: [PATCH] [PATCH]: Disable failing tests. + +--- + bindings/pygobject/Makefile.am | 5 ----- + bus/Makefile.am | 1 - + src/tests/Makefile.am | 8 -------- + 3 files changed, 14 deletions(-) + +diff --git a/bindings/pygobject/Makefile.am b/bindings/pygobject/Makefile.am +index 84bd37cb..16ae0591 100644 +--- a/bindings/pygobject/Makefile.am ++++ b/bindings/pygobject/Makefile.am +@@ -39,10 +39,6 @@ overrides_PYTHON = \ + + TESTS = + +-if ENABLE_TESTS +-TESTS += test-override-ibus.py +-endif +- + # IBus.Keymap() accesses keymap files + TESTS_ENVIRONMENT = \ + PYTHONPATH=$(top_srcdir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \ +@@ -56,7 +52,6 @@ LOG_COMPILER = $(PYTHON) -B + EXTRA_DIST = \ + gi/__init__.py \ + gi/overrides/__init__.py \ +- test-override-ibus.py \ + $(NULL) + + install-data-hook: +diff --git a/bus/Makefile.am b/bus/Makefile.am +index 4383a874..610b0ebc 100644 +--- a/bus/Makefile.am ++++ b/bus/Makefile.am +@@ -113,7 +113,6 @@ endif + if ENABLE_TESTS + TESTS = \ + test-matchrule \ +- test-stress \ + $(NULL) + endif + +diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am +index 0a2e523c..7e3a2ef9 100644 +--- a/src/tests/Makefile.am ++++ b/src/tests/Makefile.am +@@ -51,7 +51,6 @@ TESTS = \ + ibus-keynames \ + ibus-registry \ + ibus-serializable \ +- ibus-share \ + ibus-util \ + $(NULL) + +@@ -61,13 +60,6 @@ if ENABLE_ENGINE + TESTS += ibus-engine-switch + endif + +-if ENABLE_GTK3 +-TESTS += ibus-compose +-if ENABLE_XTEST +-TESTS += ibus-keypress +-endif +-endif +- + TESTS_ENVIRONMENT = \ + top_builddir=$(top_builddir) \ + top_srcdir=$(top_srcdir) \ +-- +2.26.2 + -- 2.27.0