1 { lib, stdenv, fetchgit, fetchFromGitHub, pkg-config, ibus, ibus-table, python3, cmake }:
4 src = fetchFromGitHub {
6 repo = "ibus-table-chinese";
7 rev = "f1f6a3384f021caa3b84c517e2495086f9c34507";
8 sha256 = "14wpw3pvyrrqvg7al37jk2dxqfj9r4zf88j8k2n2lmdc50f3xs7k";
11 cmakeFedoraSrc = fetchgit {
12 url = "https://pagure.io/cmake-fedora.git";
13 rev = "7d5297759aef4cd086bdfa30cf6d4b2ad9446992";
14 sha256 = "0mx9jvxpiva9v2ffaqlyny48iqr073h84yw8ln43z2avv11ipr7n";
16 in stdenv.mkDerivation {
17 pname = "ibus-table-chinese";
20 srcs = [ src cmakeFedoraSrc ];
21 sourceRoot = src.name;
24 chmod u+w -R ${cmakeFedoraSrc.name}
25 mv ${cmakeFedoraSrc.name}/* source/cmake-fedora
29 # cmake script needs ./Modules folder to link to cmake-fedora
30 ln -s cmake-fedora/Modules ./
33 # Fails when writing to /prj_info.cmake in https://pagure.io/cmake-fedora/blob/master/f/Modules/ManageVersion.cmake
34 cmakeFlags = [ "-DPRJ_INFO_CMAKE_FILE=/dev/null" "-DPRJ_DOC_DIR=REPLACE" "-DDATA_DIR=share" ];
35 # Must replace PRJ_DOC_DIR with actual share/ folder for ibus-table-chinese
36 # Otherwise it tries to write to /ibus-table-chinese if not defined (!)
38 substituteInPlace cmake_install.cmake --replace '/build/source/REPLACE' $out/share/ibus-table-chinese
40 # Fails otherwise with "no such file or directory: <table>.txt"
41 dontUseCmakeBuildDir = true;
42 # Fails otherwise sometimes with
43 # FileExistsError: [Errno 17] File exists: '/build/tmp.BfVAUM4llr/ibus-table-chinese/.local/share/ibus-table'
44 enableParallelBuilding = false;
47 export HOME=$(mktemp -d)/ibus-table-chinese
54 nativeBuildInputs = [ cmake pkg-config ];
55 buildInputs = [ ibus ibus-table python3 ];
59 description = "Chinese tables for IBus-Table";
60 homepage = "https://github.com/definite/ibus-table-chinese";
61 license = licenses.gpl3;
62 platforms = platforms.linux;
63 maintainers = with maintainers; [ pneumaticat ];