summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/fonts/uw-ttyp0/default.nix78
-rw-r--r--pkgs/data/fonts/uw-ttyp0/determinism.patch13
-rw-r--r--pkgs/data/misc/cldr-emoji-annotation/default.nix27
-rw-r--r--pkgs/data/misc/unicode-character-database/default.nix38
-rw-r--r--pkgs/data/misc/unicode-emoji/default.nix59
-rw-r--r--pkgs/data/misc/unihan-database/default.nix38
6 files changed, 253 insertions, 0 deletions
diff --git a/pkgs/data/fonts/uw-ttyp0/default.nix b/pkgs/data/fonts/uw-ttyp0/default.nix
new file mode 100644
index 00000000000..eae820fb0d1
--- /dev/null
+++ b/pkgs/data/fonts/uw-ttyp0/default.nix
@@ -0,0 +1,78 @@
+{ stdenv, fetchurl, perl
+, bdftopcf, bdf2psf, mkfontdir
+, fonttosfnt
+, targetsDat  ? null
+, variantsDat ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "uw-ttyp0";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "https://people.mpi-inf.mpg.de/~uwe/misc/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1vp053bwv8sr40p3pn4sjaiq570zp7knh99z9ynk30v7ml4cz2i8";
+  };
+
+  # remove for version >1.3
+  patches = [ ./determinism.patch ];
+
+  nativeBuildInputs = [ perl bdftopcf bdf2psf fonttosfnt mkfontdir ];
+
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash     = "0hzhaakbbcnz5ksi5p8mavw9578rsqlqadkrirrkhfnyqqlrii4j";
+
+  # configure sizes, encodings and variants
+  preConfigure =
+    (if targetsDat == null
+      then ''
+        cat << EOF > TARGETS.dat
+        SIZES = 11 12 13 14 15 16 17 18 22 \
+        11b 12b 13b 14b 15b 16b 17b 18b 22b 15i 16i 17i 18i
+        ENCODINGS = uni
+        EOF
+      ''
+      else ''cp "${targetsDat}" TARGETS.dat'') +
+    (if variantsDat == null
+      then ''
+        cat << EOF > VARIANTS.dat
+        COPYTO AccStress PApostropheAscii
+        COPYTO PAmComma AccGraveAscii
+        COPYTO Digit0Slashed Digit0
+        EOF
+      ''
+      else ''cp "${variantsDat}" VARIANTS.dat'');
+
+  postBuild = ''
+    # convert bdf to psf and otb fonts
+    build=$(pwd)
+    mkdir {psf,otb}
+    cd ${bdf2psf}/share/bdf2psf
+    for i in $build/genbdf/*.bdf; do
+      name="$(basename $i .bdf)"
+      bdf2psf \
+        --fb "$i" standard.equivalents \
+        ascii.set+useful.set+linux.set 512 \
+        "$build/psf/$name.psf"
+      fonttosfnt -v -o "$build/otb/$name.otb" "$i"
+    done
+    cd $build
+  '';
+
+  postInstall = ''
+    # install psf fonts
+    fontDir="$out/share/consolefonts"
+    mkdir -p "$fontDir"
+    mv -t "$fontDir" psf/*.psf
+    mv -t "$out/share/fonts/X11/misc" otb/*.otb
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Monospace bitmap screen fonts for X11";
+    homepage = https://people.mpi-inf.mpg.de/~uwe/misc/uw-ttyp0/;
+    license = with licenses; [ free mit ];
+    maintainers = with maintainers; [ rnhmjoj ];
+  };
+
+}
diff --git a/pkgs/data/fonts/uw-ttyp0/determinism.patch b/pkgs/data/fonts/uw-ttyp0/determinism.patch
new file mode 100644
index 00000000000..8546ad35933
--- /dev/null
+++ b/pkgs/data/fonts/uw-ttyp0/determinism.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.in b/Makefile.in
+index b9736cd..5740412 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -76,7 +76,7 @@ bdf : $(bdf)
+ 
+ genpcf/%.pcf.gz : genbdf/%.bdf
+ 	$(BDFTOPCF) $< > $(@:.pcf.gz=.pcf)
+-	gzip -9 -f $(@:.pcf.gz=.pcf)
++	gzip -n -9 -f $(@:.pcf.gz=.pcf)
+ 
+ genbdf/t0-11-uni.bdf : bdf/t0-11.bdf bdf/t0-12.bdf VARIANTS.dat mgl/unicode.mgl
+ 	$(MKSHALLOW) bdf/t0-12.bdf | cat - bdf/t0-11.bdf | $(BDFMANGLE) - VARIANTS.dat mgl/unicode.mgl > $@
diff --git a/pkgs/data/misc/cldr-emoji-annotation/default.nix b/pkgs/data/misc/cldr-emoji-annotation/default.nix
new file mode 100644
index 00000000000..4279cf8aec4
--- /dev/null
+++ b/pkgs/data/misc/cldr-emoji-annotation/default.nix
@@ -0,0 +1,27 @@
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cldr-emoji-annotation";
+  version = "36.12.120191002_0";
+
+  src = fetchFromGitHub {
+    owner = "fujiwarat";
+    repo = "cldr-emoji-annotation";
+    rev = version;
+    sha256 = "0nxigzs3mxjgi7c8mmdaxsy5sfl7ihsc2nysaj0db198b33w9clw";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Emoji annotation files in CLDR";
+    homepage = "https://www.unicode.org/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/data/misc/unicode-character-database/default.nix b/pkgs/data/misc/unicode-character-database/default.nix
new file mode 100644
index 00000000000..5f50049856f
--- /dev/null
+++ b/pkgs/data/misc/unicode-character-database/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, fetchurl
+, unzip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "unicode-character-database";
+  version = "12.1.0";
+
+  src = fetchurl {
+    url = "https://www.unicode.org/Public/zipped/${version}/UCD.zip";
+    sha256 = "19m06iw0jl7lhlggcmghi12p6jld0qrmfpksgc243yn6sjh53fi5";
+  };
+
+  nativeBuildInputs = [
+    unzip
+  ];
+
+  setSourceRoot = ''
+    sourceRoot=$PWD
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/unicode
+    cp -r * $out/share/unicode
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Unicode Character Database";
+    homepage = "https://www.unicode.org/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/data/misc/unicode-emoji/default.nix b/pkgs/data/misc/unicode-emoji/default.nix
new file mode 100644
index 00000000000..05472b26d88
--- /dev/null
+++ b/pkgs/data/misc/unicode-emoji/default.nix
@@ -0,0 +1,59 @@
+{ stdenv
+, fetchurl
+, symlinkJoin
+, lib
+}:
+
+let
+  version = "12.1";
+
+  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-data = fetchData {
+      file = "emoji-data.txt";
+      sha256 = "17gfm5a28lsymx36prbjy2g0b27gf3rcgggy0yxdshbxwf6zpf9k";
+    };
+    emoji-sequences = fetchData {
+      file = "emoji-sequences.txt";
+      sha256 = "1fckw5hfyvz5jfp2jczzx8qcs79vf0zyq0z2942230j99arq70vc";
+    };
+    emoji-test = fetchData {
+      file = "emoji-test.txt";
+      sha256 = "0w29lva7gp9g9lf7bz1i24qdalvf440bcq8npsbwr3cpp7na95kh";
+    };
+    emoji-variation-sequences = fetchData {
+      file = "emoji-variation-sequences.txt";
+      sha256 = "0akpib3cinr8xcs045hda5wnpfj6qfdjlkzmq5vgdc50gyhrd2z3";
+    };
+    emoji-zwj-sequences = fetchData {
+      file = "emoji-zwj-sequences.txt";
+      sha256 = "0s2mvy1nr2v1x0rr1fxlsv8ly1vyf9978rb4hwry5vnr678ls522";
+    };
+  };
+in
+
+symlinkJoin rec {
+  name = "unicode-emoji-${version}";
+
+  paths = lib.attrValues srcs;
+
+  passthru = srcs;
+
+  meta = with stdenv.lib; {
+    description = "Unicode Emoji Data Files";
+    homepage = "https://home.unicode.org/emoji/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/data/misc/unihan-database/default.nix b/pkgs/data/misc/unihan-database/default.nix
new file mode 100644
index 00000000000..77da77242a9
--- /dev/null
+++ b/pkgs/data/misc/unihan-database/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, fetchurl
+, unzip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "unihan-database";
+  version = "12.1.0";
+
+  src = fetchurl {
+    url = "https://www.unicode.org/Public/zipped/${version}/Unihan.zip";
+    sha256 = "1kfdhgg2gm52x3s07bijb5cxjy0jxwhd097k5lqhvzpznprm6ibf";
+  };
+
+  nativeBuildInputs = [
+    unzip
+  ];
+
+  setSourceRoot = ''
+    sourceRoot=$PWD
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/unicode
+    cp -r * $out/share/unicode
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Unicode Han Database";
+    homepage = "https://www.unicode.org/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}