File: Load-ninja_syntax-from-gftools.patch

package info (click to toggle)
gftools 0.9.85%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,204 kB
  • sloc: python: 15,301; makefile: 6; sh: 5
file content (46 lines) | stat: -rw-r--r-- 1,586 bytes parent folder | download
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
From: Bastian Germann <bage@debian.org>
Date: Wed, 2 Apr 2025 08:37:11 +0200
Subject: Load ninja_syntax from gftools

The origin can be the ninja-build package when https://bugs.debian.org/943540
is implemented.
---
--- a/Lib/gftools/builder/operations/instantiateUfo.py
+++ b/Lib/gftools/builder/operations/instantiateUfo.py
@@ -7,7 +7,7 @@ import os
 import gftools.builder
 from functools import cached_property
 from glyphsLib.builder import UFOBuilder
-from ninja.ninja_syntax import Writer, escape_path
+from gftools.builder.ninja_syntax import Writer, escape_path
 from fontTools.designspaceLib import InstanceDescriptor
 
 
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -63,7 +63,6 @@ dependencies = [
   'beautifulsoup4',
   'rich',
   'packaging',
-  'ninja',
   'networkx',
   'ruamel.yaml',
   # Used for subset merging, and preferred over the home-grown UFO merge script,
--- a/Lib/gftools/builder/__init__.py
+++ b/Lib/gftools/builder/__init__.py
@@ -13,8 +13,7 @@ import networkx as nx
 import strictyaml
 import yaml
 from fontmake.font_project import FontProject
-from ninja import _program
-from ninja.ninja_syntax import Writer, escape_path
+from gftools.builder.ninja_syntax import Writer, escape_path
 from typing import Union
 
 from gftools.builder.file import File
@@ -455,4 +455,4 @@ def main(args=None):
         pd.draw_graph()
     if not args.no_ninja:
         atexit.register(pd.clean)
-        raise SystemExit(_program("ninja", ["-f", pd.ninja_file_name]))
+        raise SystemExit(subprocess.call(["ninja", "-f", pd.ninja_file_name], close_fds=False))