~leon_plickat/public-inbox

[PATCH upgrade to Zig 0.13.0 1/7] build: update to Zig 0.12.0

Details
Message ID
<20240625125718.32012-2-contact@uncomfyhalomacro.pl>
DKIM signature
pass
Download raw message
Patch: +46 -29
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
---
 build.zig     | 48 +++++++++++++++++++-----------------------------
 build.zig.zon | 27 +++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 29 deletions(-)
 create mode 100644 build.zig.zon

diff --git a/build.zig b/build.zig
index 73b6778..ff36053 100644
--- a/build.zig
@@ -2,7 +2,7 @@ const std = @import("std");
const fs = std.fs;
const mem = std.mem;

const Scanner = @import("deps/zig-wayland/build.zig").Scanner;
const Scanner = @import("zig-wayland").Scanner;

pub fn build(b: *std.Build) !void {
    const target = b.standardTargetOptions(.{});
@@ -22,22 +22,11 @@ pub fn build(b: *std.Build) !void {
    scanner.generate("wl_seat", 8);
    scanner.generate("wl_output", 4);

    const wayland = b.createModule(.{ .source_file = scanner.result });
    const xkbcommon = b.createModule(.{
        .source_file = .{ .path = "deps/zig-xkbcommon/src/xkbcommon.zig" },
    });
    const pixman = b.createModule(.{
        .source_file = .{ .path = "deps/zig-pixman/pixman.zig" },
    });
    const spoon = b.createModule(.{
        .source_file = .{ .path = "deps/zig-spoon/import.zig" },
    });
    const fcft = b.createModule(.{
        .source_file = .{ .path = "deps/zig-fcft/fcft.zig" },
        .dependencies = &.{
            .{ .name = "pixman", .module = pixman },
        },
    });
    const wayland = b.dependency("zig-wayland", .{}).module("wayland");
    const xkbcommon = b.dependency("zig-xkbcommon", .{}).module("xkbcommon");
    const pixman = b.dependency("zig-pixman", .{}).module("pixman");
    const spoon = b.dependency("zig-spoon", .{}).module("spoon");
    const fcft = b.dependency("zig-fcft", .{}).module("fcft");

    const wayprompt_cli = b.addExecutable(.{
        .name = "wayprompt",
@@ -45,19 +34,20 @@ pub fn build(b: *std.Build) !void {
        .target = target,
        .optimize = optimize,
    });
    wayprompt_cli.root_module.addOptions("build_options", options);
    wayprompt_cli.linkLibC();
    wayprompt_cli.addModule("wayland", wayland);
    wayprompt_cli.root_module.addImport("wayland", wayland);
    wayprompt_cli.linkSystemLibrary("wayland-client");
    wayprompt_cli.linkSystemLibrary("wayland-cursor");
    scanner.addCSource(wayprompt_cli);
    wayprompt_cli.addModule("fcft", fcft);
    wayprompt_cli.root_module.addImport("fcft", fcft);
    wayprompt_cli.linkSystemLibrary("fcft");
    wayprompt_cli.addModule("xkbcommon", xkbcommon);
    wayprompt_cli.root_module.addImport("xkbcommon", xkbcommon);
    wayprompt_cli.linkSystemLibrary("xkbcommon");
    wayprompt_cli.addModule("pixman", pixman);
    wayprompt_cli.root_module.addImport("pixman", pixman);
    wayprompt_cli.linkSystemLibrary("pixman-1");
    wayprompt_cli.addModule("spoon", spoon);
    wayprompt_cli.addOptions("build_options", options);
    wayprompt_cli.root_module.addImport("spoon", spoon);
    wayprompt_cli.root_module.addOptions("build_options", options);
    wayprompt_cli.pie = pie;
    b.installArtifact(wayprompt_cli);

@@ -68,18 +58,18 @@ pub fn build(b: *std.Build) !void {
        .optimize = optimize,
    });
    wayprompt_pinentry.linkLibC();
    wayprompt_pinentry.addModule("wayland", wayland);
    wayprompt_pinentry.root_module.addImport("wayland", wayland);
    wayprompt_pinentry.linkSystemLibrary("wayland-client");
    wayprompt_pinentry.linkSystemLibrary("wayland-cursor");
    scanner.addCSource(wayprompt_pinentry);
    wayprompt_pinentry.addModule("fcft", fcft);
    wayprompt_pinentry.root_module.addImport("fcft", fcft);
    wayprompt_pinentry.linkSystemLibrary("fcft");
    wayprompt_pinentry.addModule("xkbcommon", xkbcommon);
    wayprompt_pinentry.root_module.addImport("xkbcommon", xkbcommon);
    wayprompt_pinentry.linkSystemLibrary("xkbcommon");
    wayprompt_pinentry.addModule("pixman", pixman);
    wayprompt_pinentry.root_module.addImport("pixman", pixman);
    wayprompt_pinentry.linkSystemLibrary("pixman-1");
    wayprompt_pinentry.addModule("spoon", spoon);
    wayprompt_pinentry.addOptions("build_options", options);
    wayprompt_pinentry.root_module.addImport("spoon", spoon);
    wayprompt_pinentry.root_module.addOptions("build_options", options);
    wayprompt_pinentry.pie = pie;
    b.installArtifact(wayprompt_pinentry);

diff --git a/build.zig.zon b/build.zig.zon
new file mode 100644
index 0000000..1d35dc3
--- /dev/null
@@ -0,0 +1,27 @@
.{
    .name = "wayprompt",
    .version = "0.2.0",
    .paths = .{""},
    .dependencies = .{
        .@"zig-wayland" = .{
            .url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.1.0.tar.gz",
            .hash = "1220b0f8f822c1625af7aae4cb3ab2c4ec1a4c0e99ef32867b2a8d88bb070b3e7f6d",
        },
        .@"zig-fcft" = .{
            .url = "https://git.sr.ht/~novakane/zig-fcft/archive/7881eac29bf0d9de4df1fc31df380e8f5f620585.tar.gz",
            .hash = "1220cc15677890989c54713a7c9d90b6999ad21bdb78fe411b016335daa6cea9f9dd",
        },
        .@"zig-xkbcommon" = .{
            .url = "https://codeberg.org/ifreund/zig-xkbcommon/archive/v0.1.0.tar.gz",
            .hash = "1220733d45419f34cc6c24a2a1bba4da2eb2f0319a846546ac99eb86b51d7ec7637c",
        },
        .@"zig-spoon" = .{
            .url = "https://git.sr.ht/~uncomfy/zig-spoon/archive/0b66d77f5a89c4136daa13b02cebe945feebc668.tar.gz",
            .hash = "1220733d45419f34cc6c24a2a1bba4da2eb2f0319a846546ac99eb86b51d7ec7637c",
        },
        .@"zig-pixman" = .{
            .url = "https://codeberg.org/ifreund/zig-pixman/archive/v0.1.0.tar.gz",
            .hash = "122014eeb4600a059bdcfe1c864862f17e6d5e4237e3bb7d6818f2a5583f6f4eb843",
        },
    },
}
-- 
2.45.2
Reply to thread Export thread (mbox)