Skip to content

Commit

Permalink
Merge pull request kivikakk#38 from nektro/patch-1
Browse files Browse the repository at this point in the history
Add Zigmod support
  • Loading branch information
kivikakk authored Jan 20, 2022
2 parents a3179c9 + 5e7c6c4 commit 824f3ee
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
* text=auto
*.zig text eol=lf
zig.mod text eol=lf
zigmod.* text eol=lf
zig.mod linguist-language=YAML
2 changes: 2 additions & 0 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- uses: goto-bus-stop/setup-zig@v1
with:
version: master
- uses: nektro/actions-setup-zigmod@v1
- run: zigmod ci
- run: make spec
id: spec-runner
- uses: LouisBrunner/checks-action@v0.1.0
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/zig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
- uses: goto-bus-stop/setup-zig@v1
with:
version: master
- uses: nektro/actions-setup-zigmod@v1
- run: zigmod ci
- run: cat deps.zig
- run: zig build
- run: zig build test
test-macos:
Expand All @@ -27,6 +30,9 @@ jobs:
- uses: goto-bus-stop/setup-zig@v1
with:
version: master
- uses: nektro/actions-setup-zigmod@v1
- run: zigmod ci
- run: cat deps.zig
- run: brew install pkg-config pcre
- run: env ZIG_SYSTEM_LINKER_HACK=1 zig build
- run: env ZIG_SYSTEM_LINKER_HACK=1 zig build test
Expand All @@ -39,6 +45,9 @@ jobs:
- uses: goto-bus-stop/setup-zig@v1
with:
version: master
- uses: nektro/actions-setup-zigmod@v1
- run: zigmod ci
- run: cat deps.zig
- run: c:; cd \vcpkg; git pull; .\bootstrap-vcpkg.bat
- run: vcpkg integrate install
- run: vcpkg install pcre --triplet x64-windows-static
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/zig-cache
/zig-out
zig-*
koino.code-workspace
.zigmod
deps.zig
8 changes: 2 additions & 6 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const std = @import("std");
const linkPcre = @import("vendor/libpcre.zig/build.zig").linkPcre;
const deps = @import("./deps.zig");

pub fn build(b: *std.build.Builder) !void {
const target = b.standardTargetOptions(.{});
Expand All @@ -23,9 +23,5 @@ pub fn build(b: *std.build.Builder) !void {
fn addCommonRequirements(exe: *std.build.LibExeObjStep, target: std.zig.CrossTarget, mode: std.builtin.Mode) !void {
exe.setTarget(target);
exe.setBuildMode(mode);
exe.addPackagePath("libpcre", "vendor/libpcre.zig/src/main.zig");
exe.addPackagePath("htmlentities", "vendor/htmlentities.zig/src/main.zig");
exe.addPackagePath("clap", "vendor/zig-clap/clap.zig");
exe.addPackagePath("zunicode", "vendor/zunicode/src/zunicode.zig");
try linkPcre(exe);
deps.addAllTo(exe);
}
9 changes: 5 additions & 4 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ const builtin = @import("builtin");
const assert = std.debug.assert;

const clap = @import("clap");
const koino = @import("koino");

const Parser = @import("parser.zig").Parser;
const Options = @import("options.zig").Options;
const nodes = @import("nodes.zig");
const html = @import("html.zig");
const Parser = koino.parser.Parser;
const Options = koino.Options;
const nodes = koino.nodes;
const html = koino.html;

pub fn main() !void {
// In debug, use the GeneralPurposeAllocator as the Parser internal allocator
Expand Down
12 changes: 12 additions & 0 deletions zig.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
id: qqo54zxu6pnza9tw4n9r0yrfjrs353genlx4grwd7cef30m9
name: koino
main: src/koino.zig
license: MIT
description: CommonMark + GFM compatible Markdown parser and renderer
dependencies:
- src: git https://github.com/kivikakk/htmlentities.zig
- src: git https://github.com/kivikakk/libpcre.zig
- src: git https://github.com/kivikakk/zunicode

root_dependencies:
- src: git https://github.com/Hejsil/zig-clap
5 changes: 5 additions & 0 deletions zigmod.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2
git https://github.com/kivikakk/htmlentities.zig commit-311c844c1d1d1cb968eedfeb76ce911038b1043a
git https://github.com/kivikakk/libpcre.zig commit-28b876a73d2f7ad2f63aa8219156aca926ef2400
git https://github.com/kivikakk/zunicode commit-5bf4a3a5f0c6e3d96f6def56957ab7f201851c50
git https://github.com/Hejsil/zig-clap commit-0b08e8e330597ee2a6b6e6828e2a33dab6ae54f6

0 comments on commit 824f3ee

Please sign in to comment.