unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Guix-devel <guix-devel@gnu.org>
Subject: [PATCH] Add IBus.
Date: Mon, 16 Mar 2015 08:13:22 +0100	[thread overview]
Message-ID: <8761a1bejx.fsf@mango.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

Hi Guix,

attached are patches to add IBus.  This was a bit difficult to package
because I discovered two things rather late:

- our gtk+-2 package doesn't install its typelib file (see
  http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00456.html)
  
- the python2-pygobject-2 package is not the python2 equivalent of
  python-pygobject.

The home page for python-pygobject was set to the home page of the
pygobject 2.x bindings, although the API of the 3.x series differs from
that of the 2.x series.  This is fixed in the first commit.

The second commit adds Python 2 bindings for the 3.x series (previously
we only had Python 2 bindings for 2.x and Python 3 bindings for 3.x).

The third commit adds IBus itself.  Since the glib-or-gtk-build-system
already wraps the ibus-setup executable I decided to patch the wrapped
executable rather than adding another layer of wrapping.  This is why
the "wrap-with-additional-paths" phase looks pretty ugly.

Please note that this might fail with a runtime error unless our gtk+-2
package is fixed as shown in
http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00456.html

~~ Ricardo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-python-pygobject-use-home-page-of-3.x-series.patch --]
[-- Type: text/x-patch, Size: 1007 bytes --]

From 63b0b09420decc5ee898ad313f602849ad57cfe8 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Mon, 16 Mar 2015 07:50:32 +0100
Subject: [PATCH 1/3] gnu: python-pygobject: use home page of 3.x series.

* gnu/packages/glib.scm (python-pygobject)[home-page]: Use home page of the
  3.x series of the pygobject bindings instead of the home page for the 2.x
  bindings.
---
 gnu/packages/glib.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index a2f3cbc..e0ac718 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -514,7 +514,7 @@ useful for C++.")
      ;; test_callback_user_data_middle_single
      ;; test_callback_user_data_middle_tuple
      '(#:tests? #f))
-    (home-page "https://pypi.python.org/pypi/PyGObject")
+    (home-page "https://live.gnome.org/PyGObject")
     (synopsis "Python bindings for GObject")
     (description
      "Python bindings for GLib, GObject, and GIO.")
-- 
2.1.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-python2-pygobject.patch --]
[-- Type: text/x-patch, Size: 991 bytes --]

From e0493912a049714d6768391149e25e2233043ee6 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Mon, 16 Mar 2015 07:52:40 +0100
Subject: [PATCH 2/3] gnu: Add python2-pygobject.

* gnu/packages/glib.scm (python2-pygobject): New variable.
---
 gnu/packages/glib.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index e0ac718..3c68d86 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -520,6 +520,16 @@ useful for C++.")
      "Python bindings for GLib, GObject, and GIO.")
     (license license:lgpl2.1+)))
 
+(define-public python2-pygobject
+  (package (inherit python-pygobject)
+    (name "python2-pygobject")
+    (inputs
+     `(("python" ,python-2)
+       ("glib" ,glib)
+       ("python-pycairo" ,python2-pycairo)
+       ("gobject-introspection" ,gobject-introspection)
+       ("libffi" ,libffi)))))
+
 (define telepathy-glib
   (package
     (name "telepathy-glib")
-- 
2.1.0


[-- Attachment #4: 0003-gnu-Add-IBus.patch --]
[-- Type: text/x-patch, Size: 4864 bytes --]

From 28659b408990d41259c4eeb1302f593d5a44f638 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Mon, 16 Mar 2015 07:54:13 +0100
Subject: [PATCH 3/3] gnu: Add IBus.

* gnu/packages/ibus.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
 gnu-system.am         |  1 +
 gnu/packages/ibus.scm | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)
 create mode 100644 gnu/packages/ibus.scm

diff --git a/gnu-system.am b/gnu-system.am
index c3e8c5b..ee01a35 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -146,6 +146,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/haskell.scm			\
   gnu/packages/hugs.scm				\
   gnu/packages/hurd.scm				\
+  gnu/packages/ibus.scm				\
   gnu/packages/icu4c.scm			\
   gnu/packages/idutils.scm			\
   gnu/packages/image.scm			\
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
new file mode 100644
index 0000000..55ed6e8
--- /dev/null
+++ b/gnu/packages/ibus.scm
@@ -0,0 +1,97 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages ibus)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (gnu packages)
+  #: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 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 inputs outputs #:allow-other-keys)
+          ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
+          ;; GI_TYPELIB_PATH.
+          (let ((out (assoc-ref outputs "out")))
+            (substitute* (string-append out "/bin/.ibus-setup-real")
+              (("exec ")
+               (string-append "export PYTHONPATH=\""
+                              (getenv "PYTHONPATH")
+                              "${PYTHONPATH:+:}$PYTHONPATH" "\"\n"
+                              "export GI_TYPELIB_PATH=\""
+                              (getenv "GI_TYPELIB_PATH")
+                              ":" out "/lib/girepository-1.0"
+                              "${GI_TYPELIB_PATH:+:}$GI_TYPELIB_PATH"
+                              "\"\n"
+                              "\nexec ")))
+            #t))
+        %standard-phases))))
+   (inputs
+    `(("dbus" ,dbus)
+      ("dconf" ,dconf)
+      ("gconf" ,gconf)
+      ("glib" ,glib)
+      ("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 "Intelligent input bus")
+   (description
+    "IBus means Intelligent Input Bus and is an input framework.")
+   (home-page "http://ibus.googlecode.com/")
+   (license lgpl2.1+)))
-- 
2.1.0


             reply	other threads:[~2015-03-16  7:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16  7:13 Ricardo Wurmus [this message]
2015-03-17  9:04 ` [PATCH] Add IBus Ludovic Courtès
2015-03-26  8:09   ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761a1bejx.fsf@mango.localdomain \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).