about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorjopejoe1 <johannes@joens.email>2023-12-06 19:42:41 +0100
committerJörg Thalheim <Mic92@users.noreply.github.com>2023-12-13 21:28:44 +0100
commit9fbcecc83f7fdc806874d80aef8859d661d4bac4 (patch)
treeb2799051392beb0c91cba48c32ac9e26e2a0586b /pkgs/by-name
parentc34ac183ca5b34670d421ab504b6412c15a0ac9a (diff)
downloadnixlib-9fbcecc83f7fdc806874d80aef8859d661d4bac4.tar
nixlib-9fbcecc83f7fdc806874d80aef8859d661d4bac4.tar.gz
nixlib-9fbcecc83f7fdc806874d80aef8859d661d4bac4.tar.bz2
nixlib-9fbcecc83f7fdc806874d80aef8859d661d4bac4.tar.lz
nixlib-9fbcecc83f7fdc806874d80aef8859d661d4bac4.tar.xz
nixlib-9fbcecc83f7fdc806874d80aef8859d661d4bac4.tar.zst
nixlib-9fbcecc83f7fdc806874d80aef8859d661d4bac4.zip
noto-fonts-color-emoji: move out of noto-fonts file
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/no/noto-fonts-color-emoji/package.nix69
1 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/by-name/no/noto-fonts-color-emoji/package.nix b/pkgs/by-name/no/noto-fonts-color-emoji/package.nix
new file mode 100644
index 000000000000..37f56db62df1
--- /dev/null
+++ b/pkgs/by-name/no/noto-fonts-color-emoji/package.nix
@@ -0,0 +1,69 @@
+{ lib
+, stdenvNoCC
+, fetchFromGitHub
+, buildPackages
+, pkg-config
+, cairo
+, imagemagick
+, zopfli
+, pngquant
+, which
+}:
+
+let
+  emojiPythonEnv =
+    buildPackages.python3.withPackages (p: with p; [ fonttools nototools ]);
+in
+stdenvNoCC.mkDerivation rec {
+  pname = "noto-fonts-color-emoji";
+  version = "2.042";
+
+  src = fetchFromGitHub {
+    owner = "googlefonts";
+    repo = "noto-emoji";
+    rev = "v${version}";
+    hash = "sha256-otJQMXrBIPrxD1vCdgcrZ2h1a9XAMbqEBFumjz1XJ54=";
+  };
+
+  depsBuildBuild = [
+    buildPackages.stdenv.cc
+    pkg-config
+    cairo
+  ];
+
+  nativeBuildInputs = [
+    imagemagick
+    zopfli
+    pngquant
+    which
+    emojiPythonEnv
+  ];
+
+  postPatch = ''
+    patchShebangs *.py
+    patchShebangs third_party/color_emoji/*.py
+    # remove check for virtualenv, since we handle
+    # python requirements using python.withPackages
+    sed -i '/ifndef VIRTUAL_ENV/,+2d' Makefile
+    # Make the build verbose so it won't get culled by Hydra thinking that
+    # it somehow got stuck doing nothing.
+    sed -i 's;\t@;\t;' Makefile
+  '';
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/share/fonts/noto
+    cp NotoColorEmoji.ttf $out/share/fonts/noto
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "Color emoji font";
+    homepage = "https://github.com/googlefonts/noto-emoji";
+    license = with lib.licenses; [ ofl asl20 ];
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ mathnerd314 sternenseemann ];
+  };
+}