about summary refs log tree commit diff
path: root/nixpkgs/pkgs/data/fonts/twitter-color-emoji/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/data/fonts/twitter-color-emoji/default.nix')
-rw-r--r--nixpkgs/pkgs/data/fonts/twitter-color-emoji/default.nix38
1 files changed, 18 insertions, 20 deletions
diff --git a/nixpkgs/pkgs/data/fonts/twitter-color-emoji/default.nix b/nixpkgs/pkgs/data/fonts/twitter-color-emoji/default.nix
index 5c01283d3e9c..4e464f370229 100644
--- a/nixpkgs/pkgs/data/fonts/twitter-color-emoji/default.nix
+++ b/nixpkgs/pkgs/data/fonts/twitter-color-emoji/default.nix
@@ -3,28 +3,20 @@
 
 { stdenv
 , fetchFromGitHub
+, fetchpatch
 , cairo
-, imagemagick
+, graphicsmagick
 , pkg-config
 , pngquant
-, python2
+, python3
 , which
 , zopfli
+, noto-fonts-emoji
 }:
 
 let
   version = "12.1.2";
 
-  # Cannot use noto-fonts-emoji.src since it is too old
-  # and still tries to use vendored pngquant.
-  notoSrc = fetchFromGitHub {
-    name = "noto";
-    owner = "googlefonts";
-    repo = "noto-emoji";
-    rev = "833a43d03246a9325e748a2d783006454d76ff66";
-    sha256 = "1g6ikzk8banm3ihqm9g27ggjq2mn1b1hq3zhpl13lxid6mp60s4a";
-  };
-
   twemojiSrc = fetchFromGitHub {
     name = "twemoji";
     owner = "twitter";
@@ -33,36 +25,42 @@ let
     sha256 = "0vzmlp83vnk4njcfkn03jcc1vkg2rf12zf5kj3p3a373xr4ds1zn";
   };
 
-  python = python2.withPackages (pp: with pp; [
-    nototools
-  ]);
 in
 stdenv.mkDerivation rec {
   pname = "twitter-color-emoji";
   inherit version;
 
   srcs = [
-    notoSrc
+    noto-fonts-emoji.src
     twemojiSrc
   ];
 
-  sourceRoot = notoSrc.name;
+  sourceRoot = noto-fonts-emoji.src.name;
 
   postUnpack = ''
     chmod -R +w ${twemojiSrc.name}
-    mv ${twemojiSrc.name} ${notoSrc.name}
+    mv ${twemojiSrc.name} ${noto-fonts-emoji.src.name}
   '';
 
   nativeBuildInputs = [
     cairo
-    imagemagick
+    graphicsmagick
     pkg-config
     pngquant
-    python
+    python3
+    python3.pkgs.nototools
     which
     zopfli
   ];
 
+  patches = [
+    # ImageMagick -> GrahphicsMagick
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/twitter-twemoji-fonts/raw/3bc176c10ced2824fe03da5ff561e22a36bf8ccd/f/noto-emoji-use-gm.patch";
+      sha256 = "0yfmfzaaiq5163c06172g4r734aysiqyv1s28siv642vqzsqh4i2";
+    })
+  ];
+
   postPatch = let
     templateSubstitutions = stdenv.lib.concatStringsSep "; " [
       ''s#Noto Color Emoji#Twitter Color Emoji#''