nerd-font-patcher: update patches for 3.4.0

One of the commits included in 3.4.0 [1] broke the patch to update the
path to the glyphs directory [2]. Replace the `postPatch` hook with an
explicit patch to update the paths in the font-patcher script.

[1]: 34a14990b0
[2]: https://github.com/NixOS/nixpkgs/pull/409580#issuecomment-2903671914
This commit is contained in:
Alex James 2025-05-23 13:37:13 -05:00
parent 8aafe60095
commit 89cba04369
No known key found for this signature in database
GPG key ID: 4729B829AC5FCC72
2 changed files with 25 additions and 7 deletions

View file

@ -18,13 +18,9 @@ python3Packages.buildPythonApplication rec {
format = "other";
postPatch = ''
sed -i 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
patches = [
./use-nix-paths.patch
];
dontBuild = true;

View file

@ -0,0 +1,22 @@
diff --git a/font-patcher b/font-patcher
index c48039f2c..e776adfbc 100755
--- a/font-patcher
+++ b/font-patcher
@@ -38,7 +38,7 @@ except ImportError:
)
)
-sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'bin', 'scripts', 'name_parser'))
+sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), '..', 'lib', 'name_parser'))
try:
from FontnameParser import FontnameParser
from FontnameTools import FontnameTools
@@ -2075,7 +2075,7 @@ def setup_arguments():
expert_group.add_argument('--configfile', dest='configfile', default=False, type=str, help='Specify a file path for configuration file (see sample: src/config.sample.cfg)')
expert_group.add_argument('--custom', dest='custom', default=False, type=str, help='Specify a custom symbol font, all glyphs will be copied; absolute path suggested')
expert_group.add_argument('--dry', dest='dry_run', default=False, action='store_true', help='Do neither patch nor store the font, to check naming')
- expert_group.add_argument('--glyphdir', dest='glyphdir', default=__dir__ + "/src/glyphs/", type=str, help='Path to glyphs to be used for patching')
+ expert_group.add_argument('--glyphdir', dest='glyphdir', default=__dir__ + "/../share/glyphs/", type=str, help='Path to glyphs to be used for patching')
expert_group.add_argument('--has-no-italic', dest='noitalic', default=False, action='store_true', help='Font family does not have Italic (but Oblique), to help create correct RIBBI set')
expert_group.add_argument('--metrics', dest='metrics', default=None, choices=get_metrics_names(), help='Select vertical metrics source (for problematic cases)')
expert_group.add_argument('--name', dest='force_name', default=None, type=str, help='Specify naming source (\'full\', \'postscript\', \'filename\', or concrete free name-string)')