about summary refs log tree commit diff
path: root/pkgs/data/misc/unicode-emoji/default.nix
blob: ae14a27c8b7f4b19e72ce2f1e41b070dee688fa7 (plain) (blame)
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
59
60
61
{ lib
, stdenvNoCC
, fetchurl
, symlinkJoin
}:

let
  version = "15.0";

  fetchData = { suffix, hash }: stdenvNoCC.mkDerivation {
    pname = "unicode-emoji-${suffix}";
    inherit version;

    src = fetchurl {
      url = "https://www.unicode.org/Public/emoji/${version}/emoji-${suffix}.txt";
      inherit hash;
    };

    dontUnpack = true;

    installPhase = ''
      runHook preInstall

      installDir="$out/share/unicode/emoji"
      mkdir -p "$installDir"
      cp "$src" "$installDir/emoji-${suffix}.txt"

      runHook postInstall
    '';
  };

  srcs = {
    emoji-sequences = fetchData {
      suffix = "sequences";
      hash = "sha256-XCIi2KQy2JagMaaML1SwT79HsPzi5phT8euKPpRetW0=";
    };
    emoji-test = fetchData {
      suffix = "test";
      hash = "sha256-hEXyOsg4jglr4Z0CYuFPzv+Fb/Ugk/I1bciUhfGoU9s=";
    };
    emoji-zwj-sequences = fetchData {
      suffix = "zwj-sequences";
      hash = "sha256-/jV/kRe3dGZ2Bjdl1YcTft+bJZA6eSvVSTW/CFZ5EYI=";
    };
  };
in

symlinkJoin rec {
  name = "unicode-emoji-${version}";

  paths = lib.attrValues srcs;

  passthru = srcs;

  meta = with lib; {
    description = "Unicode Emoji Data Files";
    homepage = "https://home.unicode.org/emoji/";
    license = licenses.unicode-dfs-2016;
    platforms = platforms.all;
  };
}