nine-lives-later / zzmq

Zig Binding for ZeroMQ
Mozilla Public License 2.0
19 stars 2 forks source link

Supports zig 0.13.0 #6

Closed ritalin closed 3 months ago

ritalin commented 3 months ago

In zig 0.13.0, build configration is changed. e.g. the path field of std.Build.LazyPath is deprecated, and so on...

This PR has dealt with following problem:

Additionally, a installed path of libzmq (prefix) as the project specific option.

If libzmq is installed on system, it can pass prefix.

zig build -Dprefix=<PATH> test
ritalin commented 3 months ago

I'll provide this PR again by officially release of zig lang 0.13.0.

fkollmann commented 3 months ago

Hi, thanks for the PR. I created a new branch zig-0.13-wip for adapting to Zig 0.13.

Regarding the prefix build option, I am assuming, this is required for your project?

ritalin commented 3 months ago

Yes, the prefix option needs for my project.

Reason: I've installed the libzmq by homebrew on MacOS. The homebrew is installed into /usr/local/opt For avoiding conflict, I do not add this path to system environment variable. So I'd like to pass this prefix as dependency option.

fkollmann commented 3 months ago

FYI, I just updated zzmq to Zig 0.13.

Please feel free to provide a PR for the prefix option. However I think zmq-prefix would be better, since the prefix generally would be expected to apply to all libraries (including libc), instead of zmq, only.

What are your thoughts here?

ritalin commented 3 months ago

LGTM

But a user may be re-define the prefix to other option in hosted project if this option is duplicated or polluted the project.

//  build.zig in host project

const zig_option = b.option([]const u8, "zig-option", "description");
const dep = b.dependency("zzmq", .{ .prefix = zig_option });