kime: 2.5.6 -> 3.0.2

This commit is contained in:
Riey 2022-11-26 00:29:05 +09:00 committed by pennae
parent 7eb824334d
commit 0db47bd50e
4 changed files with 61 additions and 42 deletions

View file

@ -276,6 +276,17 @@
or configure your firewall.
</para>
</listitem>
<listitem>
<para>
Kime has been updated from 2.5.6 to 3.0.2 and the
<literal>i18n.inputMethod.kime.config</literal> option has
been removed. Users should use
<literal>daemonModules</literal>,
<literal>iconColor</literal>, and
<literal>extraConfig</literal> options under
<literal>i18n.inputMethod.kime</literal> instead.
</para>
</listitem>
<listitem>
<para>
<literal>llvmPackages_rocm.llvm</literal> will not contain

View file

@ -71,6 +71,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- The [services.unifi-video.openFirewall](#opt-services.unifi-video.openFirewall) module option default value has been changed from `true` to `false`. You will need to explicitly set this option to `true`, or configure your firewall.
- Kime has been updated from 2.5.6 to 3.0.2 and the `i18n.inputMethod.kime.config` option has been removed. Users should use `daemonModules`, `iconColor`, and `extraConfig` options under `i18n.inputMethod.kime` instead.
- `llvmPackages_rocm.llvm` will not contain `clang` or `compiler-rt`. `llvmPackages_rocm.clang` will not contain `llvm`. `llvmPackages_rocm.clangNoCompilerRt` has been removed in favor of using `llvmPackages_rocm.clang-unwrapped`.
- The EC2 image module previously detected and automatically mounted ext3-formatted instance store devices and partitions in stage-1 (initramfs), storing `/tmp` on the first discovered device. This behaviour, which only catered to very specific use cases and could not be disabled, has been removed. Users relying on this should provide their own implementation, and probably use ext4 and perform the mount in stage-2.

View file

@ -1,40 +1,37 @@
{ config, pkgs, lib, generators, ... }:
with lib;
let
cfg = config.i18n.inputMethod.kime;
yamlFormat = pkgs.formats.yaml { };
in
{
options = {
i18n.inputMethod.kime = {
config = mkOption {
type = yamlFormat.type;
default = { };
example = literalExpression ''
{
daemon = {
modules = ["Xim" "Indicator"];
};
let imcfg = config.i18n.inputMethod;
in {
imports = [
(lib.mkRemovedOptionModule [ "i18n" "inputMethod" "kime" "config" ] "Use i18n.inputMethod.kime.* instead")
];
indicator = {
icon_color = "White";
};
engine = {
hangul = {
layout = "dubeolsik";
};
};
}
'';
description = lib.mdDoc ''
kime configuration. Refer to <https://github.com/Riey/kime/blob/v${pkgs.kime.version}/docs/CONFIGURATION.md> for details on supported values.
'';
};
options.i18n.inputMethod.kime = {
daemonModules = lib.mkOption {
type = lib.types.listOf (lib.types.enum [ "Xim" "Wayland" "Indicator" ]);
default = [ "Xim" "Wayland" "Indicator" ];
example = [ "Xim" "Indicator" ];
description = lib.mdDoc ''
List of enabled daemon modules
'';
};
iconColor = lib.mkOption {
type = lib.types.enum [ "Black" "White" ];
default = "Black";
example = "White";
description = lib.mdDoc ''
Color of the indicator icon
'';
};
extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
description = lib.mdDoc ''
extra kime configuration. Refer to <https://github.com/Riey/kime/blob/v${pkgs.kime.version}/docs/CONFIGURATION.md> for details on supported values.
'';
};
};
config = mkIf (config.i18n.inputMethod.enabled == "kime") {
config = lib.mkIf (imcfg.enabled == "kime") {
i18n.inputMethod.package = pkgs.kime;
environment.variables = {
@ -43,7 +40,12 @@ in
XMODIFIERS = "@im=kime";
};
environment.etc."xdg/kime/config.yaml".text = replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config);
environment.etc."xdg/kime/config.yaml".text = ''
daemon:
modules: [${lib.concatStringsSep "," imcfg.kime.daemonModules}]
indicator:
icon_color: ${imcfg.kime.iconColor}
'' + imcfg.kime.extraConfig;
};
# uses attributes of the linked package

View file

@ -2,32 +2,34 @@
, withWayland ? true
, withIndicator ? true, dbus, libdbusmenu
, withXim ? true, xorg, cairo
, withGtk2 ? true, gtk2
, withGtk3 ? true, gtk3
, withGtk4 ? true, gtk4
, withQt5 ? true, qt5
, withQt6 ? false, qt6
}:
let
cmake_args = lib.optionals withGtk2 ["-DENABLE_GTK2=ON"]
++ lib.optionals withGtk3 ["-DENABLE_GTK3=ON"]
++ lib.optionals withQt5 ["-DENABLE_QT5=ON"];
cmake_args = lib.optionals withGtk3 ["-DENABLE_GTK3=ON"]
++ lib.optionals withGtk4 ["-DENABLE_GTK4=ON"]
++ lib.optionals withQt5 ["-DENABLE_QT5=ON"]
++ lib.optionals withQt6 ["-DENABLE_QT6=ON"];
optFlag = w: (if w then "1" else "0");
in
stdenv.mkDerivation rec {
pname = "kime";
version = "2.5.6";
version = "3.0.2";
src = fetchFromGitHub {
owner = "Riey";
repo = pname;
rev = "v${version}";
sha256 = "sha256-r5luI6B4IjNTbh2tzpqabokgwkmbyXrA61+F2HDEWuo=";
sha256 = "sha256-qLQ6DmV7KHhdXWR5KtO52cmXBm818zKJVj4nxsR14dc=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
sha256 = "sha256-GvBnNPY51RPt+I73oet5tB/EE2UsEPKbelJZkSY3xNw=";
sha256 = "sha256-/o9b7YvrpV+IujkllFWAz6Mg4CbS9BInF8antfZ0Vsw=";
};
# Replace autostart path
@ -68,6 +70,7 @@ stdenv.mkDerivation rec {
export KIME_ICON_DIR=share/icons
export KIME_LIB_DIR=lib
export KIME_QT5_DIR=lib/qt-${qt5.qtbase.version}
export KIME_QT6_DIR=lib/qt-${qt6.qtbase.version}
bash scripts/install.sh "$out"
runHook postInstall
'';
@ -84,9 +87,10 @@ stdenv.mkDerivation rec {
buildInputs = lib.optionals withIndicator [ dbus libdbusmenu ]
++ lib.optionals withXim [ xorg.libxcb cairo ]
++ lib.optionals withGtk2 [ gtk2 ]
++ lib.optionals withGtk3 [ gtk3 ]
++ lib.optionals withQt5 [ qt5.qtbase ];
++ lib.optionals withGtk4 [ gtk4 ]
++ lib.optionals withQt5 [ qt5.qtbase ]
++ lib.optionals withQt6 [ qt6.qtbase ];
nativeBuildInputs = [
pkg-config