all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 400c608f8801193e460fbdac4f3643a7de070c9d 3765 bytes (raw)
name: gnu/packages/patches/nerd-font-patcher-convert-to-python-package.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 
This patch

* Creates a pyproject.toml file
* Changes paths to be more sensible.

It requires extra work in a snippet to work properly, because moving the
files in a patch would effectively duplicate all the code.

 font-patcher                               | 13 ++++---------
 bin/scripts/name_parser/FontnameParser.py |  2 +-
 pyproject.toml                             | 13 +++++++++++++
 3 files changed, 18 insertions(+), 10 deletions(-)
 create mode 100644 pyproject.toml

diff --git a/font-patcher b/font-patcher
index 4cbf46c..89ae402 100755
--- a/font-patcher
+++ b/font-patcher
@@ -38,13 +38,9 @@ except ImportError:
         )
     )
 
-sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])) + '/bin/scripts/name_parser/')
-try:
-    from FontnameParser import FontnameParser
-    from FontnameTools import FontnameTools
-    FontnameParserOK = True
-except ImportError:
-    FontnameParserOK = False
+from nerd_font_patcher.name_parser.FontnameParser import FontnameParser
+from nerd_font_patcher.name_parser.FontnameTools import FontnameTools
+FontnameParserOK = True
 
 class TableHEADWriter:
     """ Access to the HEAD table without external dependencies """
@@ -1897,7 +1893,7 @@ def setup_arguments():
     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/fonts/nerd-font-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('-l', '--adjust-line-height',                dest='adjustLineHeight', default=False, action='store_true', help='Whether to adjust line heights (attempt to center powerline separators more evenly)')
     expert_group.add_argument('--metrics',                                 dest='metrics',          default=None, choices=get_metrics_names(), help='Select vertical metrics source (for problematic cases)')
@@ -2068,5 +2064,4 @@ def main():
 
 
 if __name__ == "__main__":
-    __dir__ = os.path.dirname(os.path.abspath(__file__))
     main()
diff --git a/bin/scripts/name_parser/FontnameParser.py b/bin/scripts/name_parser/FontnameParser.py
index 5768c42..1d95fdc 100644
--- a/bin/scripts/name_parser/FontnameParser.py
+++ b/bin/scripts/name_parser/FontnameParser.py
@@ -2,7 +2,7 @@
 # coding=utf8
 
 import re
-from FontnameTools import FontnameTools
+from nerd_font_patcher.name_parser.FontnameTools import FontnameTools
 
 class FontnameParser:
     """Parse a font name and generate all kinds of names"""
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..e039e68
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,13 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "font_patcher"
+version = "3.1.1"
+
+[project.scripts]
+font-patcher = "nerd_font_patcher:main"
+
+[tool.setuptools]
+packages = ["nerd_font_patcher", "nerd_font_patcher.name_parser"]
-- 
2.41.0


debug log:

solving 400c608f88 ...
found 400c608f88 in https://yhetil.org/guix/173b07571f7417cc23d53e9557e7ce2871075346.1702561323.git.saku@laesvuori.fi/

applying [1/1] https://yhetil.org/guix/173b07571f7417cc23d53e9557e7ce2871075346.1702561323.git.saku@laesvuori.fi/
diff --git a/gnu/packages/patches/nerd-font-patcher-convert-to-python-package.patch b/gnu/packages/patches/nerd-font-patcher-convert-to-python-package.patch
new file mode 100644
index 0000000000..400c608f88

1:28: trailing whitespace.
 
1:39: trailing whitespace.
 
1:44: trailing whitespace.
 
1:52: trailing whitespace.
 
1:53: trailing whitespace.
 
Checking patch gnu/packages/patches/nerd-font-patcher-convert-to-python-package.patch...
Applied patch gnu/packages/patches/nerd-font-patcher-convert-to-python-package.patch cleanly.
warning: squelched 4 whitespace errors
warning: 9 lines add whitespace errors.

index at:
100644 400c608f8801193e460fbdac4f3643a7de070c9d	gnu/packages/patches/nerd-font-patcher-convert-to-python-package.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.