skk-dicts: fix cross

This commit is contained in:
Alyssa Ross 2021-11-12 14:44:07 +00:00
parent 860795fd7e
commit be1f676cfa
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, libiconv, skktools }:
{ lib, stdenv, fetchurl, buildPackages, libiconv, skktools }:
let
# kana to kanji
@ -33,6 +33,8 @@ stdenv.mkDerivation {
srcs = [ small medium large edict assoc ];
nativeBuildInputs = [ skktools ] ++ lib.optional stdenv.isDarwin libiconv;
strictDeps = true;
dontUnpack = true;
installPhase = ''
@ -47,14 +49,14 @@ stdenv.mkDerivation {
for src in $srcs; do
dst=$out/share/$(dictname $src)
echo ";;; -*- coding: utf-8 -*-" > $dst # libskk requires this on the first line
iconv -f EUC-JP -t UTF-8 $src |\
${skktools}/bin/skkdic-expr2 >> $dst
${lib.getBin buildPackages.stdenv.cc.libc}/bin/iconv \
-f EUC-JP -t UTF-8 $src | skkdic-expr2 >> $dst
done
# combine .L .edict and .assoc for convenience
dst=$out/share/SKK-JISYO.combined
echo ";;; -*- coding: utf-8 -*-" > $dst
${skktools}/bin/skkdic-expr2 \
skkdic-expr2 \
$out/share/$(dictname ${large}) + \
$out/share/$(dictname ${edict}) + \
$out/share/$(dictname ${assoc}) >> $dst