From patchwork Wed Feb 9 02:12:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhu Zihao X-Patchwork-Id: 37129 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9BD0E27BBEA; Wed, 9 Feb 2022 02:14:26 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DA79327BBE9 for ; Wed, 9 Feb 2022 02:14:25 +0000 (GMT) Received: from localhost ([::1]:45712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHcUz-00009N-1Y for patchwork@mira.cbaines.net; Tue, 08 Feb 2022 21:14:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHcUc-000095-B7 for guix-patches@gnu.org; Tue, 08 Feb 2022 21:14:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHcUb-0000YV-RO for guix-patches@gnu.org; Tue, 08 Feb 2022 21:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHcUb-0003r8-NX for guix-patches@gnu.org; Tue, 08 Feb 2022 21:14:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53648] [PATCH] gnu: fcitx5-gtk: Add GTK 4 support. Resent-From: Zhu Zihao Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 02:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53648 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 53648@debbugs.gnu.org Received: via spool by 53648-submit@debbugs.gnu.org id=B53648.164437284014809 (code B ref 53648); Wed, 09 Feb 2022 02:14:01 +0000 Received: (at 53648) by debbugs.gnu.org; 9 Feb 2022 02:14:00 +0000 Received: from localhost ([127.0.0.1]:49231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHcUa-0003qm-52 for submit@debbugs.gnu.org; Tue, 08 Feb 2022 21:14:00 -0500 Received: from mail-m971.mail.163.com ([123.126.97.1]:59026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHcUW-0003qT-AV for 53648@debbugs.gnu.org; Tue, 08 Feb 2022 21:13:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=07IEB YXkQJ+BqbnGtgSevNNx59So+9JqRI8g82+CTXU=; b=a4beOApC11g1uhG4fizKH 2HtJTil7jL7Ey7c4o7PMY6QWc4XdreUNGHuj2fAC7QmmZfUp3oqfumntWea7xu7G ELFGKdnyNFTMaqaWGTY8eObwzEHculVjLWcEGE0RPbOTINpccmwPJo1bs3u+i9CR oHL+4y/aO51aoaNjP7sbRk= Received: from asus-laptop (unknown [112.95.111.199]) by smtp1 (Coremail) with SMTP id GdxpCgC3tKJZIwNiOeJrBg--.9098S2; Wed, 09 Feb 2022 10:13:47 +0800 (CST) References: <86ilu09yzs.fsf@163.com> <8635kwasnn.fsf@163.com> <86czjz8fmt.fsf@163.com> <86pmnyyooc.fsf@163.com> User-agent: mu4e 1.6.10; emacs 27.2 From: Zhu Zihao Date: Wed, 09 Feb 2022 10:12:10 +0800 In-reply-to: Message-ID: <86wni4yeg9.fsf@163.com> MIME-Version: 1.0 X-CM-TRANSID: GdxpCgC3tKJZIwNiOeJrBg--.9098S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvj4RWeHgUUUUU X-Originating-IP: [112.95.111.199] X-CM-SenderInfo: pdoosuxxwbztlvw6il2tof0z/xtbBaxuir1et3CFKjgAAs+ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches #$ ungexp reader macro doesn't support variable as output specification makes code look a litte cumbersome... From 231d1a839daf5ff5f7845a0084d8cbefd7238ad3 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Mon, 7 Feb 2022 13:55:26 +0800 Subject: [PATCH 2/2] gnu: fcitx5-gtk: Split IM module output for different version of GTK. * gnu/packages/fcitx5.scm (fcitx5-gtk)[arguments]: Use G-Expression. : Split input method module into different outputs for GTK2, GTK3 and GTK4. Now default output only provides GLib client of Fcitx5. [inputs]: Use label-less style inputs. [outputs]: Add new "gtk3" output. [synopsis]: Fix typo. [description]: Describe the functionality of each output. --- gnu/packages/fcitx5.scm | 87 +++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 37 deletions(-) diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm index 123418cd4f..b1938619f9 100644 --- a/gnu/packages/fcitx5.scm +++ b/gnu/packages/fcitx5.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020 Zhu Zihao +;;; Copyright © 2020, 2022 Zhu Zihao ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. @@ -20,6 +20,7 @@ (define-module (gnu packages fcitx5) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) @@ -196,48 +197,60 @@ (define-public fcitx5-gtk (base32 "07ip4sxf3q895pp7mivv2bdwcmqjnwrmv9pg99jk73cw9bgyq00n")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ;No test - #:configure-flags - (list (string-append "-DGOBJECT_INTROSPECTION_GIRDIR=" - %output "/share/gir-1.0") - (string-append "-DGOBJECT_INTROSPECTION_TYPELIBDIR=" - %output "/lib/girepository-1.0")) - #:phases - (modify-phases %standard-phases - (add-before 'configure 'patch-install-prefix - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (gtk2 (assoc-ref outputs "gtk2")) - (gtk4 (assoc-ref outputs "gtk4"))) - ;; Install GTK+ 2 input method module to its own output. - (substitute* "gtk2/CMakeLists.txt" - (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") - (string-append gtk2 "/lib"))) + (list + #:tests? #f ;No test + #:configure-flags + #~(list (string-append "-DGOBJECT_INTROSPECTION_GIRDIR=" + #$output "/share/gir-1.0") + (string-append "-DGOBJECT_INTROSPECTION_TYPELIBDIR=" + #$output "/lib/girepository-1.0")) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'patch-install-prefix + (lambda* (#:key outputs #:allow-other-keys) + ;; Take care of different versions of GTK because this package + ;; provides IM module for GTK application to use input method. + (define (split-immodule gtk-version output) + (substitute* (string-append gtk-version "/CMakeLists.txt") + (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") + (string-append output "/lib")))) - ;; Install for GTK 4. - (substitute* "gtk4/CMakeLists.txt" - (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") - (string-append gtk4 "/lib"))))))))) + (let ((gtk2 #$output:gtk2) + (gtk3 #$output:gtk3) + (gtk4 #$output:gtk4)) + (for-each split-immodule + '("gtk2" "gtk3" "gtk4") + (list gtk2 gtk3 gtk4)))))))) (inputs - `(("fcitx5" ,fcitx5) - ("fmt" ,fmt) - ("libxkbcommon" ,libxkbcommon) - ("gobject-introspection" ,gobject-introspection) - ("gtk2" ,gtk+-2) - ("gtk3" ,gtk+) - ("gtk4" ,gtk) - ("glib" ,glib) - ("libx11" ,libx11) - ("gettext" ,gettext-minimal))) + (list fcitx5 + fmt + libx11 + libxkbcommon + gettext + gobject-introspection + gtk+-2 + gtk+ + gtk + glib)) (native-inputs (list extra-cmake-modules pkg-config `(,glib "bin"))) ;for glib-genmarshal - ;; TODO: Add "lib" output to reduce the closure size of "gtk2". - (outputs '("out" "gtk2" "gtk4")) + (outputs '("out" "gtk2" "gtk3" "gtk4")) (home-page "https://github.com/fcitx/fcitx5-gtk") - (synopsis "Glib based D-Bus client and GTK IM module for Fcitx 5") - (description "Fcitx5-gtk provides a Glib based D-Bus client and IM module -for GTK+2/GTK+3 application.") + (synopsis "GLib-based D-Bus client and GTK IM module for Fcitx 5") + (description "Fcitx5-gtk provides following functionality in corresponding +output: + +@table @code +@item out +GLib-based D-Bus client of Fcitx5. +@item gtk2 +IM module for GTK+2 applications. +@item gtk3 +IM module for GTK+3 applications. +@item gtk4 +IM module for GTK4 applications. +@end table") (license license:lgpl2.1+))) (define-public fcitx5-qt -- 2.34.0