summaryrefslogtreecommitdiff
path: root/pkgs/unicode
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-12-13 21:25:24 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-24 01:40:13 +0200
commit24fd1fe6c62b7a9fc347794fde043285da272f5c (patch)
tree65557bf1d241ca389b619dbd24d18d51932ee030 /pkgs/unicode
downloadNUR-24fd1fe6c62b7a9fc347794fde043285da272f5c.tar.gz
NUR-24fd1fe6c62b7a9fc347794fde043285da272f5c.tar.zst
NUR-24fd1fe6c62b7a9fc347794fde043285da272f5c.zip
Initial commit published for NUR
Diffstat (limited to 'pkgs/unicode')
-rw-r--r--pkgs/unicode/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/unicode/default.nix b/pkgs/unicode/default.nix
new file mode 100644
index 00000000..756e939b
--- /dev/null
+++ b/pkgs/unicode/default.nix
@@ -0,0 +1,48 @@
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 ''