push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
pkg-config,
buildPackages,
cmake,
extra-cmake-modules,
wayland-scanner,
cairo,
pango,
expat,
fribidi,
wayland,
systemd,
wayland-protocols,
json_c,
isocodes,
xkeyboard_config,
enchant,
gdk-pixbuf,
libGL,
libuuid,
libselinux,
libXdmcp,
libsepol,
libxkbcommon,
libthai,
libdatrie,
xcbutilkeysyms,
xcbutil,
xcbutilwm,
xcb-imdkit,
libxkbfile,
nixosTests,
gettext,
}:
let
enDictVer = "20121020";
enDict = fetchurl {
url = "https://download.fcitx-im.org/data/en_dict-${enDictVer}.tar.gz";
hash = "sha256-xEpdeEeSXuqeTS0EdI1ELNKN2SmaC1cu99kerE9abOs=";
};
in
stdenv.mkDerivation rec {
pname = "fcitx5";
version = "5.1.14";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-wLJZyoWjf02+m8Kw+IcfbZY2NnjMGtCWur2+w141eS4=";
};
prePatch = ''
ln -s ${enDict} src/modules/spell/$(stripHash ${enDict})
'';
nativeBuildInputs = [
cmake
extra-cmake-modules
pkg-config
wayland-scanner
gettext
];
buildInputs = [
expat
isocodes
cairo
enchant
pango
libthai
libdatrie
fribidi
systemd
gdk-pixbuf
wayland
wayland-protocols
json_c
libGL
libuuid
libselinux
libsepol
libXdmcp
libxkbcommon
xcbutil
xcbutilwm
xcbutilkeysyms
xcb-imdkit
xkeyboard_config
libxkbfile
];
cmakeFlags = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
(lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages))
];
strictDeps = true;
passthru = {
updateScript = ./update.py;
tests = {
inherit (nixosTests) fcitx5;
};
};
meta = with lib; {
description = "Next generation of fcitx";
homepage = "https://github.com/fcitx/fcitx5";
license = licenses.lgpl21Plus;
mainProgram = "fcitx5";
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchurl,
cmake,
extra-cmake-modules,
pkg-config,
fcitx5,
anthy,
gettext,
zstd,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-anthy";
version = "5.1.7";
src = fetchurl {
url = "https://download.fcitx-im.org/fcitx5/fcitx5-anthy/${pname}-${version}.tar.zst";
hash = "sha256-lY5GFbeIee7u1NsLbkYt6BvST9lidvZLpaylL0wE2+0=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext # msgfmt
pkg-config
zstd
];
buildInputs = [
fcitx5
anthy
];
meta = with lib; {
description = "Anthy Wrapper for Fcitx5";
homepage = "https://github.com/fcitx/fcitx5-anthy";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ elnudev ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
fcitx5,
gettext,
go,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "fcitx5-bamboo";
version = "1.0.8";
src = fetchFromGitHub {
owner = "fcitx";
repo = "fcitx5-bamboo";
rev = finalAttrs.version;
hash = "sha256-cnrW25M9nluBLa+9Mynzkn/6AiGccSbtjS8p+L4ZDKM=";
fetchSubmodules = true;
};
strictDeps = true;
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
go
];
buildInputs = [
fcitx5
];
preConfigure = ''
export GOCACHE=$TMPDIR/go-cache
'';
meta = {
description = "Vietnamese input method engine support for Fcitx";
homepage = "https://github.com/fcitx/fcitx5-bamboo";
license = lib.licenses.lgpl21Plus;
maintainers = [ ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
gettext,
fcitx5,
libchewing,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-chewing";
version = "5.1.8";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-On8lbZL7hyY399a/q6iCNkDvRljv3zirzEO1wIG+MNE=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
];
buildInputs = [
fcitx5
libchewing
];
meta = with lib; {
description = "Chewing wrapper for Fcitx5";
homepage = "https://github.com/fcitx/fcitx5-chewing";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ xrelkd ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,84 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
cmake,
extra-cmake-modules,
boost,
gettext,
libime,
fcitx5,
fcitx5-qt,
fcitx5-lua,
qtwebengine,
opencc,
curl,
fmt,
qtbase,
luaSupport ? true,
}:
let
pyStrokeVer = "20250329";
pyStroke = fetchurl {
url = "http://download.fcitx-im.org/data/py_stroke-${pyStrokeVer}.tar.gz";
hash = "sha256-wafKciXTYUq4M1P8gnUDAGqYBEd2IBj1N2BCXXtTA6Y=";
};
pyTableVer = "20121124";
pyTable = fetchurl {
url = "http://download.fcitx-im.org/data/py_table-${pyTableVer}.tar.gz";
hash = "sha256-QhRqyX3mwT1V+eme2HORX0xmc56cEVMqNFVrrfl5LAQ=";
};
in
stdenv.mkDerivation rec {
pname = "fcitx5-chinese-addons";
version = "5.1.9";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-xHLd7X9IdYTsVyqbghVzdC2i9AVipFHKRxP2Zqq7zGw=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
fcitx5-lua
];
prePatch = ''
ln -s ${pyStroke} modules/pinyinhelper/$(stripHash ${pyStroke})
ln -s ${pyTable} modules/pinyinhelper/$(stripHash ${pyTable})
'';
buildInputs = [
boost
fcitx5
fcitx5-qt
libime
curl
opencc
qtwebengine
fmt
qtbase
]
++ lib.optional luaSupport fcitx5-lua;
dontWrapQtApps = true;
meta = with lib; {
description = "Addons related to Chinese, including IME previous bundled inside fcitx4";
mainProgram = "scel2org5";
homepage = "https://github.com/fcitx/fcitx5-chinese-addons";
license = with licenses; [
gpl2Plus
lgpl21Plus
];
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,94 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
pkg-config,
fcitx5,
fcitx5-qt,
qtbase,
qtsvg,
qtwayland,
qtdeclarative,
qtx11extras ? null,
kitemviews,
kwidgetsaddons,
qtquickcontrols2 ? null,
kcoreaddons,
kdeclarative,
kirigami ? null,
kirigami2 ? null,
isocodes,
xkeyboardconfig,
libxkbfile,
libplasma ? null,
plasma-framework ? null,
wrapQtAppsHook,
kcmSupport ? true,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-configtool";
version = "5.1.10";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-Py2UDBQRqvT7kwZeQIXKrIjGAbOjjxEyEfO5tdtizW4=";
};
cmakeFlags = [
(lib.cmakeBool "KDE_INSTALL_USE_QT_SYS_PATHS" true)
(lib.cmakeBool "ENABLE_KCM" kcmSupport)
];
nativeBuildInputs = [
cmake
extra-cmake-modules
pkg-config
wrapQtAppsHook
];
buildInputs = [
fcitx5
fcitx5-qt
qtbase
qtsvg
qtwayland
kitemviews
kwidgetsaddons
isocodes
xkeyboardconfig
libxkbfile
]
++ lib.optionals (lib.versions.major qtbase.version == "5") [
qtx11extras
]
++ lib.optionals kcmSupport (
[
qtdeclarative
kcoreaddons
kdeclarative
]
++ lib.optionals (lib.versions.major qtbase.version == "5") [
qtquickcontrols2
plasma-framework
kirigami2
]
++ lib.optionals (lib.versions.major qtbase.version == "6") [
libplasma
kirigami
]
);
meta = with lib; {
description = "Configuration Tool for Fcitx5";
homepage = "https://github.com/fcitx/fcitx5-configtool";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
mainProgram = "fcitx5-config-qt";
};
}

View File

@@ -0,0 +1,85 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
fcitx5,
gobject-introspection,
glib,
gtk2,
gtk3,
gtk4,
fmt,
pcre,
libuuid,
libselinux,
libsepol,
libthai,
libdatrie,
libXdmcp,
libxkbcommon,
libepoxy,
dbus,
at-spi2-core,
libXtst,
withGTK2 ? false,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-gtk";
version = "5.1.4";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-MlBLhgqpF+A9hotnhX83349wIpCQfzsqpyZb0xME2XQ=";
};
outputs = [
"out"
"dev"
];
cmakeFlags = [
"-DGOBJECT_INTROSPECTION_GIRDIR=share/gir-1.0"
"-DGOBJECT_INTROSPECTION_TYPELIBDIR=lib/girepository-1.0"
]
++ lib.optional (!withGTK2) "-DENABLE_GTK2_IM_MODULE=off";
buildInputs = [
glib
gtk3
gtk4
fmt
fcitx5
pcre
libuuid
libselinux
libsepol
libthai
libdatrie
libXdmcp
libxkbcommon
libepoxy
dbus
at-spi2-core
libXtst
]
++ lib.optional withGTK2 gtk2;
nativeBuildInputs = [
cmake
extra-cmake-modules
gobject-introspection
];
meta = with lib; {
description = "Fcitx5 gtk im module and glib based dbus client library";
homepage = "https://github.com/fcitx/fcitx5-gtk";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
gettext,
fcitx5,
libhangul,
nixosTests,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-hangul";
version = "5.1.7";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-66VW/hzKMVwXd7ktPQHrVbsWazKedS+/giTLIh5fkwo=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
];
buildInputs = [
fcitx5
libhangul
];
passthru.tests = {
inherit (nixosTests) fcitx5;
};
meta = with lib; {
description = "Hangul wrapper for Fcitx5";
homepage = "https://github.com/fcitx/fcitx5-hangul";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ xrelkd ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
fcitx5,
lua,
gettext,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-lua";
version = "5.0.15";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-BhsckLi6FSrRw+QZ8pTEgjV4BaTKSKAJtmcRCFoOUwU=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
];
buildInputs = [
fcitx5
lua
];
passthru = {
extraLdLibraries = [ lua ];
};
meta = with lib; {
description = "Lua support for Fcitx 5";
homepage = "https://github.com/fcitx/fcitx5-lua";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
pkg-config,
fcitx5,
m17n_lib,
m17n_db,
gettext,
nixosTests,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-m17n";
version = "5.1.4";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-TJMJGjO9V6EOzxt6Z7rwOfIQWK38XolDhUKbjbNUGhA=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
pkg-config
gettext
];
buildInputs = [
fcitx5
m17n_db
m17n_lib
];
passthru.tests = {
inherit (nixosTests) fcitx5;
};
meta = with lib; {
description = "m17n support for Fcitx5";
homepage = "https://github.com/fcitx/fcitx5-m17n";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ Technical27 ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,64 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
fcitx5,
gettext,
qtbase,
qtwayland,
wrapQtAppsHook,
wayland,
}:
let
majorVersion = lib.versions.major qtbase.version;
in
stdenv.mkDerivation rec {
pname = "fcitx5-qt${majorVersion}";
version = "5.1.10";
src = fetchFromGitHub {
owner = "fcitx";
repo = "fcitx5-qt";
rev = version;
hash = "sha256-JhmaAAJ1fevCPItVnneUCAalnDDaCjjkAl9QRhSkBk4=";
};
postPatch = ''
substituteInPlace qt${majorVersion}/platforminputcontext/CMakeLists.txt \
--replace \$"{CMAKE_INSTALL_QT${majorVersion}PLUGINDIR}" $out/${qtbase.qtPluginPrefix}
'';
cmakeFlags = [
"-DENABLE_QT4=OFF"
"-DENABLE_QT5=OFF"
"-DENABLE_QT6=OFF"
"-DENABLE_QT${majorVersion}=ON"
];
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
wrapQtAppsHook
];
buildInputs = [
qtbase
qtwayland
fcitx5
wayland
];
meta = with lib; {
description = "Fcitx5 Qt Library";
homepage = "https://github.com/fcitx/fcitx5-qt";
license = with licenses; [
lgpl21Plus
bsd3
];
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,65 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
cmake,
extra-cmake-modules,
gettext,
zstd,
fcitx5,
librime,
rime-data,
symlinkJoin,
rimeDataPkgs ? [ rime-data ],
}:
stdenv.mkDerivation rec {
pname = "fcitx5-rime";
version = "5.1.11";
src = fetchurl {
url = "https://download.fcitx-im.org/fcitx5/${pname}/${pname}-${version}.tar.zst";
hash = "sha256-cc/B99tdVVWnvdl7dYYQlIvk8F2xXUOr6sF36yxQZfY=";
};
cmakeFlags = [
"-DRIME_DATA_DIR=${placeholder "out"}/share/rime-data"
];
nativeBuildInputs = [
cmake
extra-cmake-modules
pkg-config
gettext
zstd
];
buildInputs = [
fcitx5
librime
];
rimeDataDrv = symlinkJoin {
name = "fcitx5-rime-data";
paths = rimeDataPkgs;
postBuild = ''
mkdir -p $out/share/rime-data
# Ensure default.yaml exists
[ -e "$out/share/rime-data/default.yaml" ] || touch "$out/share/rime-data/default.yaml"
'';
};
postInstall = ''
cp -r "${rimeDataDrv}/share/rime-data/." $out/share/rime-data/
'';
meta = with lib; {
description = "RIME support for Fcitx5";
homepage = "https://github.com/fcitx/fcitx5-rime";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,58 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
extra-cmake-modules,
gettext,
fcitx5,
fcitx5-qt,
libskk,
qtbase,
skkDictionaries,
enableQt ? false,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-skk";
version = "5.1.7";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-WMkcZSocanhWMn9kiWyB07jEW4x84G07kAYvn5heenc=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
pkg-config
];
buildInputs = [
fcitx5
libskk
]
++ lib.optionals enableQt [
fcitx5-qt
qtbase
];
cmakeFlags = [
(lib.cmakeBool "ENABLE_QT" enableQt)
"-DSKK_DEFAULT_PATH=${skkDictionaries.l}/share/skk/SKK-JISYO.L"
];
dontWrapQtApps = true;
meta = with lib; {
description = "Input method engine for Fcitx5, which uses libskk as its backend";
homepage = "https://github.com/fcitx/fcitx5-skk";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ wattmto ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
gettext,
libime,
boost,
fcitx5,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-table-extra";
version = "5.1.8";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-FrVkSDLH6lYQbhvcxtX/IQpRC3dphsHu7xVdgnDNcgg=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
libime
fcitx5
];
buildInputs = [
boost
];
meta = with lib; {
description = "Extra table for Fcitx, including Boshiamy, Zhengma, Cangjie, and Quick";
homepage = "https://github.com/fcitx/fcitx5-table-extra";
license = licenses.gpl2Only;
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
gettext,
libime,
boost,
fcitx5,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-table-other";
version = "5.1.5";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
hash = "sha256-hoAaismWfiVIYs780oiwwA3syjBnYNQ5nYbhlBbAAKw=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext
libime
fcitx5
];
buildInputs = [
boost
];
meta = with lib; {
description = "Some other tables for Fcitx";
homepage = "https://github.com/fcitx/fcitx5-table-other";
license = licenses.gpl3Only;
maintainers = with maintainers; [ poscat ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
extra-cmake-modules,
fcitx5,
fcitx5-qt,
gettext,
qtbase,
}:
stdenv.mkDerivation rec {
pname = "fcitx5-unikey";
version = "5.1.7";
src = fetchFromGitHub {
owner = "fcitx";
repo = "fcitx5-unikey";
rev = version;
hash = "sha256-ve+vu/bK3GYgjn9KxuOsFZFi9eymi1TFlzUHu4fJAkk=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
gettext # msgfmt
];
buildInputs = [
qtbase
fcitx5
fcitx5-qt
];
dontWrapQtApps = true;
meta = with lib; {
description = "Unikey engine support for Fcitx5";
homepage = "https://github.com/fcitx/fcitx5-unikey";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ berberman ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,43 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p nix-update python3Packages.requests
import requests
import subprocess
REPOS = [
"libime",
"xcb-imdkit",
"fcitx5",
"fcitx5-anthy",
"fcitx5-chewing",
"fcitx5-chinese-addons",
"fcitx5-configtool",
"fcitx5-gtk",
"fcitx5-hangul",
"fcitx5-lua",
"fcitx5-m17n",
"fcitx5-qt",
"fcitx5-rime",
"fcitx5-skk",
"fcitx5-table-extra",
"fcitx5-table-other",
"fcitx5-unikey"
]
OWNER = "fcitx"
def get_latest_tag(repo, owner=OWNER):
r = requests.get('https://api.github.com/repos/{}/{}/tags'.format(owner,repo))
return r.json()[0].get("name")
def main():
for repo in REPOS:
rev = get_latest_tag(repo)
if repo == "fcitx5-qt":
subprocess.run(["nix-update", "--commit", "--version", rev, "qt6Packages.{}".format(repo)])
else:
subprocess.run(["nix-update", "--commit", "--version", rev, repo])
if __name__ == "__main__":
main ()

View File

@@ -0,0 +1,54 @@
{
lib,
symlinkJoin,
makeBinaryWrapper,
fcitx5,
withConfigtool ? true,
fcitx5-configtool,
libsForQt5,
qt6Packages,
fcitx5-gtk,
addons ? [ ],
}:
symlinkJoin {
name = "fcitx5-with-addons-${fcitx5.version}";
paths = [
fcitx5
libsForQt5.fcitx5-qt
qt6Packages.fcitx5-qt
fcitx5-gtk
]
++ lib.optionals withConfigtool [
fcitx5-configtool
]
++ addons;
nativeBuildInputs = [ makeBinaryWrapper ];
postBuild = ''
wrapProgram $out/bin/fcitx5 \
--prefix FCITX_ADDON_DIRS : "$out/lib/fcitx5" \
--suffix XDG_DATA_DIRS : "$out/share" \
--suffix PATH : "$out/bin" \
--suffix LD_LIBRARY_PATH : "${
lib.makeLibraryPath (lib.flatten (map (x: x.extraLdLibraries or [ ]) addons))
}"
${lib.optionalString withConfigtool ''
# Configtool call libexec/fcitx5-qt5-gui-wrapper for gui addons in FCITX_ADDON_DIRS
wrapProgram $out/bin/fcitx5-config-qt --prefix FCITX_ADDON_DIRS : "$out/lib/fcitx5"
''}
pushd $out
grep -Rl --include=\*.{desktop,service} share/applications etc/xdg/autostart share/dbus-1/services -e ${fcitx5} | while read -r file; do
rm $file
cp ${fcitx5}/$file $file
substituteInPlace $file --replace-fail ${fcitx5} $out
done
popd
'';
inherit (fcitx5) meta;
}

View File

@@ -0,0 +1,59 @@
{
lib,
stdenv,
fetchurl,
gettext,
pkg-config,
wrapGAppsHook3,
anthy,
ibus,
glib,
gobject-introspection,
gtk3,
python3,
}:
stdenv.mkDerivation rec {
pname = "ibus-anthy";
version = "1.5.17";
src = fetchurl {
url = "https://github.com/ibus/ibus-anthy/releases/download/${version}/${pname}-${version}.tar.gz";
sha256 = "sha256-nh0orX2ivl4NnA6w2Pt1V/yJdwqiI3Jy3r4Ze9YavUA=";
};
buildInputs = [
anthy
glib
gtk3
ibus
(python3.withPackages (ps: [
ps.pygobject3
(ps.toPythonModule ibus)
]))
];
nativeBuildInputs = [
gettext
gobject-introspection
pkg-config
wrapGAppsHook3
];
configureFlags = [
"--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t"
];
postFixup = ''
substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out
'';
meta = with lib; {
isIbusEngine = true;
description = "IBus interface to the anthy input method";
homepage = "https://github.com/fujiwarat/ibus-anthy";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchFromGitHub,
xorg,
pkg-config,
wrapGAppsHook3,
go,
}:
stdenv.mkDerivation rec {
pname = "ibus-bamboo";
version = "0.8.4-rc6";
src = fetchFromGitHub {
owner = "BambooEngine";
repo = pname;
rev = "v" + lib.toUpper version;
sha256 = "sha256-8eBrgUlzrfQkgzr0/Nz/0FQ98UBdV0GQcZhJVbmyOg0=";
};
nativeBuildInputs = [
pkg-config
wrapGAppsHook3
go
];
buildInputs = [
xorg.libXtst
];
preConfigure = ''
export GOCACHE="$TMPDIR/go-cache"
sed -i "s,/usr,$out," data/bamboo.xml
'';
makeFlags = [
"PREFIX=${placeholder "out"}"
];
meta = with lib; {
isIbusEngine = true;
description = "Vietnamese IME for IBus";
homepage = "https://github.com/BambooEngine/ibus-bamboo";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ astronaut0212 ];
};
}

View File

@@ -0,0 +1,77 @@
{
stdenv,
lib,
fetchFromGitHub,
gettext,
pkg-config,
wrapGAppsHook3,
ibus,
glib,
gobject-introspection,
gtk3,
python3,
autoreconfHook,
intltool,
}:
let
pythonModules = with python3.pkgs; [
pygobject3
pycangjie
(toPythonModule ibus)
];
# Upstream builds Python packages as a part of a non-python
# autotools build, making it awkward to rely on Nixpkgs Python builders.
# Hence we manually set up PYTHONPATH.
pythonPath = "$out/${python3.sitePackages}" + ":" + python3.pkgs.makePythonPath pythonModules;
in
stdenv.mkDerivation {
pname = "ibus-cangjie";
version = "unstable-2023-07-25";
src = fetchFromGitHub {
owner = "Cangjians";
repo = "ibus-cangjie";
rev = "46c36f578047bb3cb2ce777217abf528649bc58d";
sha256 = "sha256-msVqWougc40bVXIonJA6K/VgurnDeR2TdtGKfd9rzwM=";
};
buildInputs = [
glib
gtk3
ibus
python3
]
++ pythonModules;
nativeBuildInputs = [
autoreconfHook
intltool
gettext
gobject-introspection
pkg-config
wrapGAppsHook3
];
# Upstream builds Python packages as a part of a non-python
# autotools build, making it awkward to rely on Nixpkgs Python builders.
postInstall = ''
gappsWrapperArgs+=(--prefix PYTHONPATH : "${pythonPath}")
'';
postFixup = ''
wrapGApp $out/lib/ibus-cangjie/ibus-engine-cangjie
'';
meta = {
isIbusEngine = true;
description = "IBus engine for users of the Cangjie and Quick input methods";
mainProgram = "ibus-setup-cangjie";
homepage = "https://github.com/Cangjians/ibus-cangjie";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
wrapGAppsHook4,
glib,
gtk4,
ibus,
libadwaita,
libchewing,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ibus-chewing";
version = "2.1.7";
src = fetchFromGitHub {
owner = "chewing";
repo = "ibus-chewing";
tag = "v${finalAttrs.version}";
hash = "sha256-3lNzQHuWFreIf4M6z4St5ZfOwjAJOMBLwzOI8KTCTEw=";
};
nativeBuildInputs = [
cmake
pkg-config
wrapGAppsHook4
];
buildInputs = [
glib
gtk4
ibus
libadwaita
libchewing
];
enableParallelBuilding = true;
meta = {
isIbusEngine = true;
description = "Chewing engine for IBus";
homepage = "https://github.com/chewing/ibus-chewing";
changelog = "https://github.com/chewing/ibus-chewing/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ ShamrockLee ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,65 @@
{
lib,
stdenv,
fetchFromGitHub,
replaceVars,
appstream-glib,
gettext,
pkg-config,
wrapGAppsHook3,
gobject-introspection,
autoreconfHook,
gtk3,
ibus,
libhangul,
python3,
}:
stdenv.mkDerivation rec {
pname = "ibus-hangul";
version = "1.5.5";
src = fetchFromGitHub {
owner = "libhangul";
repo = "ibus-hangul";
rev = version;
hash = "sha256-x2oOW8eiEuwmdCGUo+r/KcsitfGccSyianwIEaOBS3M=";
};
patches = [
(replaceVars ./fix-paths.patch {
libhangul = "${libhangul}/lib/libhangul.so.1";
})
];
nativeBuildInputs = [
appstream-glib
gettext
pkg-config
wrapGAppsHook3
gobject-introspection.setupHook
autoreconfHook
];
buildInputs = [
gtk3
ibus
libhangul
(python3.withPackages (
pypkgs: with pypkgs; [
pygobject3
(toPythonModule ibus)
]
))
];
meta = with lib; {
isIbusEngine = true;
description = "Ibus Hangul engine";
mainProgram = "ibus-setup-hangul";
homepage = "https://github.com/libhangul/ibus-hangul";
license = licenses.gpl2Plus;
maintainers = [ ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/setup/main.py b/setup/main.py
index 8d581cd..2ac47b9 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -37,7 +37,7 @@
def get_hangul_keyboard_list():
from ctypes import CDLL, c_int, c_char_p
- libhangul = CDLL('libhangul.so.1')
+ libhangul = CDLL('@libhangul@')
libhangul.hangul_ic_get_n_keyboards.argtypes = []
libhangul.hangul_ic_get_n_keyboards.restype = c_int
libhangul.hangul_ic_get_keyboard_id.argtypes = [c_int]

View File

@@ -0,0 +1,46 @@
{
lib,
stdenv,
fetchurl,
vala,
intltool,
pkg-config,
libkkc,
ibus,
skkDictionaries,
gtk3,
}:
stdenv.mkDerivation rec {
pname = "ibus-kkc";
version = "1.5.22";
src = fetchurl {
url = "${meta.homepage}/releases/download/v${version}/${pname}-${version}.tar.gz";
sha256 = "1kj74c9zy9yxkjx7pz96mzqc13cf10yfmlgprr8sfd4ay192bzi2";
};
nativeBuildInputs = [
vala
intltool
pkg-config
];
buildInputs = [
libkkc
ibus
gtk3
];
postInstall = ''
ln -s ${skkDictionaries.l}/share/skk $out/share/skk
'';
meta = with lib; {
isIbusEngine = true;
description = "Libkkc (Japanese Kana Kanji input method) engine for ibus";
homepage = "https://github.com/ueno/ibus-kkc";
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,77 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
gettext,
gobject-introspection,
pkg-config,
wrapGAppsHook3,
sqlite,
libpinyin,
db,
ibus,
glib,
gtk3,
python3,
lua,
opencc,
libsoup_3,
json-glib,
libnotify,
}:
stdenv.mkDerivation rec {
pname = "ibus-libpinyin";
version = "1.16.5";
src = fetchFromGitHub {
owner = "libpinyin";
repo = "ibus-libpinyin";
tag = version;
hash = "sha256-3QZHovjzGifWLFVudCnJOwMn/M3Nzfn8CZ1HpQwzUVw=";
};
nativeBuildInputs = [
autoreconfHook
gettext
gobject-introspection.setupHook
pkg-config
wrapGAppsHook3
];
configureFlags = [
"--enable-cloud-input-mode"
"--enable-opencc"
];
buildInputs = [
ibus
glib
sqlite
libpinyin
(python3.withPackages (
pypkgs: with pypkgs; [
pygobject3
(toPythonModule ibus)
]
))
gtk3
db
lua
opencc
libsoup_3
json-glib
libnotify
];
meta = {
isIbusEngine = true;
description = "IBus interface to the libpinyin input method";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
linsui
];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
ibus,
gtk3,
libthai,
}:
stdenv.mkDerivation rec {
pname = "ibus-libthai";
version = "0.1.5";
src = fetchurl {
url = "https://linux.thai.net/pub/ThaiLinux/software/libthai/ibus-libthai-${version}.tar.xz";
sha256 = "sha256-egAxttjwuKiDoIuJluoOTJdotFZJe6ZOmJgdiFCAwx0=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
gtk3
ibus
libthai
];
meta = with lib; {
isIbusEngine = true;
homepage = "https://linux.thai.net/projects/ibus-libthai";
description = "Thai input method engine for IBus";
license = licenses.lgpl21Plus;
platforms = platforms.unix;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
ibus,
gtk3,
m17n_lib,
m17n_db,
gettext,
python3,
wrapGAppsHook3,
}:
stdenv.mkDerivation rec {
pname = "ibus-m17n";
version = "1.4.36";
src = fetchFromGitHub {
owner = "ibus";
repo = "ibus-m17n";
rev = version;
sha256 = "sha256-K7grmYROFRwdmYWiWNRv8TnEUpOie1W8Glx9BP6Orzc=";
};
nativeBuildInputs = [
autoreconfHook
gettext
pkg-config
wrapGAppsHook3
];
buildInputs = [
ibus
gtk3
m17n_lib
m17n_db
(python3.withPackages (ps: [
ps.pygobject3
(ps.toPythonModule ibus)
]))
];
configureFlags = [
"--with-gtk=3.0"
];
meta = with lib; {
isIbusEngine = true;
description = "m17n engine for ibus";
homepage = "https://github.com/ibus/ibus-m17n";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
intltool,
pkg-config,
python3,
wrapGAppsHook3,
glib,
gtk3,
ibus,
lua,
pyzy,
sqlite,
nix-update-script,
}:
stdenv.mkDerivation rec {
pname = "ibus-pinyin";
version = "1.5.1";
src = fetchFromGitHub {
owner = "ibus";
repo = "ibus-pinyin";
rev = version;
hash = "sha256-8nM/dEjkNhQNv6Ikv4xtRkS3mALDT6OYC1EAKn1zNtI=";
};
nativeBuildInputs = [
autoreconfHook
intltool
pkg-config
python3
wrapGAppsHook3
];
buildInputs = [
glib
gtk3
ibus
lua
pyzy
sqlite
];
passthru.updateScript = nix-update-script { };
meta = {
isIbusEngine = true;
description = "PinYin engine for IBus";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ azuwis ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,65 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
gdk-pixbuf,
glib,
ibus,
libnotify,
librime,
pkg-config,
rime-data,
symlinkJoin,
rimeDataPkgs ? [ rime-data ],
}:
stdenv.mkDerivation rec {
pname = "ibus-rime";
version = "1.5.1";
src = fetchFromGitHub {
owner = "rime";
repo = "ibus-rime";
rev = version;
sha256 = "sha256-6lqPdcIJmwHcr4G6BhIDMhEtEOpOPgWqfkKXqaDjUY0=";
};
buildInputs = [
gdk-pixbuf
glib
ibus
libnotify
librime
];
nativeBuildInputs = [
cmake
pkg-config
];
cmakeFlags = [ "-DRIME_DATA_DIR=${placeholder "out"}/share/rime-data" ];
rimeDataDrv = symlinkJoin {
name = "ibus-rime-data";
paths = rimeDataPkgs;
postBuild = ''
mkdir -p $out/share/rime-data
# Ensure default.yaml exists
[ -e "$out/share/rime-data/default.yaml" ] || touch "$out/share/rime-data/default.yaml"
'';
};
postInstall = ''
cp -r "${rimeDataDrv}/share/rime-data/." $out/share/rime-data/
'';
meta = with lib; {
isIbusEngine = true;
description = "Rime input method engine for IBus";
homepage = "https://rime.im/";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ pmy ];
};
}

View File

@@ -0,0 +1,54 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
ibus,
ibus-table,
python3,
cmake,
writableTmpDirAsHomeHook,
}:
let
src = fetchFromGitHub {
owner = "mike-fabian";
repo = "ibus-table-chinese";
rev = "3a416012f3b898fe17225925f59d0672a8a0c0db";
sha256 = "sha256-KA4jRSlQ78IeP7od3VtgdR58Z/6psNkMCVwvg3vhFIM=";
};
in
stdenv.mkDerivation {
pname = "ibus-table-chinese";
version = "1.8.12";
inherit src;
postConfigure = ''
substituteInPlace cmake_install.cmake --replace-fail /var/empty $out
substituteInPlace CMakeLists.txt --replace-fail /var/empty $out
'';
# Fails otherwise with "no such file or directory: <table>.txt"
dontUseCmakeBuildDir = true;
nativeBuildInputs = [
cmake
pkg-config
writableTmpDirAsHomeHook
];
buildInputs = [
ibus
ibus-table
python3
];
meta = {
isIbusEngine = true;
description = "Chinese tables for IBus-Table";
homepage = "https://github.com/definite/ibus-table-chinese";
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ pneumaticat ];
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchurl,
ibus,
ibus-table,
pkg-config,
python3,
}:
stdenv.mkDerivation rec {
pname = "ibus-table-others";
version = "1.3.21";
src = fetchurl {
url = "https://github.com/moebiuscurve/ibus-table-others/releases/download/${version}/${pname}-${version}.tar.gz";
hash = "sha256-/3ZDQCc/u2HKlL0+kZ0g4Gbjrkk++l3lSrWQz7CvwaQ=";
};
nativeBuildInputs = [
pkg-config
python3
];
buildInputs = [
ibus
ibus-table
];
preBuild = ''
export HOME=$TMPDIR
'';
meta = with lib; {
isIbusEngine = true;
description = "Various table-based input methods for IBus";
homepage = "https://github.com/moebiuscurve/ibus-table-others";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [
mudri
McSinyx
];
};
}

View File

@@ -0,0 +1,80 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
docbook2x,
pkg-config,
gtk3,
dconf,
gobject-introspection,
ibus,
python3,
wrapGAppsHook3,
}:
stdenv.mkDerivation rec {
pname = "ibus-table";
version = "1.17.15";
src = fetchFromGitHub {
owner = "kaio";
repo = "ibus-table";
rev = version;
sha256 = "sha256-g3UyGbS/gtUQ54PQ0u7xRfInG+T5dkv4vF79bhXoQdY=";
};
postPatch = ''
# Data paths will be set at run-time.
sed -e "/export IBUS_TABLE_LIB_LOCATION=/ s/^.*$//" \
-e "/export IBUS_TABLE_LOCATION=/ s/^.*$//" \
-i "engine/ibus-engine-table.in"
sed -e "/export IBUS_TABLE_BIN_PATH=/ s/^.*$//" \
-e "/export IBUS_TABLE_DATA_DIR=/ s/^.*$//" \
-i "engine/ibus-table-createdb.in"
sed -e "/export IBUS_PREFIX=/ s/^.*$//" \
-e "/export IBUS_DATAROOTDIR=/ s/^.$//" \
-e "/export IBUS_LOCALEDIR=/ s/^.$//" \
-i "setup/ibus-setup-table.in"
substituteInPlace engine/tabcreatedb.py --replace '/usr/share/ibus-table' $out/share/ibus-table
substituteInPlace engine/ibus_table_location.py \
--replace '/usr/libexec' $out/libexec \
--replace '/usr/share/ibus-table/' $out/share/ibus-table/
'';
buildInputs = [
dconf
gtk3
ibus
(python3.withPackages (
pypkgs: with pypkgs; [
dbus-python
pygobject3
(toPythonModule ibus)
]
))
];
nativeBuildInputs = [
autoreconfHook
docbook2x
pkg-config
gobject-introspection
wrapGAppsHook3
];
postUnpack = ''
substituteInPlace $sourceRoot/engine/Makefile.am \
--replace "docbook2man" "docbook2man --sgml"
'';
meta = with lib; {
isIbusEngine = true;
description = "IBus framework for table-based input methods";
mainProgram = "ibus-table-createdb";
homepage = "https://github.com/kaio/ibus-table/wiki";
license = licenses.lgpl21;
platforms = platforms.linux;
maintainers = with maintainers; [ mudri ];
};
}

View File

@@ -0,0 +1,63 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
python3,
ibus,
pkg-config,
gtk3,
m17n_lib,
wrapGAppsHook3,
gobject-introspection,
}:
let
python = python3.withPackages (
ps: with ps; [
pygobject3
dbus-python
]
);
in
stdenv.mkDerivation rec {
pname = "ibus-typing-booster";
version = "2.27.74";
src = fetchFromGitHub {
owner = "mike-fabian";
repo = "ibus-typing-booster";
rev = version;
hash = "sha256-yAa/U1pL7KnJAuxaQkzbtOvdVhIgQiYCMlPnjHmoFEM=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
wrapGAppsHook3
gobject-introspection
];
buildInputs = [
python
ibus
gtk3
m17n_lib
];
preFixup = ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${m17n_lib}/lib")
'';
meta = with lib; {
homepage = "https://mike-fabian.github.io/ibus-typing-booster/";
license = licenses.gpl3Plus;
description = "Completion input method for faster typing";
mainProgram = "emoji-picker";
maintainers = [ ];
platforms = platforms.linux;
isIbusEngine = true;
};
}

View File

@@ -0,0 +1,40 @@
{
typing-booster,
symlinkJoin,
hunspellDicts,
lib,
makeWrapper,
langs ? [
"de-de"
"en-gb-ise"
"en-us"
"es-es"
"fr-moderne"
"it-it"
"sv-se"
"sv-fi"
],
}:
let
hunspellDirs = lib.makeSearchPath "share/hunspell" (lib.attrVals langs hunspellDicts);
in
symlinkJoin {
name = "${typing-booster.name}-with-hunspell";
paths = [ typing-booster ];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
for i in bin/emoji-picker libexec/ibus-{setup,engine}-typing-booster; do
wrapProgram "$out/$i" \
--prefix DICPATH : ${lib.escapeShellArg hunspellDirs}
done
sed -i -e "s,${typing-booster},$out," $out/share/ibus/component/typing-booster.xml
'';
inherit (typing-booster) meta;
}

View File

@@ -0,0 +1,11 @@
--- a/uniemoji.xml.in
+++ b/uniemoji.xml.in
@@ -7,7 +7,7 @@
<license>GPL</license>
<author>Lalo Martins &lt;lalo.martins@gmail.com&gt;</author>
<homepage>https://github.com/salty-horse/ibus-uniemoji</homepage>
- <exec>@PYTHON@ @DATADIR@/ibus-uniemoji/ibus.py --ibus</exec>
+ <exec>@DATADIR@/ibus-uniemoji/ibus.py --ibus</exec>
<textdomain>uniemoji</textdomain>
<engines>
<engine>

View File

@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchFromGitHub,
gobject-introspection,
wrapGAppsHook3,
python3,
ibus,
}:
let
python = python3.withPackages (
ps: with ps; [
pygobject3
(toPythonModule ibus)
pyxdg
levenshtein
]
);
in
stdenv.mkDerivation rec {
pname = "ibus-uniemoji";
version = "0.7.0";
src = fetchFromGitHub {
owner = "salty-horse";
repo = "ibus-uniemoji";
tag = "v${version}";
hash = "sha256-iP72lExXnLFeWNJQfaDI/T4tRlXjHbRy+1X8+cAT+Zo=";
};
patches = [
# Do not run wrapper script with Python,
# the wrapped script will have Python in shebang anyway.
./allow-wrapping.patch
];
nativeBuildInputs = [
wrapGAppsHook3
gobject-introspection
];
buildInputs = [
python
ibus
];
makeFlags = [
"PREFIX=${placeholder "out"}"
"SYSCONFDIR=${placeholder "out"}/etc"
"PYTHON=${python.interpreter}"
];
postFixup = ''
chmod +x "$out/share/ibus-uniemoji/ibus.py"
patchShebangs "$out/share/ibus-uniemoji/ibus.py"
wrapGApp "$out/share/ibus-uniemoji/ibus.py"
'';
meta = {
isIbusEngine = true;
description = "Input method (ibus) for entering unicode symbols and emoji by name";
homepage = "https://github.com/salty-horse/ibus-uniemoji";
license = with lib.licenses; [
gpl3
mit
];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ aske ];
};
}

View File

@@ -0,0 +1,26 @@
diff --git a/data/dconf/make-dconf-override-db.sh b/data/dconf/make-dconf-override-db.sh
index 32cb1530..375baa41 100755
--- a/data/dconf/make-dconf-override-db.sh
+++ b/data/dconf/make-dconf-override-db.sh
@@ -12,15 +12,6 @@ export XDG_CACHE_HOME="$TMPDIR/cache"
export GSETTINGS_SCHEMA_DIR="$TMPDIR/schemas"
mkdir -p $XDG_CONFIG_HOME $XDG_CACHE_HOME $GSETTINGS_SCHEMA_DIR
-eval `dbus-launch --sh-syntax`
-
-trap cleanup EXIT
-
-cleanup() {
- test $? -eq 0 && exit
- rm -rf $TMPDIR; kill $DBUS_SESSION_BUS_PID
-}
-
# in case that schema is not installed on the system
glib-compile-schemas --targetdir "$GSETTINGS_SCHEMA_DIR" "$PWD"
@@ -57,5 +48,3 @@ if [ -d $TMPDIR/cache/gvfs ] ; then
umount $TMPDIR/cache/gvfs
fi
rm -rf $TMPDIR
-
-kill $DBUS_SESSION_BUS_PID

View File

@@ -0,0 +1,241 @@
{
lib,
stdenv,
replaceVars,
fetchFromGitHub,
autoreconfHook,
gettext,
makeWrapper,
pkg-config,
vala,
wrapGAppsHook3,
dbus,
systemd,
dconf ? null,
glib,
gdk-pixbuf,
gobject-introspection,
gtk3,
gtk4,
gtk-doc,
libdbusmenu-gtk3,
runCommand,
isocodes,
cldr-annotations,
unicode-character-database,
unicode-emoji,
python3,
json-glib,
libnotify ? null,
enableUI ? !libOnly,
withWayland ? !libOnly,
libxkbcommon,
wayland,
wayland-protocols,
wayland-scanner,
buildPackages,
runtimeShell,
nixosTests,
versionCheckHook,
nix-update-script,
libX11,
libOnly ? false,
}:
let
python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
python3BuildEnv = python3.pythonOnBuildForHost.buildEnv.override {
# ImportError: No module named site
postBuild = ''
makeWrapper ${glib.dev}/bin/gdbus-codegen $out/bin/gdbus-codegen --unset PYTHONPATH
makeWrapper ${glib.dev}/bin/glib-genmarshal $out/bin/glib-genmarshal --unset PYTHONPATH
makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
'';
};
# make-dconf-override-db.sh needs to execute dbus-launch in the sandbox,
# it will fail to read /etc/dbus-1/session.conf unless we add this flag
dbus-launch =
runCommand "sandbox-dbus-launch"
{
nativeBuildInputs = [ makeWrapper ];
}
''
makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \
--add-flags --config-file=${dbus}/share/dbus-1/session.conf
'';
in
stdenv.mkDerivation (finalAttrs: {
pname = "ibus";
version = "1.5.32";
src = fetchFromGitHub {
owner = "ibus";
repo = "ibus";
tag = finalAttrs.version;
hash = "sha256-Rp2Aw2C2LXMBp8++pnZtPHiPoFDERpkDsKd0E//twuY=";
};
patches = [
(replaceVars ./fix-paths.patch {
pythonInterpreter = python3Runtime.interpreter;
pythonSitePackages = python3.sitePackages;
# patch context
prefix = null;
datarootdir = null;
localedir = null;
# removed line only
PYTHON = null;
})
./build-without-dbus-launch.patch
];
outputs = [
"out"
"dev"
]
++ lib.optionals (!libOnly) [
"installedTests"
];
postPatch = ''
# Maintainer does not want to create separate tarballs for final release candidate and release versions,
# so we need to set `ibus_released` to `1` in `configure.ac`. Otherwise, anyone running `ibus version` gets
# a version with an inaccurate `-rcX` suffix.
# https://github.com/ibus/ibus/issues/2584
substituteInPlace configure.ac --replace "m4_define([ibus_released], [0])" "m4_define([ibus_released], [1])"
patchShebangs --build data/dconf/make-dconf-override-db.sh
cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
substituteInPlace bus/services/org.freedesktop.IBus.session.GNOME.service.in --replace "ExecStart=sh" "ExecStart=${runtimeShell}"
substituteInPlace bus/services/org.freedesktop.IBus.session.generic.service.in --replace "ExecStart=sh" "ExecStart=${runtimeShell}"
'';
preAutoreconf = "touch ChangeLog";
configureFlags = [
# The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries,
# so we set `{CC,CXX}_FOR_BUILD` to override that behavior.
# https://github.com/NixOS/nixpkgs/issues/21751
"CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
"CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++"
"GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources"
"PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen"
"--disable-memconf"
"--disable-gtk2"
"--with-python=${python3BuildEnv.interpreter}"
(lib.enableFeature (!libOnly && dconf != null) "dconf")
(lib.enableFeature (!libOnly && libnotify != null) "libnotify")
(lib.enableFeature withWayland "wayland")
(lib.enableFeature enableUI "ui")
(lib.enableFeature (!libOnly) "gtk3")
(lib.enableFeature (!libOnly) "gtk4")
(lib.enableFeature (!libOnly) "xim")
(lib.enableFeature (!libOnly) "appindicator")
(lib.enableFeature (!libOnly) "tests")
(lib.enableFeature (!libOnly) "install-tests")
(lib.enableFeature (!libOnly) "emoji-dict")
(lib.enableFeature (!libOnly) "unicode-dict")
]
++ lib.optionals (!libOnly) [
"--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji"
"--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations"
"--with-ucd-dir=${unicode-character-database}/share/unicode"
];
makeFlags = lib.optionals (!libOnly) [
"test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus"
"test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus"
];
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
autoreconfHook
gtk-doc
gettext
makeWrapper
pkg-config
python3BuildEnv
dbus-launch
glib # required to satisfy AM_PATH_GLIB_2_0
vala
gobject-introspection
]
++ lib.optionals (!libOnly) [
wrapGAppsHook3
]
++ lib.optionals withWayland [
wayland-scanner
];
propagatedBuildInputs = [
glib
];
buildInputs = [
dbus
systemd
dconf
python3.pkgs.pygobject3 # for pygobject overrides
isocodes
json-glib
libX11
vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN)
]
++ lib.optionals (!libOnly) [
gtk3
gtk4
gdk-pixbuf
libdbusmenu-gtk3
libnotify
]
++ lib.optionals withWayland [
libxkbcommon
wayland
wayland-protocols
wayland-scanner # For cross, build uses $PKG_CONFIG to look for wayland-scanner
];
enableParallelBuilding = true;
strictDeps = true;
doCheck = false; # requires X11 daemon
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "version";
versionCheckProgram = "${placeholder "out"}/bin/ibus";
postInstall = lib.optionalString (!libOnly) ''
# It has some hardcoded FHS paths and also we do not use it
# since we set up the environment in NixOS tests anyway.
moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests"
'';
postFixup = lib.optionalString (!libOnly) ''
# set necessary environment also for tests
for f in $installedTests/libexec/installed-tests/ibus/*; do
wrapGApp $f
done
'';
passthru = {
tests = lib.optionalAttrs (!libOnly) {
installed-tests = nixosTests.installed-tests.ibus;
};
updateScript = nix-update-script { };
};
meta = {
changelog = "https://github.com/ibus/ibus/releases/tag/${finalAttrs.src.tag}";
homepage = "https://github.com/ibus/ibus";
description = "Intelligent Input Bus, input method framework";
license = lib.licenses.lgpl21Plus;
platforms = lib.platforms.linux;
mainProgram = "ibus";
maintainers = with lib.maintainers; [ ttuegel ];
};
})

View File

@@ -0,0 +1,52 @@
diff --git a/configure.ac b/configure.ac
index a3cdb2da..cade9466 100644
--- a/configure.ac
+++ b/configure.ac
@@ -531,12 +531,12 @@
PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])
if test x"$pyoverridesdir" = x""; then
- pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"`
+ pyoverridesdir="$prefix/@pythonSitePackages@/gi/overrides"
fi
AC_SUBST(pyoverridesdir)
if test x"$enable_python2" = x"yes"; then
- py2overridesdir=`$PYTHON2 -c "import gi; print(gi._overridesdir)"`
+ py2overridesdir="$prefix/@pythonSitePackages@/gi/overrides"
AC_SUBST(py2overridesdir)
fi
fi
@@ -502,7 +502,7 @@ if test x"$enable_python_library" = x"yes"; then
PYTHON2_VERSION=`$PYTHON2 -c "import sys; sys.stdout.write(sys.version[[:3]])"`
PYTHON2_LIBDIR="$PYTHON2_PREFIX/lib/python$PYTHON2_VERSION"
python2dir="$PYTHON2_LIBDIR/site-packages"
- pkgpython2dir="$python2dir/ibus"
+ pkgpython2dir="$prefix/@pythonSitePackages@/ibus"
AC_SUBST(pkgpython2dir)
else
enable_python_library="no (disabled, use --enable-python-library to enable)"
diff --git a/data/dconf/Makefile.am b/data/dconf/Makefile.am
index 5360f033..6d5e726f 100644
--- a/data/dconf/Makefile.am
+++ b/data/dconf/Makefile.am
@@ -50,7 +50,7 @@ man_5dir = $(mandir)/man5
install-data-hook:
if test -z "$(DESTDIR)"; then \
- dconf update; \
+ true; \
fi
EXTRA_DIST = \
diff --git a/setup/ibus-setup.in b/setup/ibus-setup.in
index 474ce8a8..ee30808e 100644
--- a/setup/ibus-setup.in
+++ b/setup/ibus-setup.in
@@ -27,5 +27,5 @@ export IBUS_PREFIX=@prefix@
export IBUS_DATAROOTDIR=@datarootdir@
export IBUS_LOCALEDIR=@localedir@
export IBUS_LIBEXECDIR=${libexecdir}
-exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py "$@"
+exec @pythonInterpreter@ @prefix@/share/ibus/setup/main.py "$@"

View File

@@ -0,0 +1,116 @@
{
lib,
buildEnv,
makeWrapper,
dconf,
hicolor-icon-theme,
ibus,
librsvg,
plugins ? [ ],
}:
buildEnv {
name = "ibus-with-plugins-" + lib.getVersion ibus;
paths = [ ibus ] ++ plugins;
pathsToLink = [
"/bin"
"/etc"
"/lib"
"/libexec"
"/share"
# Need to link contents so that the directories are writeable.
"/lib/systemd"
"/share/dbus-1/services"
"/share/systemd/user"
"/share/systemd/user/gnome-session.target.wants"
];
nativeBuildInputs = [
makeWrapper
];
buildInputs = [ ibus ] ++ plugins;
postBuild = ''
for prog in ibus; do
wrapProgram "$out/bin/$prog" \
--set GDK_PIXBUF_MODULE_FILE ${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
--set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \
--set IBUS_DATAROOTDIR "$out/share" \
--set IBUS_LIBEXECDIR "$out/libexec" \
--set IBUS_LOCALEDIR "$out/share/locale" \
--set IBUS_PREFIX "$out" \
--set IBUS_TABLE_BIN_PATH "$out/bin" \
--set IBUS_TABLE_DATA_DIR "$out/share" \
--set IBUS_TABLE_LIB_LOCATION "$out/libexec" \
--set IBUS_TABLE_LOCATION "$out/share/ibus-table" \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
--suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share"
done
for prog in ibus-daemon; do
wrapProgram "$out/bin/$prog" \
--set GDK_PIXBUF_MODULE_FILE ${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
--set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \
--set IBUS_DATAROOTDIR "$out/share" \
--set IBUS_LIBEXECDIR "$out/libexec" \
--set IBUS_LOCALEDIR "$out/share/locale" \
--set IBUS_PREFIX "$out" \
--set IBUS_TABLE_BIN_PATH "$out/bin" \
--set IBUS_TABLE_DATA_DIR "$out/share" \
--set IBUS_TABLE_LIB_LOCATION "$out/libexec" \
--set IBUS_TABLE_LOCATION "$out/share/ibus-table" \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
--suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
--add-flags "--cache=refresh"
done
ibusPackage="${ibus}"
# Update services.
for service in \
"share/dbus-1/services/org.freedesktop.IBus.service" \
"share/systemd/user/org.freedesktop.IBus.session.generic.service" \
"share/systemd/user/org.freedesktop.IBus.session.GNOME.service"
do
unlink "$out/$service"
substitute "$ibusPackage/$service" "$out/$service" --replace "$ibusPackage/bin" "$out/bin"
done
# Re-create relative symbolic links.
for link in \
"$out/share/systemd/user/gnome-session.target.wants/"*
do
target="$link"
until [[ "''${target:0:1}" != "/" ]]; do
target="$(readlink "$target")"
done
unlink "$link"
ln -s "$target" "$link"
done
# Update absolute symbolic links.
for link in \
"$out/lib/systemd/user"
do
target="$(readlink -f "$link")"
relativeTarget="''${target#$ibusPackage/}"
if [[ "$ibusPackage/$relativeTarget" != "$target" ]]; then
>&2 echo "File $link does not point to to a file in $ibusPackage"
exit 1
fi
unlink "$link"
ln -s "$out/$relativeTarget" "$link"
done
'';
inherit (ibus) meta;
}

View File

@@ -0,0 +1,185 @@
{
lib,
buildPythonApplication,
fetchFromGitHub,
pkgconfig,
wrapGAppsHook3,
gettext,
gtk3,
glib,
dbus,
gobject-introspection,
xmodmap,
pygobject3,
setuptools,
evdev,
pydantic,
pydbus,
psutil,
procps,
gtksourceview4,
bash,
udevCheckHook,
nixosTests,
# Change the default log level to debug for easier debugging of package issues
withDebugLogLevel ? false,
# Xmodmap is an optional dependency
# If you use Xmodmap to set keyboard mappings (or your DE does)
# it is required to correctly map keys
withXmodmap ? true,
# Some tests are flakey under high CPU load and could cause intermittent
# failures when building. Override this to true to run tests anyway
# See upstream issue: https://github.com/sezanzeb/input-remapper/issues/306
withDoCheck ? false,
}:
let
maybeXmodmap = lib.optional withXmodmap xmodmap;
in
(buildPythonApplication rec {
pname = "input-remapper";
version = "2.1.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "sezanzeb";
repo = "input-remapper";
tag = version;
hash = "sha256-GMKcs2UK1yegGT/TBsLGgTBJROQ38M6WwnLbJIuAZwg=";
};
postPatch = ''
# fix FHS paths
substituteInPlace inputremapper/configs/data.py \
--replace-fail "/usr/share" "$out/usr/share"
''
+ lib.optionalString withDebugLogLevel ''
# if debugging
substituteInPlace inputremapper/logger.py \
--replace-fail "logger.setLevel(logging.INFO)" "logger.setLevel(logging.DEBUG)"
'';
nativeBuildInputs = [
wrapGAppsHook3
gettext # needed to build translations
gtk3
glib
gobject-introspection
pygobject3
udevCheckHook
]
++ maybeXmodmap;
dependencies = [
setuptools # needs pkg_resources
pygobject3
evdev
pkgconfig
pydantic
pydbus
gtksourceview4
psutil
];
doCheck = withDoCheck;
nativeCheckInputs = [ psutil ];
pythonImportsCheck = [
"evdev"
"inputremapper"
];
postInstall = ''
substituteInPlace data/99-input-remapper.rules \
--replace-fail 'RUN+="/bin/input-remapper-control' "RUN+=\"$out/bin/input-remapper-control"
substituteInPlace data/input-remapper.service \
--replace-fail "ExecStart=/usr/bin/input-remapper-service" "ExecStart=$out/bin/input-remapper-service"
substituteInPlace data/input-remapper-autoload.desktop \
--replace-fail "bash" "${lib.getExe bash}"
install -m644 -D -t $out/share/applications/ data/*.desktop
install -m644 -D -t $out/share/polkit-1/actions/ data/input-remapper.policy
install -m644 -D data/99-input-remapper.rules $out/etc/udev/rules.d/99-input-remapper.rules
install -m644 -D data/input-remapper.service $out/lib/systemd/system/input-remapper.service
install -m644 -D data/input-remapper.policy $out/share/polkit-1/actions/input-remapper.policy
install -m644 -D data/inputremapper.Control.conf $out/etc/dbus-1/system.d/inputremapper.Control.conf
install -m644 -D data/input-remapper.svg $out/share/icons/hicolor/scalable/apps/input-remapper.svg
install -m644 -D -t $out/usr/share/input-remapper/ data/*
# Only install input-remapper prefixed binaries, we don't care about deprecated key-mapper ones
install -m755 -D -t $out/bin/ bin/input-remapper*
'';
# Custom test script, can't use plain pytest / pytestCheckHook
# We only run tests in the unit folder, integration tests require UI
# To allow tests which access the system and session DBUS to run, we start a dbus session
# and bind it to both the system and session buses
installCheckPhase = ''
runHook preInstallCheck
echo "<busconfig>
<type>session</type>
<listen>unix:tmpdir=$TMPDIR</listen>
<listen>unix:path=/build/system_bus_socket</listen>
<standard_session_servicedirs/>
<policy context=\"default\">
<!-- Allow everything to be sent -->
<allow send_destination=\"*\" eavesdrop=\"true\"/>
<!-- Allow everything to be received -->
<allow eavesdrop=\"true\"/>
<!-- Allow anyone to own anything -->
<allow own=\"*\"/>
</policy>
</busconfig>" > dbus.cfg
PATH=${
lib.makeBinPath (
[
dbus
procps
]
++ maybeXmodmap
)
}:$PATH \
USER="$(id -u -n)" \
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/build/system_bus_socket \
${dbus}/bin/dbus-run-session --config-file dbus.cfg \
python tests/test.py --start-dir unit
runHook postInstallCheck
'';
# Nixpkgs 15.9.4.3. When using wrapGAppsHook3 with special derivers you can end up with double wrapped binaries.
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
--prefix PATH : "${lib.makeBinPath maybeXmodmap}"
)
'';
passthru.tests = nixosTests.input-remapper;
meta = {
description = "Easy to use tool to change the mapping of your input device buttons";
homepage = "https://github.com/sezanzeb/input-remapper";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ LunNova ];
mainProgram = "input-remapper-gtk";
};
}).overrideAttrs
(
final: prev: {
# Set in an override as buildPythonApplication doesn't yet support
# the `final:` arg yet from #119942 'overlay style overridable recursive attributes'
# this ensures the rev matches the input src's rev after overriding
# See https://discourse.nixos.org/t/avoid-rec-expresions-in-nixpkgs/8293/7 for more
# discussion
postPatch = prev.postPatch or "" + ''
# set revision for --version output
echo "COMMIT_HASH = '${final.src.rev}'" > inputremapper/commit_hash.py
'';
}
)

View File

@@ -0,0 +1,30 @@
{
lib,
stdenv,
fetchFromGitLab,
cmake,
}:
stdenv.mkDerivation rec {
pname = "caps2esc";
version = "0.3.2";
src = fetchFromGitLab {
group = "interception";
owner = "linux/plugins";
repo = pname;
rev = "v${version}";
hash = "sha256-gPFElAixiDTTwcl2XKM7MbTkpRrg8ToO5K7H8kz3DHk=";
};
nativeBuildInputs = [ cmake ];
meta = with lib; {
homepage = "https://gitlab.com/interception/linux/plugins/caps2esc";
description = "Transforming the most useless key ever into the most useful one";
mainProgram = "caps2esc";
license = licenses.mit;
maintainers = [ maintainers.vyp ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitLab,
fetchpatch,
pkg-config,
cmake,
yaml-cpp,
libevdev,
udev,
boost,
}:
stdenv.mkDerivation rec {
pname = "interception-tools";
version = "0.6.8";
src = fetchFromGitLab {
owner = "interception/linux";
repo = "tools";
rev = "v${version}";
hash = "sha256-jhdgfCWbkF+jD/iXsJ+fYKOtPymxcC46Q4w0aqpvcek=";
};
patches = [
(fetchpatch {
name = "Bump-CMake-minimum-version-to-3.10";
url = "https://gitlab.com/interception/linux/tools/-/commit/110c9b39b54eae9acd16fa6d64539ce9886b5684.patch";
hash = "sha256-vLm7LvXh/pGA12gUpt9vt2XTWFqkdjQFOyRzaDRghHI=";
})
];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
libevdev
udev
yaml-cpp
boost
];
meta = {
description = "Minimal composable infrastructure on top of libudev and libevdev";
homepage = "https://gitlab.com/interception/linux/tools";
changelog = "https://gitlab.com/interception/linux/tools/-/tags/v${version}";
license = lib.licenses.gpl3Only;
maintainers = [ lib.maintainers.vyp ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,48 @@
{
stdenv,
lib,
fetchFromGitLab,
pkg-config,
yaml-cpp,
libevdev,
}:
stdenv.mkDerivation rec {
pname = "dual-function-keys";
version = "1.5.0";
src = fetchFromGitLab {
group = "interception";
owner = "linux/plugins";
repo = pname;
rev = version;
hash = "sha256-m/oEczUNKqj0gs/zMOIBxoQaffNg+YyPINMXArkATJ4=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libevdev
yaml-cpp
];
prePatch = ''
substituteInPlace config.mk --replace \
'/usr/include/libevdev-1.0' \
"$(pkg-config --cflags libevdev | cut -c 3-)"
'';
installFlags = [
"DESTDIR=$(out)"
"PREFIX="
];
meta = with lib; {
homepage = "https://gitlab.com/interception/linux/plugins/dual-function-keys";
description = "Tap for one key, hold for another";
license = licenses.mit;
maintainers = with maintainers; [ svend ];
platforms = platforms.linux;
mainProgram = "dual-function-keys";
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchurl,
m17n_db,
autoreconfHook,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "m17n-lib";
version = "1.8.6";
src = fetchurl {
url = "mirror://savannah/m17n/${pname}-${version}.tar.gz";
hash = "sha256-cSn+O3rVAPiLivhgXvB7lsh6deyYamlf/8CkCfRKfIY=";
};
strictDeps = true;
# reconf needed to successfully cross-compile
nativeBuildInputs = [
autoreconfHook
pkg-config
# requires m17n-db tool at build time
m17n_db
];
enableParallelBuilding = true;
meta = {
homepage = "https://www.nongnu.org/m17n/";
description = "Multilingual text processing library (runtime)";
license = lib.licenses.lgpl21Plus;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,70 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
pkg-config,
autoreconfHook,
xorg,
freetype,
}:
stdenv.mkDerivation rec {
pname = "libotf";
version = "0.9.16";
src = fetchurl {
url = "mirror://savannah/m17n/${pname}-${version}.tar.gz";
sha256 = "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8";
};
patches = [
# https://salsa.debian.org/debian/libotf/-/tree/master/debian/patches
# Fix cross-compilation
(fetchpatch {
url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0002-use-pkg-config-not-freetype-config.patch";
sha256 = "sha256-VV9iGoNWIEie6UiLLTJBD+zxpvj0acgqkcBeAN1V6Kc=";
})
# these 2 are required by the above patch
(fetchpatch {
url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0001-do-not-add-flags-for-required-packages-to-pc-file.patch";
sha256 = "sha256-3kzqNPAHNVJQ1F4fyifq3AqLdChWli/k7wOq+ha+iDs=";
})
(fetchpatch {
url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0001-libotf-config-modify-to-support-multi-arch.patch";
sha256 = "sha256-SUlI87h+MtYWWtrAegzAnSds8JhxZwTJltDcj/se/Qc=";
})
];
strictDeps = true;
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
xorg.libXaw
freetype
];
outputs = [
"out"
"dev"
];
postInstall = ''
mkdir -p $dev/bin
mv $out/bin/libotf-config $dev/bin/
substituteInPlace $dev/bin/libotf-config \
--replace "pkg-config" "${pkg-config}/bin/pkg-config"
'';
meta = {
homepage = "https://www.nongnu.org/m17n/";
description = "Multilingual text processing library (libotf)";
license = lib.licenses.lgpl21Plus;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ bendlas ];
};
}

View File

@@ -0,0 +1,216 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
nix-update-script,
nkf,
skktools,
useUtf8 ? false,
}:
let
suffix = lib.optionalString useUtf8 ".utf8";
mkDictNameValue =
{
name,
description,
license, # it's written in the beginning of each file
files ? [ "SKK-JISYO.${name}" ],
}:
{
name = lib.toLower (builtins.replaceStrings [ "." ] [ "_" ] name);
value = stdenvNoCC.mkDerivation {
pname = "skk-jisyo-" + lib.toLower name;
version = "0-unstable-2024-08-28";
src = fetchFromGitHub {
owner = "skk-dev";
repo = "dict";
rev = "4eb91a3bbfef70bde940668ec60f3beae291e971";
sha256 = "sha256-sWz85Q6Bu2WoKsckSp5SlcuPUQN2mcq+BHMqNXQ/aho=";
};
nativeBuildInputs = lib.optionals useUtf8 [ nkf ];
strictDeps = true;
buildPhase = ''
runHook preBuild
''
+ lib.concatMapStrings (file: ''
nkf -w ${file} \
| LC_ALL=C sed 's/coding: [^ ]\{1,\}/coding: utf-8/' \
> ${file + suffix}
'') (lib.optionals useUtf8 (map lib.escapeShellArg files))
+ ''
runHook postBuild
'';
installPhase = ''
runHook preInstall
''
+ lib.concatMapStrings (file: ''
install -Dm644 \
${lib.escapeShellArg file} \
$out/share/skk/${lib.escapeShellArg (baseNameOf file)}
'') (map (file: file + suffix) files)
+ ''
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
emptydict=': 0 candidates$'
${skktools}/bin/skkdic-count /dev/null | grep "$emptydict"
${skktools}/bin/skkdic-count $out/share/skk/* | grep -v "$emptydict"
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = with lib; {
inherit description license;
longDescription = ''
This package provides a kana-to-kanji conversion dictionary for the
SKK Japanese input method.
'';
homepage = "https://github.com/skk-dev/dict";
maintainers = with maintainers; [
yuriaisaka
midchildan
];
platforms = platforms.all;
};
};
};
in
lib.listToAttrs (
map mkDictNameValue [
{
name = "L";
description = "Standard SKK dictionary";
license = lib.licenses.gpl2Plus;
}
{
name = "S";
description = "Small SKK dictionary";
license = lib.licenses.gpl2Plus;
}
{
name = "M";
description = "Medium sized SKK dictionary";
license = lib.licenses.gpl2Plus;
}
{
name = "ML";
description = "Medium to large sized SKK dictionary";
license = lib.licenses.gpl2Plus;
}
{
name = "jinmei";
description = "SKK dictionary for names";
license = lib.licenses.gpl2Plus;
}
{
name = "fullname";
description = "SKK dictionary for celebrities";
license = lib.licenses.gpl2Plus;
}
{
name = "geo";
description = "SKK dictionary for locations";
license = lib.licenses.gpl2Plus;
}
{
name = "propernoun";
description = "SKK dictionary for proper nouns";
license = lib.licenses.gpl2Plus;
}
{
name = "station";
description = "SKK dictionary for stations";
license = lib.licenses.gpl2Plus;
}
{
name = "law";
description = "SKK dictionary for legal terms";
license = lib.licenses.gpl2Plus;
}
{
name = "okinawa";
description = "SKK dictionary for the Okinawan language";
license = lib.licenses.publicDomain;
}
{
name = "china_taiwan";
description = "SKK dictionary for Chinese & Taiwanese locations";
license = lib.licenses.gpl2Plus;
}
{
name = "assoc";
description = "SKK dictionary for abbreviated input";
license = lib.licenses.gpl2Plus;
}
{
name = "edict";
description = "SKK dictionary for English to Japanese translation";
license = lib.licenses.cc-by-sa-30;
}
{
name = "zipcode";
description = "SKK dictionary for Japanese zipcodes";
files = [
"zipcode/SKK-JISYO.zipcode"
"zipcode/SKK-JISYO.office.zipcode"
];
license = lib.licenses.publicDomain;
}
{
name = "JIS2";
description = "SKK dictionary for JIS level 2 kanjis";
license = lib.licenses.gpl2Plus;
}
{
name = "JIS3_4";
description = "SKK dictionary for JIS level 3 and 4 kanjis";
license = lib.licenses.gpl2Plus;
}
{
name = "JIS2004";
description = ''
A complementary SKK dictionary for JIS3_4 with JIS X 0213:2004 additions"
'';
license = lib.licenses.gpl2Plus;
}
{
name = "itaiji";
description = "SKK dictionary for variant kanjis";
license = lib.licenses.publicDomain;
}
{
name = "itaiji.JIS3_4";
description = "SKK dictionary for JIS level 3 and 4 variant kanjis";
license = lib.licenses.gpl2Plus;
}
{
name = "mazegaki";
description = "SKK dictionary for mazegaki";
license = lib.licenses.gpl2Plus;
}
{
name = "emoji";
description = "SKK dictionary for emojis";
license = lib.licenses.unicode-dfs-2016;
}
{
name = "pinyin";
description = "SKK dictionary for pinyin to simplified Chinese input";
license = lib.licenses.gpl1Plus;
}
]
)