From a2e3ccd8ee70e7c068774dbb698e17dcc6d9e010 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Wed, 10 Feb 2021 21:14:59 +0900 Subject: [PATCH] Replace kasumi with kausmi-unicode - Delete to require intltool - Delete to call gettext.bind_textdomain_codeset() --- ibus-anthy-HEAD.patch | 119 ++++++++++++++++++++++++++++++++++++++++++ ibus-anthy.spec | 75 ++++++-------------------- 2 files changed, 136 insertions(+), 58 deletions(-) diff --git a/ibus-anthy-HEAD.patch b/ibus-anthy-HEAD.patch index c15bb68..e5246ca 100644 --- a/ibus-anthy-HEAD.patch +++ b/ibus-anthy-HEAD.patch @@ -614,3 +614,122 @@ index 03a7c31..bff3078 100755 -- 2.24.1 +From c744be610dff270f1c0f0367f809b9df95aeea2d Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 10 Feb 2021 20:50:11 +0900 +Subject: [PATCH] setup: Set ANTHY_PC in _config.py + +Forgot to update setup/Makefile besides engine/Makefile +Also delete deprecated gettext.bind_textdomain_codeset() +--- + setup/python3/Makefile.am | 3 ++- + setup/python3/main.py | 3 +-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/setup/python3/Makefile.am b/setup/python3/Makefile.am +index 90b3aa1..1eb3747 100644 +--- a/setup/python3/Makefile.am ++++ b/setup/python3/Makefile.am +@@ -4,7 +4,7 @@ + # + # Copyright (c) 2007-2008 Peng Huang + # Copyright (c) 2009 Hideaki ABE +-# Copyright (c) 2010-2017 Takao Fujiwara ++# Copyright (c) 2010-2021 Takao Fujiwara + # Copyright (c) 2007-2017 Red Hat, Inc. + # + # This program is free software; you can redistribute it and/or modify +@@ -86,6 +86,7 @@ _config.py: _config.py.in + sed -e "s|\@pkgdatadir\@|$(pkgdatadir)|g" \ + -e "s|\@libexecdir\@|$(libexecdir)|g" \ + -e "s|\@datadir\@|$(datadir)|g" \ ++ -e "s|\@ANTHY_PC\@|$(ANTHY_PC)|g" \ + -e "s|\@LAYOUT\@|$(LAYOUT)|g" \ + -e "s|\@SYMBOL_CHAR_INT\@|$(SYMBOL_CHAR_INT)|g" \ + -e "s|\@ICON_PREFERENCE\@|$(ICON_PREFERENCE)|g" \ +diff --git a/setup/python3/main.py b/setup/python3/main.py +index 340e8ef..7e16093 100644 +--- a/setup/python3/main.py ++++ b/setup/python3/main.py +@@ -4,7 +4,7 @@ + # + # Copyright (c) 2007-2008 Peng Huang + # Copyright (c) 2009 Hideaki ABE +-# Copyright (c) 2010-2019 Takao Fujiwara ++# Copyright (c) 2010-2021 Takao Fujiwara + # Copyright (c) 2007-2019 Red Hat, Inc. + # + # This program is free software; you can redistribute it and/or modify +@@ -76,7 +76,6 @@ class AnthySetup(object): + except AttributeError: + pass + gettext.bindtextdomain(DOMAINNAME, config.LOCALEDIR) +- gettext.bind_textdomain_codeset(DOMAINNAME, 'UTF-8') + + self.__prefs = AnthyPrefs() + +-- +2.28.0 + +From 00bab0ac26dfcd635f559b68ef76cc662a51f35b Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 10 Feb 2021 20:52:30 +0900 +Subject: [PATCH] data: Enable to configure kasumi-unicode in gschema + +kasumi-unicode can be generated from kasumi source codes +with anthy-unicode but not anthy. +kasumi-unicode can save the dicts in XDG config dir but not +$HOME/.anthy + +% ./configure --with-kasumi-exec=/usr/bin/kasumi-unicode +--- + data/Makefile.am | 4 +++- + data/org.freedesktop.ibus.engine.anthy.gschema.xml.in | 4 ++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/data/Makefile.am b/data/Makefile.am +index da86209..5e45c39 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -2,7 +2,7 @@ + # + # ibus-anthy - The Anthy engine for IBus + # +-# Copyright (c) 2010-2018 Takao Fujiwara ++# Copyright (c) 2010-2021 Takao Fujiwara + # Copyright (c) 2010-2018 Red Hat, Inc. + # + # This program is free software; you can redistribute it and/or modify +@@ -49,8 +49,10 @@ $(metainfo_DATA): $(metainfo_in_files) Makefile + $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@ + + $(schemas_DATA): $(schemas_in_files) ++ KASUMI_EXEC_BASENAME=`basename $(KASUMI_EXEC_FILE)`; \ + $(SED) -e "s|\@ANTHY_ZIPCODE_FILE\@|$(ANTHY_ZIPCODE_FILE)|g" \ + -e "s|\@KASUMI_EXEC_FILE\@|$(KASUMI_EXEC_FILE)|g" \ ++ -e "s|\@KASUMI_EXEC_BASENAME\@|$$KASUMI_EXEC_BASENAME|g" \ + -e "s|\@KASUMI_ICON_FILE\@|$(KASUMI_ICON_FILE)|g" \ + -e "s|\@ON_OFF_KEYS\@|$(ON_OFF_KEYS)|g" \ + -e "s|\@pkgdatadir\@|$(pkgdatadir)|g" \ +diff --git a/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in b/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in +index 3b68b4b..773be09 100644 +--- a/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in ++++ b/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in +@@ -108,12 +108,12 @@ + + + +- ['@KASUMI_EXEC_FILE@', 'kasumi'] ++ ['@KASUMI_EXEC_FILE@', '@KASUMI_EXEC_BASENAME@'] + Dictionary Administration Command + + + +- ['@KASUMI_EXEC_FILE@', 'kasumi', '-a'] ++ ['@KASUMI_EXEC_FILE@', '@KASUMI_EXEC_BASENAME@', '-a'] + Add Word Command + + +-- +2.28.0 + diff --git a/ibus-anthy.spec b/ibus-anthy.spec index 23af2b6..0ce8199 100644 --- a/ibus-anthy.spec +++ b/ibus-anthy.spec @@ -3,23 +3,12 @@ %global require_ibus_version 1.5.3 %global have_default_layout 1 %global have_bridge_hotkey 1 - -%if (0%{?fedora} > 19 || 0%{?rhel} > 7) %global with_python3 1 -%else -%global with_python3 0 -%endif -%if (0%{?fedora} > 22 || 0%{?rhel} > 7) -%global with_metainfo 1 +%if (0%{?fedora} > 33 || 0%{?rhel} > 8) +%bcond_without kasumi_unicode %else -%global with_metainfo 0 -%endif - -%if (0%{?fedora} > 27 || 0%{?rhel} > 7) -%global with_gtk_script 0 -%else -%global with_gtk_script 1 +%bcond_with kasumi_unicode %endif %if %with_python3 @@ -29,7 +18,7 @@ Name: ibus-anthy Version: 1.5.11 -Release: 9%{?dist} +Release: 10%{?dist} Summary: The Anthy engine for IBus input platform License: GPLv2+ URL: https://github.com/ibus/ibus/wiki @@ -46,24 +35,17 @@ BuildRequires: git BuildRequires: glib2-devel BuildRequires: gobject-introspection-devel BuildRequires: ibus -BuildRequires: intltool BuildRequires: libtool BuildRequires: pkgconfig -BuildRequires: make -%if %with_python3 BuildRequires: python3-devel BuildRequires: python3-gobject -%else -BuildRequires: python2-devel -% if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7) -BuildRequires: pygobject3-base -% else -BuildRequires: python2-gobject-base -% endif -%endif Requires: ibus >= %{require_ibus_version} +%if %{with kasumi_unicode} +Requires: kasumi-unicode +%else Requires: kasumi +%endif Requires: anthy-unicode Requires: %{name}-python = %{version}-%{release} @@ -76,18 +58,8 @@ Summary: Anthy Python files for IBus BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: gtk3 -%if %with_python3 Requires: python3-cairo Requires: python3-gobject -%else -% if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7) -Requires: pycairo -Requires: pygobject3 -% else -Requires: python2-cairo -Requires: python2-gobject -% endif -%endif %description python This package contains the Anthy Python files for IBus @@ -125,10 +97,11 @@ autoreconf -f -i -v %if %have_bridge_hotkey --with-hotkeys \ %endif - --with-on-off-keys="'Zenkaku_Hankaku', 'Ctrl+space', 'Ctrl+J'" \ -%if %with_python3 - --with-python=python3 \ +%if %{with kasumi_unicode} + --with-kasumi-exec=/usr/bin/kasumi-unicode \ %endif + --with-on-off-keys="'Zenkaku_Hankaku', 'Ctrl+space', 'Ctrl+J'" \ + --with-python=python3 \ --enable-installed-tests \ --disable-static # make -C po update-gmo @@ -138,9 +111,6 @@ make %{?_smp_mflags} make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' rm -f $RPM_BUILD_ROOT%{_libdir}/libanthygobject-%{sub_version}.la -%if ! %with_metainfo -rm $RPM_BUILD_ROOT%{_datadir}/metainfo/*.metainfo.xml -%endif %find_lang %{name} @@ -150,25 +120,11 @@ desktop-file-validate \ %post /sbin/ldconfig -%if %with_gtk_script -glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : -# recreate icon cache -touch --no-create %{_datadir}/icons/hicolor || : -[ -x %{_bindir}/gtk-update-icon-cache ] && \ - %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : -%endif [ -x %{_bindir}/ibus ] && \ %{_bindir}/ibus write-cache --system &>/dev/null || : %postun /sbin/ldconfig -%if %with_gtk_script -glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : -# recreate icon cache -touch --no-create %{_datadir}/icons/hicolor || : -[ -x %{_bindir}/gtk-update-icon-cache ] && \ - %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : -%endif [ -x %{_bindir}/ibus ] && \ %{_bindir}/ibus write-cache --system &>/dev/null || : @@ -184,9 +140,7 @@ touch --no-create %{_datadir}/icons/hicolor || : %files python %{_libexecdir}/ibus-*-anthy -%if %with_metainfo %{_datadir}/metainfo/*.metainfo.xml -%endif %{_datadir}/applications/ibus-setup-anthy.desktop %{_datadir}/ibus-anthy/engine %{_datadir}/ibus-anthy/setup @@ -204,6 +158,11 @@ touch --no-create %{_datadir}/icons/hicolor || : %{_datadir}/installed-tests/%{name} %changelog +* Wed Feb 10 2021 Takao Fujiwara - 1.5.11-10 +- Replace kasumi with kausmi-unicode +- Delete to require intltool +- Delete to call gettext.bind_textdomain_codeset() + * Tue Jan 26 2021 Fedora Release Engineering - 1.5.11-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild