%global upstream_release 1 %global srcname ngosen-ngosen-%{version}-%{upstream_release} Name: fcitx5-ngosen # Keeps Fedora builds comparable with the upstream COPR builds, which carry this epoch. Epoch: 1 Version: 1.13.2 Release: %autorelease Summary: Vietnamese input method for fcitx5 # Ngó Sen: GPL-3.0-or-later # Typing core (bamboo-rs/): LGPL-2.1-or-later # Vietnamese word list: GPL-3.0-or-later # English word lists: LicenseRef-SCOWL # Emoji keywords: Unicode-3.0 # Statically linked crates: see LICENSE.dependencies SourceLicense: GPL-3.0-or-later AND LGPL-2.1-or-later AND LicenseRef-SCOWL AND Unicode-3.0 License: %{shrink: GPL-3.0-or-later AND LGPL-2.1-or-later AND LicenseRef-SCOWL AND Unicode-3.0 AND MIT AND (MIT OR Apache-2.0) } URL: https://github.com/ngosen/ngosen Source0: %{url}/archive/ngosen-%{version}-%{upstream_release}/%{srcname}.tar.gz Source1: README.fedora BuildRequires: cargo-rpm-macros >= 26 BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: extra-cmake-modules BuildRequires: gcc-c++ BuildRequires: gettext-devel BuildRequires: libappstream-glib BuildRequires: librsvg2-tools BuildRequires: python3-devel BuildRequires: cmake(Fcitx5Core) Requires: fcitx5 Requires: hicolor-icon-theme # The settings window runs on Qt or on libadwaita. Gtk 4 needs the cairo # typelib, which Fedora ships in gobject-introspection. Requires: ((python3-QtPy and (python3-pyqt6 or python3-pyside6) and qt6-qtsvg) or (python3-gobject and gobject-introspection and libadwaita >= 1.5)) Requires: python3-dbus # Loaded with dlopen, so the automatic soname dependencies miss it. Requires: libxcb%{?_isa} %description Ngó Sen is a Vietnamese input method for fcitx5. It types Telex and VNI, either with underlined preedit text or straight into the app, can fix words typed before switching to Vietnamese, and comes with a settings window. %prep %autosetup -n %{srcname} cp -p %{SOURCE1} . rm -rf bamboo-rs/vendor cd bamboo-rs %cargo_prep %generate_buildrequires cd bamboo-rs %cargo_generate_buildrequires %build %cmake \ -DNGOSEN_VENDORED_CRATES:BOOL=OFF \ -DNGOSEN_BYTECOMPILE_PYTHON:BOOL=OFF \ -DBUILD_TESTING:BOOL=ON %cmake_build cd bamboo-rs %{cargo_license_summary} %{cargo_license} > ../LICENSE.dependencies %install %cmake_install %find_lang %{name} %py_byte_compile %{python3} %{buildroot}%{_datadir}/fcitx5-ngosen # Only GNOME 50.0-50.3 needs it, and Fedora ships newer GNOME releases. rm -rf %{buildroot}%{_datadir}/gnome-shell/extensions/forward-keys@ngosen.github.io # Shipped with %%license instead. rm -rf %{buildroot}%{_datadir}/licenses/%{name} %check %ctest --no-tests=error desktop-file-validate %{buildroot}%{_datadir}/applications/io.github.ngosen.NgoSen.Settings.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/io.github.ngosen.NgoSen.metainfo.xml %files -f %{name}.lang %license LICENSES/GPL-3.0-or-later.txt LICENSES/LGPL-2.1-or-later.txt LICENSES/Unicode-3.0.txt %license data/dictionaries/LICENSE.vietnamese.cm.dict data/english-common.txt.license %license LICENSE.dependencies %doc README.md README.en.md README.fedora %{_bindir}/fcitx5-ngosen-settings %{_bindir}/ngosen-save-log %{_bindir}/ngosen-toggle %{_libdir}/fcitx5/libngosen.so %{_libdir}/fcitx5/libngosenmigrate.so %{_datadir}/fcitx5/addon/ngosen.conf %{_datadir}/fcitx5/addon/ngosenmigrate.conf %{_datadir}/fcitx5/default/vi_VN %{_datadir}/fcitx5/inputmethod/ngosen.conf %{_datadir}/fcitx5/ngosen/ %{_datadir}/fcitx5-ngosen/ %{_datadir}/applications/io.github.ngosen.NgoSen.Settings.desktop %{_metainfodir}/io.github.ngosen.NgoSen.metainfo.xml %{_datadir}/icons/hicolor/*/*/*ngosen* %dir %{_datadir}/icons/breeze %dir %{_datadir}/icons/breeze/status %dir %{_datadir}/icons/breeze/status/22 %dir %{_datadir}/icons/breeze/status/24 %{_datadir}/icons/breeze/status/*/fcitx-ngosen*.svg %dir %{_datadir}/icons/breeze-dark %dir %{_datadir}/icons/breeze-dark/status %dir %{_datadir}/icons/breeze-dark/status/22 %dir %{_datadir}/icons/breeze-dark/status/24 %{_datadir}/icons/breeze-dark/status/*/fcitx-ngosen*.svg %changelog %autochangelog