Skip to content

Commit 2ca058e

Browse files
coryalderCory Alder
andauthored
Fix build.zig for 0.12.1, and add running instructions to readme, detect inkscape layer names (#7)
* Add selectors for inkscape svgs * Fix workflow and compile with zig 0.12.1 * Add running instructions to readme --------- Co-authored-by: Cory Alder <[email protected]>
1 parent 6ef5b3b commit 2ca058e

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727

2828
- name: Install Zig
2929
run: |
30-
wget -q https://ziglang.org/builds/zig-linux-x86_64-0.12.0-dev.1830+779b8e259.tar.xz
31-
tar -xf zig-linux-x86_64-0.12.0-dev.1830+779b8e259.tar.xz
30+
wget -q https://ziglang.org/download/0.12.1/zig-linux-x86_64-0.12.1.tar.xz
31+
tar -xf zig-linux-x86_64-0.12.1.tar.xz
3232
3333
- uses: actions/setup-python@v4
3434
with:
@@ -41,7 +41,7 @@ jobs:
4141
- name: Build native
4242
working-directory: native
4343
run: |
44-
../zig-linux-x86_64-0.12.0-dev.1830+779b8e259/zig build -Doptimize=ReleaseFast
44+
../zig-linux-x86_64-0.12.1/zig build -Doptimize=ReleaseFast
4545
4646
- name: Build web
4747
run: |

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Gingerbread is a tool for converting vector artwork to KiCAD PCB files that live
44

55
See https://gingerbread.wntr.dev for more information.
66

7+
## Building & Running
8+
9+
1. make sure you have python3 and zig (0.12.1) installed
10+
2. build the native code in `native/` using `zig build`
11+
3. make sure you have `jinja2` installed (`python3 -m pip install jinja2`)
12+
4. run build.py in the root directory (`python3 build.py`)
13+
5. this builds the site into `build/`, serve it using python `python3 -m http.server 8080 --bind 127.0.0.1 --directory ./build` and visit `http://127.0.0.1:8080/` to view the site
14+
715
## License and contributing
816

917
Gingerbread is open source! Please take a chance to read the [LICENSE](LICENSE.md) file.

native/build.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
const std = @import("std");
22

33
pub fn build(b: *std.Build) void {
4-
const target: std.zig.CrossTarget = .{ .cpu_arch = .wasm32, .os_tag = .wasi };
4+
const target = b.resolveTargetQuery(.{
5+
.cpu_arch = .wasm32,
6+
.os_tag = .wasi,
7+
});
58
const optimize = b.standardOptimizeOption(.{});
69

710
const libpotrace = b.addStaticLibrary(.{
@@ -48,11 +51,11 @@ pub fn build(b: *std.Build) void {
4851
.version = .{ .major = 1, .minor = 0, .patch = 0 },
4952
.target = target,
5053
.optimize = optimize,
54+
.strip = true
5155
});
5256
libgingerbread.entry = .disabled;
5357
libgingerbread.rdynamic = true;
5458
libgingerbread.wasi_exec_model = std.builtin.WasiExecModel.reactor;
55-
libgingerbread.strip = false;
5659
libgingerbread.linkLibC();
5760
libgingerbread.linkLibrary(libpotrace);
5861
libgingerbread.linkLibrary(libclipper2);

web/scripts/main.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,57 +23,57 @@ class Design {
2323
{
2424
name: "Drill",
2525
type: "drill",
26-
selector: "#Drill, #Drills",
26+
selector: "#Drill, #Drills, [*|label=\"Drills\"]",
2727
color: "Fuchsia",
2828
},
2929
{
3030
name: "FSilkS",
3131
type: "raster",
32-
selector: "#FSilkS, #F\\.SilkS",
32+
selector: "#FSilkS, #F\\.SilkS, [*|label=\"F\\.SilkS\"]",
3333
color: "white",
3434
number: 3,
3535
},
3636
{
3737
name: "FMask",
3838
type: "raster",
39-
selector: "#FMask, #F\\.Mask",
39+
selector: "#FMask, #F\\.Mask, [*|label=\"F\\.Mask\"]",
4040
color: "black",
4141
is_mask: true,
4242
number: 5,
4343
},
4444
{
4545
name: "FCu",
4646
type: "raster",
47-
selector: "#FCu, #F\\.Cu",
47+
selector: "#FCu, #F\\.Cu, [*|label=\"F\\.Cu\"]",
4848
color: "gold",
4949
number: 1,
5050
},
5151
{
5252
name: "BCu",
5353
type: "raster",
54-
selector: "#BCu, #B\\.Cu",
54+
selector: "#BCu, #B\\.Cu, [*|label=\"B\\.Cu\"]",
5555
color: "gold",
5656
number: 2,
5757
},
5858
{
5959
name: "BMask",
6060
type: "raster",
61-
selector: "#BMask, #B\\.Mask",
61+
selector: "#BMask, #B\\.Mask, [*|label=\"B\\.Mask\"]",
6262
color: "black",
6363
is_mask: true,
6464
number: 6,
6565
},
6666
{
6767
name: "BSilkS",
6868
type: "raster",
69-
selector: "#BSilkS, #B\\.SilkS",
69+
selector: "#BSilkS, #B\\.SilkS, [*|label=\"B\\.SilkS\"]",
7070
color: "white",
7171
number: 4,
7272
},
7373
{
7474
name: "EdgeCuts",
7575
type: "vector",
76-
selector: "#EdgeCuts, #Edge\\.Cuts",
76+
selector: "#EdgeCuts, #Edge\\.Cuts, [*|label=\"Edge\\.Cuts\"]",
7777
color: "PeachPuff",
7878
force_color: true,
7979
number: 7,

0 commit comments

Comments
 (0)