2023-05-24 13:37:59 +00:00
|
|
|
{ python3Packages, lib, fetchzip }:
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "nerd-font-patcher";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.0.1";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/FontPatcher.zip";
|
|
|
|
sha256 = "sha256-kh3zQ0lXCmiO72ZXwvLm7LGUZu0hg8G8TG+pknkK1yo=";
|
|
|
|
stripRoot = false;
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [ fontforge ];
|
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i font-patcher \
|
2023-05-24 13:37:59 +00:00
|
|
|
-e 's,__dir__ + "/src,"'$out'/share/,'
|
|
|
|
sed -i font-patcher \
|
|
|
|
-e 's,/bin/scripts/name_parser,/../lib/name_parser,'
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
2023-05-24 13:37:59 +00:00
|
|
|
# Note: we cannot use $out for second substitution
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
mkdir -p $out/bin $out/share $out/lib
|
2022-09-11 15:47:08 +00:00
|
|
|
install -Dm755 font-patcher $out/bin/nerd-font-patcher
|
2023-05-24 13:37:59 +00:00
|
|
|
cp -ra src/glyphs $out/share/
|
|
|
|
cp -ra bin/scripts/name_parser $out/lib/
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Font patcher to generate Nerd font";
|
|
|
|
homepage = "https://nerdfonts.com/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ck3d ];
|
|
|
|
};
|
|
|
|
}
|