]> git.immae.eu Git - perso/Immae/Config/Nix/NUR.git/blame_incremental - pkgs/unicode/default.nix
Fix shebangs in scripts
[perso/Immae/Config/Nix/NUR.git] / pkgs / unicode / default.nix
... / ...
CommitLineData
1{ lib, fetchurl, runCommand, libarchive }:
2with lib.attrsets;
3let
4 version = "12.0";
5 version-full = "${version}.0";
6 files = {
7 emoji-data = fetchurl {
8 url = "http://www.unicode.org/Public/emoji/${version}/emoji-data.txt";
9 sha256 = "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv";
10 };
11 emoji-sequences = fetchurl {
12 url = "http://www.unicode.org/Public/emoji/${version}/emoji-sequences.txt";
13 sha256 = "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs";
14 };
15 emoji-test = fetchurl {
16 url = "http://www.unicode.org/Public/emoji/${version}/emoji-test.txt";
17 sha256 = "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck";
18 };
19 emoji-variation-sequences = fetchurl {
20 url = "http://www.unicode.org/Public/emoji/${version}/emoji-variation-sequences.txt";
21 sha256 = "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a";
22 };
23 emoji-zwj-sequences = fetchurl {
24 url = "http://www.unicode.org/Public/emoji/${version}/emoji-zwj-sequences.txt";
25 sha256 = "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n";
26 };
27 };
28 zippedFiles = {
29 UCD = fetchurl {
30 url = "http://www.unicode.org/Public/zipped/${version-full}/UCD.zip";
31 sha256 = "1ighy39cjkmqnv1797wrxjz76mv1fdw7zp5j04q55bkwxsdkvrmh";
32 };
33 Unihan = fetchurl {
34 url = "http://www.unicode.org/Public/zipped/${version-full}/Unihan.zip";
35 sha256 = "1kfdhgg2gm52x3s07bijb5cxjy0jxwhd097k5lqhvzpznprm6ibf";
36 };
37 };
38in
39 runCommand "unicode" {
40 buildInputs = [ libarchive ];
41 } ''
42 mkdir -p $out/share/unicode
43 ${builtins.concatStringsSep "\n" (mapAttrsToList (n: u: "install -Dm644 ${u} $out/share/unicode/emoji/${n}.txt") files)}
44 ${builtins.concatStringsSep "\n" (mapAttrsToList (n: u: ''
45 install -Dm644 ${u} $out/share/unicode/${n}.zip
46 bsdtar -C "$out/share/unicode" -x -f "$out/share/unicode/${n}.zip"
47 '') zippedFiles)}
48 ''