Skip to content

Releases: softprops/zig-envy

v0.2.1

24 Apr 18:42
Compare
Choose a tag to compare

Fix build.zig.zon package name, previously "env" and now "envy.

v0.2.0

20 Apr 22:39
d673bce
Compare
Choose a tag to compare

Upgrade to zig 0.12.0, current stable

The main changes were artifacts of the 0.12.0 and build configuration changes. Because these were both breaking changes the new min supported zig version is 0.12.0. See the readme for the latest install notes.

v0.1.0

22 Nov 05:07
Compare
Choose a tag to compare

Initial release. See readme for more information

📼 installing

Add the following to your build.zig.zon file to declare a dependency

.{
    .name = "my-app",
    .version = "0.1.0",
    .dependencies = .{
        // 👇 declare dep properties
        .envy = .{
            // 👇 uri to download
            .url = "https://github.com/softprops/zig-envy/archive/refs/tags/v0.1.0.tar.gz",
            // 👇 hash verification
            .hash = "1220291df9249a132159b029196dfea159ab3ea5c615aa7b43316f04c01f488c4b4c",
        }
    }
}

Add the following in your build.zig file

const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});

    const optimize = b.standardOptimizeOption(.{});
    // 👇 de-reference envy dep from build.zig.zon
     const envy = b.dependency("envy", .{
        .target = target,
        .optimize = optimize,
    });
    var exe = b.addExecutable(.{
        .name = "your-exe",
        .root_source_file = .{ .path = "src/main.zig" },
        .target = target,
        .optimize = optimize,
    });
    // 👇 add the envy module to executable
    exe.addModule("envy", envy.module("envy"));

    b.installArtifact(exe);
}