Skip to content

Commit c0e246d

Browse files
mecab: fix cross build
1 parent d9e9853 commit c0e246d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

pkgs/tools/text/mecab/ipadic.nix

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2+
lib,
23
stdenv,
34
fetchurl,
45
mecab-nodic,
6+
buildPackages,
57
}:
68

79
stdenv.mkDerivation (finalAttrs: {
@@ -16,8 +18,15 @@ stdenv.mkDerivation (finalAttrs: {
1618

1719
buildInputs = [ mecab-nodic ];
1820

19-
configureFlags = [
20-
"--with-charset=utf8"
21-
"--with-dicdir=${placeholder "out"}"
22-
];
21+
configureFlags =
22+
[
23+
"--with-charset=utf8"
24+
"--with-dicdir=${placeholder "out"}"
25+
]
26+
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
27+
"--with-mecab-config=${lib.getExe' buildPackages.mecab "mecab-config"}"
28+
]
29+
++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
30+
"--with-mecab-config=${lib.getExe' (lib.getDev mecab-nodic) "mecab-config"}"
31+
];
2332
})

0 commit comments

Comments
 (0)