tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
fcitx-moz: init at 2.17.2313.102
Eric Sagnes
10 years ago
1e581966
eb31d296
+120
2 changed files
expand all
collapse all
unified
split
pkgs
tools
inputmethods
fcitx-engines
fcitx-mozc
default.nix
top-level
all-packages.nix
+116
pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix
···
1
1
+
{ clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, fetchsvn, gyp, which, ninja,
2
2
+
python, pkgconfig, protobuf, gtk, zinnia, qt4, libxcb, tegaki-zinnia-japanese,
3
3
+
fcitx, gettext }:
4
4
+
let
5
5
+
japanese_usage_dictionary = fetchsvn {
6
6
+
url = "http://japanese-usage-dictionary.googlecode.com/svn/trunk";
7
7
+
rev = "10";
8
8
+
sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm";
9
9
+
};
10
10
+
icons = fetchurl {
11
11
+
url = "http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz";
12
12
+
sha256 = "10bdjn481jsh32vll7r756l392anz44h6207vjqwby3rplk31np1";
13
13
+
};
14
14
+
in clangStdenv.mkDerivation rec {
15
15
+
name = "fcitx-mozc-${version}";
16
16
+
version = "2.17.2313.102";
17
17
+
18
18
+
src = fetchFromGitHub {
19
19
+
owner = "google";
20
20
+
repo = "mozc";
21
21
+
rev = "3306d3314499a54a4064b8b80bbc1bce3f6cfac4";
22
22
+
sha256 = "0l7mjlnbm6i1ipni8pg9ym5bjg3rzkaxi9xwmsz2lddv348sqii2";
23
23
+
};
24
24
+
25
25
+
nativeBuildInputs = [ gyp which ninja python pkgconfig ];
26
26
+
buildInputs = [ protobuf gtk zinnia qt4 libxcb fcitx gettext ];
27
27
+
28
28
+
postUnpack = ''
29
29
+
rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/
30
30
+
ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary
31
31
+
tar -xzf ${icons} -C $sourceRoot
32
32
+
'';
33
33
+
34
34
+
patch_version = "2.17.2313.102.1";
35
35
+
patches = [
36
36
+
(fetchpatch rec {
37
37
+
name = "fcitx-mozc-${patch_version}.patch";
38
38
+
url = "https://download.fcitx-im.org/fcitx-mozc/${name}";
39
39
+
sha256 = "172c34jkppibvwr9qf9xwgh2hdrmmhyx7nsdj49krxbfdlsy3yy0";
40
40
+
})
41
41
+
];
42
42
+
43
43
+
postPatch = ''
44
44
+
substituteInPlace src/unix/fcitx/mozc.conf \
45
45
+
--replace "/usr/share/fcitx/mozc/icon/mozc.png" "mozc"
46
46
+
'';
47
47
+
48
48
+
configurePhase = ''
49
49
+
export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1"
50
50
+
python src/build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc \
51
51
+
python src/unix/fcitx/fcitx.gyp gyp --gypdir=${gyp}/bin
52
52
+
'';
53
53
+
54
54
+
preBuildPhase = ''
55
55
+
head -n 29 src/server/mozc_server.cc > LICENSE
56
56
+
'';
57
57
+
58
58
+
buildPhase = ''
59
59
+
python src/build_mozc.py build -c Release \
60
60
+
unix/fcitx/fcitx.gyp:fcitx-mozc \
61
61
+
server/server.gyp:mozc_server \
62
62
+
gui/gui.gyp:mozc_tool
63
63
+
'';
64
64
+
65
65
+
checkPhase = ''
66
66
+
python src/build_mozc.py runtests -c Release
67
67
+
'';
68
68
+
69
69
+
installPhase = ''
70
70
+
install -d $out/share/licenses/fcitx-mozc/
71
71
+
install -m 644 LICENSE src/data/installer/*.html $out/share/licenses/fcitx-mozc/
72
72
+
73
73
+
install -d $out/share/doc/mozc
74
74
+
install -m 644 src/data/installer/*.html $out/share/doc/mozc/
75
75
+
76
76
+
install -D -m 755 src/out_linux/Release/mozc_server $out/lib/mozc/mozc_server
77
77
+
install -m 755 src/out_linux/Release/mozc_tool $out/lib/mozc/mozc_tool
78
78
+
79
79
+
install -D -m 755 src/out_linux/Release/fcitx-mozc.so $out/lib/fcitx/fcitx-mozc.so
80
80
+
install -D -m 644 src/unix/fcitx/fcitx-mozc.conf $out/share/fcitx/addon/fcitx-mozc.conf
81
81
+
install -D -m 644 src/unix/fcitx/mozc.conf $out/share/fcitx/inputmethod/mozc.conf
82
82
+
83
83
+
install -d $out/share/doc/mozc
84
84
+
85
85
+
for mofile in src/out_linux/Release/gen/unix/fcitx/po/*.mo
86
86
+
do
87
87
+
filename=`basename $mofile`
88
88
+
lang=$filename.mo
89
89
+
install -D -m 644 "$mofile" "$out/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo"
90
90
+
done
91
91
+
92
92
+
install -d $out/share/fcitx/imicon
93
93
+
install -m 644 fcitx-mozc-icons/mozc.png $out/share/fcitx/imicon/mozc.png
94
94
+
install -d $out/share/fcitx/mozc/icon
95
95
+
install -m 644 fcitx-mozc-icons/mozc.png $out/share/fcitx/mozc/icon/mozc.png
96
96
+
install -m 644 fcitx-mozc-icons/mozc-alpha_full.png $out/share/fcitx/mozc/icon/mozc-alpha_full.png
97
97
+
install -m 644 fcitx-mozc-icons/mozc-alpha_half.png $out/share/fcitx/mozc/icon/mozc-alpha_half.png
98
98
+
install -m 644 fcitx-mozc-icons/mozc-direct.png $out/share/fcitx/mozc/icon/mozc-direct.png
99
99
+
install -m 644 fcitx-mozc-icons/mozc-hiragana.png $out/share/fcitx/mozc/icon/mozc-hiragana.png
100
100
+
install -m 644 fcitx-mozc-icons/mozc-katakana_full.png $out/share/fcitx/mozc/icon/mozc-katakana_full.png
101
101
+
install -m 644 fcitx-mozc-icons/mozc-katakana_half.png $out/share/fcitx/mozc/icon/mozc-katakana_half.png
102
102
+
install -m 644 fcitx-mozc-icons/mozc-dictionary.png $out/share/fcitx/mozc/icon/mozc-dictionary.png
103
103
+
install -m 644 fcitx-mozc-icons/mozc-properties.png $out/share/fcitx/mozc/icon/mozc-properties.png
104
104
+
install -m 644 fcitx-mozc-icons/mozc-tool.png $out/share/fcitx/mozc/icon/mozc-tool.png
105
105
+
'';
106
106
+
107
107
+
meta = with clangStdenv.lib; {
108
108
+
description = "Fcitx engine for Google japanese input method";
109
109
+
homepage = http://code.google.com/p/mozc/;
110
110
+
downloadPage = "http://download.fcitx-im.org/fcitx-mozc/";
111
111
+
license = licenses.free;
112
112
+
platforms = platforms.linux;
113
113
+
maintainers = [ maintainers.ericsagnes ];
114
114
+
};
115
115
+
116
116
+
}
+4
pkgs/top-level/all-packages.nix
···
1517
1517
1518
1518
fcitx-hangul = callPackage ../tools/inputmethods/fcitx-engines/fcitx-hangul { };
1519
1519
1520
1520
+
fcitx-mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc {
1521
1521
+
inherit (pythonPackages) gyp;
1522
1522
+
};
1523
1523
+
1520
1524
fcitx-table-other = callPackage ../tools/inputmethods/fcitx-engines/fcitx-table-other { };
1521
1525
1522
1526
fcitx-configtool = callPackage ../tools/inputmethods/fcitx/fcitx-configtool.nix { };