nixpkgs/pkgs/applications/misc/openbangla-keyboard/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

92 lines
2.2 KiB
Nix
Raw Normal View History

2022-07-17 19:32:57 +02:00
{ lib
, stdenv
, fetchFromGitHub
, cargo
2022-07-17 19:32:57 +02:00
, cmake
, pkg-config
, rustPlatform
, rustc
2022-07-17 19:32:57 +02:00
, wrapQtAppsHook
, fcitx5
2022-07-17 19:32:57 +02:00
, ibus
, qtbase
, zstd
, fetchpatch
, withFcitx5Support ? false
, withIbusSupport ? false
2022-07-17 19:32:57 +02:00
}:
stdenv.mkDerivation rec {
pname = "openbangla-keyboard";
version = "unstable-2023-07-21";
2022-07-17 19:32:57 +02:00
src = fetchFromGitHub {
owner = "openbangla";
repo = "openbangla-keyboard";
# no upstream release in 3 years
# fcitx5 support was added over a year after the last release
rev = "780bd40eed16116222faff044bfeb61a07af158f";
hash = "sha256-4CR4lgHB51UvS/RLc0AEfIKJ7dyTCOfDrQdGLf9de8E=";
2022-07-17 19:32:57 +02:00
fetchSubmodules = true;
};
patches = [
# prevents runtime crash when fcitx5-based IM attempts to look in /usr
(fetchpatch {
name = "use-CMAKE_INSTALL_PREFIX-for-loading-data.patch";
url = "https://github.com/OpenBangla/OpenBangla-Keyboard/commit/f402472780c29eaa6b4cc841a70289adf171462b.diff";
hash = "sha256-YahvtyOxe8F40Wfe+31C6fdmm197QN26/Q67oinOplk=";
})
];
2022-07-17 19:32:57 +02:00
nativeBuildInputs = [
cmake
pkg-config
cargo
rustc
2022-07-17 19:32:57 +02:00
rustPlatform.cargoSetupHook
wrapQtAppsHook
];
buildInputs = lib.optionals withFcitx5Support [
fcitx5
] ++ lib.optionals withIbusSupport [
2022-07-17 19:32:57 +02:00
ibus
] ++ [
2022-07-17 19:32:57 +02:00
qtbase
zstd
];
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
sourceRoot = "${src.name}/${cargoRoot}";
hash = "sha256-XMleyP2h1aBhtjXhuGHyU0BN+tuL12CGoj+kLY5uye0=";
2022-07-17 19:32:57 +02:00
};
cmakeFlags = lib.optionals withFcitx5Support [
"-DENABLE_FCITX=YES"
] ++ lib.optionals withIbusSupport [
"-DENABLE_IBUS=YES"
];
2022-07-17 19:32:57 +02:00
cargoRoot = "src/engine/riti";
postPatch = ''
cp ${./Cargo.lock} ${cargoRoot}/Cargo.lock
'';
2022-07-17 19:32:57 +02:00
2023-10-01 03:48:34 +02:00
meta = {
isIbusEngine = withIbusSupport;
2022-07-17 19:32:57 +02:00
description = "An OpenSource, Unicode compliant Bengali Input Method";
mainProgram = "openbangla-gui";
2022-07-17 19:32:57 +02:00
homepage = "https://openbangla.github.io/";
2023-10-01 03:48:34 +02:00
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ eclairevoyant hqurve ];
platforms = lib.platforms.linux;
# never built on aarch64-linux since first introduction in nixpkgs
broken = stdenv.isLinux && stdenv.isAarch64;
2022-07-17 19:32:57 +02:00
};
}