nixpkgs/pkgs/applications/misc/nerd-font-patcher/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.0 KiB
Nix
Raw Normal View History

2021-10-23 21:55:33 +00:00
{ python3Packages, lib, fetchFromGitHub }:
python3Packages.buildPythonApplication rec {
pname = "nerd-font-patcher";
2022-09-09 15:53:06 +00:00
version = "2.2.2";
2021-10-23 21:55:33 +00:00
# This uses a sparse checkout because the repo is >2GB without it
2021-10-23 21:55:33 +00:00
src = fetchFromGitHub {
owner = "ryanoasis";
repo = "nerd-fonts";
rev = "v${version}";
sparseCheckout = ''
font-patcher
/src/glyphs
'';
2022-09-09 15:53:06 +00:00
sha256 = "sha256-boZUd1PM8puc9BTgOwCJpkfk6VMdXLsIyp+fQmW/ZqI=";
2021-10-23 21:55:33 +00:00
};
propagatedBuildInputs = with python3Packages; [ fontforge ];
format = "other";
postPatch = ''
sed -i font-patcher \
2022-09-09 15:53:06 +00:00
-e 's,__dir__ + "/src,"'$out'/share/nerd-font-patcher,'
2021-10-23 21:55:33 +00:00
'';
dontBuild = true;
installPhase = ''
2022-09-09 15:53:06 +00:00
mkdir -p $out/bin $out/share/nerd-font-patcher
install -Dm755 font-patcher $out/bin/nerd-font-patcher
cp -ra src/glyphs $out/share/nerd-font-patcher
2021-10-23 21:55:33 +00:00
'';
meta = with lib; {
description = "Font patcher to generate Nerd font";
homepage = "https://nerdfonts.com/";
license = licenses.mit;
maintainers = with maintainers; [ ck3d ];
};
}