Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[update] add oniguruma dep #8

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pong.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
repository_dispatch:
types:
- ping-from-toolbox
- ping-from-oniguruma.zig
- ping-from-spaceporn-action-bot
- ping-from-spaceporn-action-ci
- ping-from-spaceporn-action-cd-pong
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ These repositories are automatically updated when a new release is available:
This repository is automatically updated when a new release is available from these repositories:
* [jqlang/jq][1]
* [tiawl/toolbox][3]
* [tiawl/oniguruma.zig][9]
* [tiawl/spaceporn-action-env][8]
* [tiawl/spaceporn-action-bot][4]
* [tiawl/spaceporn-action-ci][5] (TODO)
Expand Down Expand Up @@ -60,3 +61,4 @@ The parts of this repository originated from this repository are dedicated to th
[6]:https://github.com/tiawl/spaceporn-action-cd-ping
[7]:https://github.com/tiawl/spaceporn-action-cd-pong
[8]:https://github.com/tiawl/spaceporn-action-env
[9]:https://github.com/tiawl/oniguruma.zig
15 changes: 14 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ pub fn build (builder: *std.Build) !void
.host = toolbox.Repository.Host.github,
.ref = toolbox.Repository.Reference.tag,
},
.oniguruma = .{
.name = "tiawl/oniguruma.zig",
.host = toolbox.Repository.Host.github,
.ref = toolbox.Repository.Reference.tag,
},
.winpthreads = .{
.name = "kassane/winpthreads-zigbuild",
.host = toolbox.Repository.Host.github,
Expand Down Expand Up @@ -144,6 +149,14 @@ pub fn build (builder: *std.Build) !void
lib.linkSystemLibrary ("shlwapi");
}

const oniguruma_dep = builder.dependency ("oniguruma", .{
.target = target,
.optimize = optimize,
});

lib.linkLibrary (oniguruma_dep.artifact ("oniguruma"));
lib.installLibraryHeaders (oniguruma_dep.artifact ("oniguruma"));

lib.linkLibC ();

toolbox.addHeader (lib, path.getJqSrc (), ".", &.{ ".h", ".inc", });
Expand All @@ -152,7 +165,7 @@ pub fn build (builder: *std.Build) !void
try std.fs.openDirAbsolute (path.getJqSrc (), .{ .iterate = true, });
defer jq_src_dir.close ();

const flags = [_][] const u8 { "-DIEEE_8087=1", "-D_GNU_SOURCE=1", };
const flags = [_][] const u8 { "-DIEEE_8087=1", "-D_GNU_SOURCE=1", "-DHAVE_LIBONIG=1" };
var it = jq_src_dir.iterate ();
while (try it.next ()) |*entry|
{
Expand Down
4 changes: 4 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
.url = "https://github.com/tiawl/toolbox/archive/refs/tags/1.11.2.tar.gz",
.hash = "122037046680450473adc3670f08c8695638d05f07c00be18e94ff3f7e21edf9ed9e",
},
.oniguruma = .{
.url = "https://github.com/tiawl/oniguruma.zig/archive/refs/tags/v6.9.9.tar.gz",
.hash = "1220901998824e7f2ba9469c64caa8841993d7a9fce51309db50b818af2f1b60bd5d",
},
.winpthreads = .{
.url = "https://github.com/kassane/winpthreads-zigbuild/archive/909ce0eacf5513be493837d13f2ef84f935bf9a8.tar.gz",
.hash = "1220c08bf3c940723ee12a0c14bb761cb14c63bdae54ce34d47450eed168daa62780",
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn main () !void
defer c.jq_util_input_free (&input_state);
c.jq_set_input_cb (jq, c.jq_util_input_next_input_cb, input_state);

const program = ".data[].firstName";
const program = ".data[].firstName | sub(\"Sher\"; \"Un\")";
const compiled = c.jq_compile (jq, try allocator.dupeZ (u8, program));

if (compiled == 0) return error.JqCompileError;
Expand Down
Loading