about summary refs log tree commit diff
path: root/nixpkgs/pkgs/data/misc/unicode-emoji/default.nix
blob: 9fe9ff78f80471201f239dffb45a567fd1893963 (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
{ lib
, fetchurl
, symlinkJoin
}:

let
  version = "14.0";

  fetchData = { file, sha256 }: fetchurl {
    url = "https://www.unicode.org/Public/emoji/${version}/${file}";
    inherit sha256;
    downloadToTemp = true;
    recursiveHash = true;
    postFetch = ''
      installDir="$out/share/unicode/emoji"
      mkdir -p "$installDir"
      mv "$downloadedFile" "$installDir/${file}"
    '';
  };

  srcs = {
    emoji-sequences = fetchData {
      file = "emoji-sequences.txt";
      sha256 = "sha256-4helD/0oe+UmNIuVxPx/P0R9V10EY/RccewdeemeGxE=";
    };
    emoji-test = fetchData {
      file = "emoji-test.txt";
      sha256 = "sha256-DDOVhnFzfvowINzBZ7dGYMZnL4khyRWVzrLL95djsUg=";
    };
    emoji-zwj-sequences = fetchData {
      file = "emoji-zwj-sequences.txt";
      sha256 = "sha256-owlGLICFkyEsIHz/DUZucxjBmgVO40A69BCJPbIYDA0=";
    };
  };
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;
  };
}