From c0e246d9a99e196b0915dce6355564105b381876 Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Mon, 13 Jan 2025 12:38:31 +0100 Subject: [PATCH] mecab: fix cross build --- pkgs/tools/text/mecab/ipadic.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/text/mecab/ipadic.nix b/pkgs/tools/text/mecab/ipadic.nix index 5eb1439ed0db..1a44af2d3eb8 100644 --- a/pkgs/tools/text/mecab/ipadic.nix +++ b/pkgs/tools/text/mecab/ipadic.nix @@ -1,7 +1,9 @@ { + lib, stdenv, fetchurl, mecab-nodic, + buildPackages, }: stdenv.mkDerivation (finalAttrs: { @@ -16,8 +18,15 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ mecab-nodic ]; - configureFlags = [ - "--with-charset=utf8" - "--with-dicdir=${placeholder "out"}" - ]; + configureFlags = + [ + "--with-charset=utf8" + "--with-dicdir=${placeholder "out"}" + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "--with-mecab-config=${lib.getExe' buildPackages.mecab "mecab-config"}" + ] + ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "--with-mecab-config=${lib.getExe' (lib.getDev mecab-nodic) "mecab-config"}" + ]; })