Commit 3d0bc18
Make KLayout an optional dependency
KLayout is a heavy end-user GUI tool that was previously required to
complete the ORFS flow. The `finish` target depended on GDS_FINAL_FILE
and `do-finish` called `do-gds`, meaning the flow could not complete
without KLayout installed — even though most use cases never need GDS.
This change decouples KLayout so it is only pulled in when explicitly
requested via `make gds` / `make do-gds`, following the existing
target naming pattern (place/do-place, finish/do-finish, gds/do-gds).
Makefile changes:
- Remove $(GDS_FINAL_FILE) from `finish` dependencies
- Remove do-gds from `do-finish` recipe
- Add explicit `gds` phony target
- Add `check-klayout` guard on all KLayout-dependent targets
(GDS merge, DRC, LVS, gallery, klayout viewer shortcuts)
Extract .lyt tech file generation from sed to Python:
- The do-klayout and do-klayout_wrap targets previously used fragile
sed-based XML manipulation with shell variable expansion and
ifeq/else branching. New util/generate_klayout_tech.py replaces
this with stdlib xml/regex processing (no KLayout dependency).
Refactor def2stream.py for testability:
- Extract logic into merge_gds() function with pya as a parameter
- Guard `import pya` so the module can be imported without KLayout
- When run via `klayout -r`, the script behaves identically using
klayout's -rd global variables
The interface is backwards compatible: `make finish gds` produces GDS
as before, `do-gds` is unchanged, and bazel-orfs can invoke `do-gds`
from a new `orfs_gds()` rule while `do-final` no longer requires
KLayout in the toolchain.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>1 parent 6df88fe commit 3d0bc18
4 files changed
Lines changed: 274 additions & 102 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
594 | 598 | | |
595 | 599 | | |
596 | 600 | | |
597 | | - | |
598 | | - | |
| 601 | + | |
599 | 602 | | |
600 | 603 | | |
601 | 604 | | |
| |||
627 | 630 | | |
628 | 631 | | |
629 | 632 | | |
630 | | - | |
| 633 | + | |
631 | 634 | | |
632 | 635 | | |
633 | 636 | | |
| |||
643 | 646 | | |
644 | 647 | | |
645 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
646 | 660 | | |
647 | 661 | | |
648 | 662 | | |
| |||
658 | 672 | | |
659 | 673 | | |
660 | 674 | | |
661 | | - | |
| 675 | + | |
662 | 676 | | |
663 | 677 | | |
664 | 678 | | |
| |||
768 | 782 | | |
769 | 783 | | |
770 | 784 | | |
771 | | - | |
| 785 | + | |
772 | 786 | | |
773 | 787 | | |
774 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | | - | |
4 | | - | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
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 | 10 | | |
69 | | - | |
70 | | - | |
| 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 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
71 | 97 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 98 | + | |
| 99 | + | |
78 | 100 | | |
79 | | - | |
80 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
81 | 107 | | |
| 108 | + | |
| 109 | + | |
82 | 110 | | |
83 | | - | |
84 | | - | |
| 111 | + | |
| 112 | + | |
85 | 113 | | |
86 | | - | |
| 114 | + | |
87 | 115 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
93 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
94 | 147 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
0 commit comments