-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
58 lines (57 loc) · 1.85 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
description = "Static API for skkishoe";
outputs = { self, nixpkgs }:
let system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system} = let
skk-jisyo-base = pkgs.stdenv.mkDerivation {
name = "skk-JISYO-base";
src = pkgs.fetchurl {
url = "https://skk-dev.github.io/dict/SKK-JISYO.L.gz";
hash = "sha256-GqJ3stBaDONzHGtE3l4ixITQcRXY8MTYuM2a6QevRhM=";
};
nativeBuildInputs = [ pkgs.gzip ];
phases = "unpackPhase installPhase";
unpackPhase = ''
runHook preUnpack
cp $src $(stripHash "$src")
find . -name 'SKK-JISYO.*.gz' -exec gunzip {} \+
runHook postUnpack
'';
installPhase = ''
d="$out/usr/share/skk"
mkdir -p $d
mv SKK-JISYO.* $d/
'';
};
in {
skk-jisyo-L = skk-jisyo-base.overrideAttrs {
name = "skk-JISYO.L";
src = pkgs.fetchurl {
url = "https://skk-dev.github.io/dict/SKK-JISYO.L.gz";
hash = "sha256-GqJ3stBaDONzHGtE3l4ixITQcRXY8MTYuM2a6QevRhM=";
};
};
skk-jisyo-S = skk-jisyo-base.overrideAttrs {
name = "skk-JISYO.S";
pname = "skk-JISYO.S";
src = pkgs.fetchurl {
url = "https://skk-dev.github.io/dict/SKK-JISYO.S.gz";
hash = "sha256-NJ++BzYZ0eWknENU6ZQ1UpLt4Ivi+z5scUgXdRFAXsI=";
};
};
skkishoe-static-api = pkgs.stdenv.mkDerivation {
name = "skkishoe-static-api";
src = ./.;
nativeBuildInputs = [pkgs.nkf pkgs.gawk self.packages.${system}.skk-jisyo-S];
makeFlags = [ "DST=midashis" "DICTIONARIES=${self.packages.${system}.skk-jisyo-S}/usr/share/skk/SKK-JISYO.S"];
installPhase = ''
mkdir -p $out
cp -r midashis $out
'';
};
default = self.packages.x86_64-linux.skkishoe-static-api;
};
};
}