ibus-table-chinese: init at 1.8.2

This commit is contained in:
Kevin Liu 2018-10-06 21:08:07 -04:00
parent 95dee0d721
commit 624966ab69
No known key found for this signature in database
GPG Key ID: 5A824102DFE3DD86
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,64 @@
{ stdenv, fetchgit, fetchFromGitHub, pkgconfig, ibus, ibus-table, python3, cmake }:
let
src = fetchFromGitHub {
owner = "definite";
repo = "ibus-table-chinese";
rev = "f1f6a3384f021caa3b84c517e2495086f9c34507";
sha256 = "14wpw3pvyrrqvg7al37jk2dxqfj9r4zf88j8k2n2lmdc50f3xs7k";
};
cmakeFedoraSrc = fetchgit {
url = "https://pagure.io/cmake-fedora.git";
rev = "7d5297759aef4cd086bdfa30cf6d4b2ad9446992";
sha256 = "0mx9jvxpiva9v2ffaqlyny48iqr073h84yw8ln43z2avv11ipr7n";
};
in stdenv.mkDerivation rec {
name = "ibus-table-chinese-${version}";
version = "1.8.2";
srcs = [ src cmakeFedoraSrc ];
sourceRoot = src.name;
postUnpack = ''
chmod u+w -R ${cmakeFedoraSrc.name}
mv ${cmakeFedoraSrc.name}/* source/cmake-fedora
'';
preConfigure = ''
# cmake script needs ./Modules folder to link to cmake-fedora
ln -s cmake-fedora/Modules ./
'';
# Fails when writing to /prj_info.cmake in https://pagure.io/cmake-fedora/blob/master/f/Modules/ManageVersion.cmake
cmakeFlags = [ "-DPRJ_INFO_CMAKE_FILE=/dev/null" "-DPRJ_DOC_DIR=REPLACE" "-DDATA_DIR=share" ];
# Must replace PRJ_DOC_DIR with actual share/ folder for ibus-table-chinese
# Otherwise it tries to write to /ibus-table-chinese if not defined (!)
postConfigure = ''
substituteInPlace cmake_install.cmake --replace '/build/source/REPLACE' $out/share/ibus-table-chinese
'';
# Fails otherwise with "no such file or directory: <table>.txt"
dontUseCmakeBuildDir = true;
# Fails otherwise sometimes with
# FileExistsError: [Errno 17] File exists: '/build/tmp.BfVAUM4llr/ibus-table-chinese/.local/share/ibus-table'
enableParallelBuilding = false;
preBuild = ''
export HOME=$(mktemp -d)/ibus-table-chinese
'';
postFixup = ''
rm -rf $HOME
'';
buildInputs = [ pkgconfig ibus ibus-table python3 cmake ];
meta = with stdenv.lib; {
isIbusEngine = true;
description = "Chinese tables for IBus-Table";
homepage = https://github.com/definite/ibus-table-chinese;
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ pneumaticat ];
};
}

View File

@ -1995,6 +1995,10 @@ with pkgs;
inherit (gnome3) dconf;
};
table-chinese = callPackage ../tools/inputmethods/ibus-engines/ibus-table-chinese {
ibus-table = ibus-engines.table;
};
table-others = callPackage ../tools/inputmethods/ibus-engines/ibus-table-others {
ibus-table = ibus-engines.table;
};