From 9fbcecc83f7fdc806874d80aef8859d661d4bac4 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Wed, 6 Dec 2023 19:42:41 +0100 Subject: [PATCH] noto-fonts-color-emoji: move out of noto-fonts file --- .../no/noto-fonts-color-emoji/package.nix | 69 +++++++++++++++++++ pkgs/data/fonts/noto-fonts/default.nix | 61 ---------------- pkgs/top-level/all-packages.nix | 1 - 3 files changed, 69 insertions(+), 62 deletions(-) create mode 100644 pkgs/by-name/no/noto-fonts-color-emoji/package.nix 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 ]; + }; +} diff --git a/pkgs/data/fonts/noto-fonts/default.nix b/pkgs/data/fonts/noto-fonts/default.nix index 59ce84dedf3a..caf3134387b4 100644 --- a/pkgs/data/fonts/noto-fonts/default.nix +++ b/pkgs/data/fonts/noto-fonts/default.nix @@ -163,65 +163,4 @@ rec { version = "2.002"; sha256 = "sha256-GLjpTAiHfygj1J4AdUVDJh8kykkFOglq+h4kyat5W9s="; }; - - noto-fonts-color-emoji = - let - version = "2.042"; - emojiPythonEnv = - buildPackages.python3.withPackages (p: with p; [ fonttools nototools ]); - in - stdenvNoCC.mkDerivation { - pname = "noto-fonts-emoji"; - inherit version; - - 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 = with lib; { - description = "Color emoji font"; - homepage = "https://github.com/googlefonts/noto-emoji"; - license = with licenses; [ ofl asl20 ]; - platforms = platforms.all; - maintainers = with maintainers; [ mathnerd314 sternenseemann ]; - }; - }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aea5ce5e828e..b753f9e67f07 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29753,7 +29753,6 @@ with pkgs; noto-fonts-lgc-plus noto-fonts-cjk-sans noto-fonts-cjk-serif - noto-fonts-color-emoji ; nuclear = callPackage ../applications/audio/nuclear { };