about summary refs log tree commit diff
path: root/pkgs/data/fonts/twemoji-color-font
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2021-01-20 17:28:05 +0100
committerMilan <milan@petabyte.dev>2021-02-11 12:39:48 +0100
commit0c5984cf83c30dd6079ae3113580a163362f43b1 (patch)
tree9ddcffc6276398265cf8d9c0366393e3ae0154e3 /pkgs/data/fonts/twemoji-color-font
parentd35eb344f8e9c398b5a21799b0d3af879d16c612 (diff)
twemoji-color-font: use prebuilt from release
Building from sources takes 1.5 hours on hydra for minimal advantages.
Relevant discussion:
https://github.com/NixOS/nixpkgs/issues/97871
Diffstat (limited to 'pkgs/data/fonts/twemoji-color-font')
-rw-r--r--pkgs/data/fonts/twemoji-color-font/default.nix39
1 files changed, 13 insertions, 26 deletions
diff --git a/pkgs/data/fonts/twemoji-color-font/default.nix b/pkgs/data/fonts/twemoji-color-font/default.nix
index 5e690e7fd6f26..7618c653ef441 100644
--- a/pkgs/data/fonts/twemoji-color-font/default.nix
+++ b/pkgs/data/fonts/twemoji-color-font/default.nix
@@ -1,37 +1,24 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, inkscape, imagemagick, potrace, svgo, scfbuild }:
+{ lib
+, stdenv
+, fetchurl
+}:
 
 stdenv.mkDerivation rec {
   pname = "twemoji-color-font";
   version = "12.0.1";
-  src = fetchFromGitHub {
-    owner = "eosrei";
-    repo = "twemoji-color-font";
-    rev = "v${version}";
-    sha256 = "00pbgqpkq21wl8fs0q1xp49xb10m48b9sz8cdc58flkd2vqfssw2";
-  };
 
-  patches = [
-    # Fix build with Inkscape 1.0
-    # https://github.com/eosrei/twemoji-color-font/pull/82
-    (fetchpatch {
-      url = "https://github.com/eosrei/twemoji-color-font/commit/208ad63c2ceb38c528b5237abeb2b85ceedc1d37.patch";
-      sha256 = "TV8I++BEnVUQg7FNbnrEQ/MLV9n3drmspqjmDZgTGFI=";
-      postFetch = ''
-        substituteInPlace $out \
-          --replace "inkscape --without-gui" "inkscape --export-png"
-      '';
-    })
-  ];
+  # We fetch the prebuilt font because building it takes 1.5 hours on hydra.
+  # Relevant issue: https://github.com/NixOS/nixpkgs/issues/97871
+  src = fetchurl {
+    url = "https://github.com/eosrei/twemoji-color-font/releases/download/v${version}/TwitterColorEmoji-SVGinOT-Linux-${version}.tar.gz";
+    sha256 = "1kdy2k7b1k7sjp2l8g10lp2v000iwk8i3wcwgkhqfbwrrj7dg1kq";
+  };
 
-  nativeBuildInputs = [ inkscape imagemagick potrace svgo scfbuild ];
-  # silence inkscape errors about non-writable home
-  preBuild = "export HOME=\"$NIX_BUILD_ROOT\"";
-  makeFlags = [ "SCFBUILD=${scfbuild}/bin/scfbuild" ];
-  enableParallelBuilding = true;
+  dontBuild = true;
 
   installPhase = ''
-    install -Dm755 build/TwitterColorEmoji-SVGinOT.ttf $out/share/fonts/truetype/TwitterColorEmoji-SVGinOT.ttf
-    install -Dm644 linux/fontconfig/56-twemoji-color.conf $out/etc/fonts/conf.d/56-twemoji-color.conf
+    install -Dm755 TwitterColorEmoji-SVGinOT.ttf $out/share/fonts/truetype/TwitterColorEmoji-SVGinOT.ttf
+    install -Dm644 fontconfig/56-twemoji-color.conf $out/etc/fonts/conf.d/56-twemoji-color.conf
   '';
 
   meta = with lib; {