1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 22:20:51 +00:00
nixpkgs/pkgs/data/fonts/openmoji/default.nix
2021-08-12 17:15:53 +02:00

59 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, scfbuild
, nodejs
, nodePackages
, python3Packages
, variant ? "color" # "color" or "black"
}:
let
filename = builtins.replaceStrings
[ "color" "black" ]
[ "OpenMoji-Color.ttf" "OpenMoji-Black.ttf" ]
variant;
in stdenv.mkDerivation rec {
pname = "openmoji";
version = "13.1.0";
src = fetchFromGitHub {
owner = "hfg-gmuend";
repo = pname;
rev = version;
sha256 = "sha256-7G6a+LFq79njyPhnDhhSJ98Smw5fWlfcsFj6nWBPsSk=";
};
nativeBuildInputs = [
scfbuild
nodejs
nodePackages.glob
nodePackages.lodash
];
buildPhase = ''
runHook preBuild
node helpers/generate-font-glyphs.js
cd font
scfbuild -c scfbuild-${variant}.yml
runHook postBuild
'';
installPhase = ''
install -Dm644 ${filename} $out/share/fonts/truetype/${filename}
'';
meta = with lib; {
license = licenses.cc-by-sa-40;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
homepage = "https://openmoji.org/";
downloadPage = "https://github.com/hfg-gmuend/openmoji/releases";
description = "Open-source emojis for designers, developers and everyone else";
};
}