1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 20:21:14 +00:00

nerd-font-patcher: 2.2.2 -> 3.0.1

This commit is contained in:
Dilip 2023-05-11 19:31:52 +05:30
parent d9005f04d2
commit 3d6d1d4d6b

View file

@ -1,19 +1,13 @@
{ python3Packages, lib, fetchFromGitHub }:
{ python3Packages, lib, fetchzip }:
python3Packages.buildPythonApplication rec {
pname = "nerd-font-patcher";
version = "2.2.2";
version = "3.0.1";
# This uses a sparse checkout because the repo is >2GB without it
src = fetchFromGitHub {
owner = "ryanoasis";
repo = "nerd-fonts";
rev = "v${version}";
sparseCheckout = [
"font-patcher"
"/src/glyphs"
];
sha256 = "sha256-boZUd1PM8puc9BTgOwCJpkfk6VMdXLsIyp+fQmW/ZqI=";
src = fetchzip {
url = "https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/FontPatcher.zip";
sha256 = "sha256-kh3zQ0lXCmiO72ZXwvLm7LGUZu0hg8G8TG+pknkK1yo=";
stripRoot = false;
};
propagatedBuildInputs = with python3Packages; [ fontforge ];
@ -22,15 +16,19 @@ python3Packages.buildPythonApplication rec {
postPatch = ''
sed -i font-patcher \
-e 's,__dir__ + "/src,"'$out'/share/nerd-font-patcher,'
-e 's,__dir__ + "/src,"'$out'/share/,'
sed -i font-patcher \
-e 's,/bin/scripts/name_parser,/../lib/name_parser,'
'';
# Note: we cannot use $out for second substitution
dontBuild = true;
installPhase = ''
mkdir -p $out/bin $out/share/nerd-font-patcher
mkdir -p $out/bin $out/share $out/lib
install -Dm755 font-patcher $out/bin/nerd-font-patcher
cp -ra src/glyphs $out/share/nerd-font-patcher
cp -ra src/glyphs $out/share/
cp -ra bin/scripts/name_parser $out/lib/
'';
meta = with lib; {