From 3d6d1d4d6b510c180eeeff0f1966330418abdce5 Mon Sep 17 00:00:00 2001 From: Dilip Date: Thu, 11 May 2023 19:31:52 +0530 Subject: [PATCH] nerd-font-patcher: 2.2.2 -> 3.0.1 --- .../misc/nerd-font-patcher/default.nix | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/misc/nerd-font-patcher/default.nix b/pkgs/applications/misc/nerd-font-patcher/default.nix index 21c77316c1a..a1f8d742e2a 100644 --- a/pkgs/applications/misc/nerd-font-patcher/default.nix +++ b/pkgs/applications/misc/nerd-font-patcher/default.nix @@ -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; {