deps: removing utf8proc (#8866)

pull/8892/head
Leah Amelia Chen 2025-09-23 20:05:03 +02:00 committed by GitHub
commit 2a24918eec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 0 additions and 74 deletions

View File

@ -1,40 +0,0 @@
const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const module = b.addModule("utf8proc", .{ .root_source_file = .{ .path = "main.zig" } });
const upstream = b.dependency("utf8proc", .{});
const lib = b.addLibrary(.{
.name = "utf8proc",
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
.linkage = .static,
});
lib.linkLibC();
lib.addIncludePath(upstream.path(""));
module.addIncludePath(upstream.path(""));
var flags = std.ArrayList([]const u8).init(b.allocator);
try flags.append("-DUTF8PROC_EXPORTS");
defer flags.deinit();
lib.addCSourceFiles(.{
.root = upstream.path(""),
.files = &.{"utf8proc.c"},
.flags = flags.items,
});
lib.installHeadersDirectoryOptions(.{
.source_dir = upstream.path(""),
.install_dir = .header,
.install_subdir = "",
.include_extensions = &.{".h"},
});
b.installArtifact(lib);
}

View File

@ -1,11 +0,0 @@
.{
.name = "utf8proc",
.version = "2.8.0",
.paths = .{""},
.dependencies = .{
.utf8proc = .{
.url = "https://github.com/JuliaStrings/utf8proc/archive/refs/tags/v2.8.0.tar.gz",
.hash = "1220056ce228a8c58f1fa66ab778f5c8965e62f720c1d30603c7d534cb7d8a605ad7",
},
},
}

View File

@ -1,3 +0,0 @@
pub const c = @cImport({
@cInclude("utf8proc.h");
});

View File

@ -1,20 +0,0 @@
pub const c = @import("c.zig").c;
/// Given a codepoint, return a character width analogous to `wcwidth(codepoint)`,
/// except that a width of 0 is returned for non-printable codepoints
/// instead of -1 as in `wcwidth`.
pub fn charwidth(codepoint: u21) u8 {
return @intCast(c.utf8proc_charwidth(@intCast(codepoint)));
}
/// Given a pair of consecutive codepoints, return whether a grapheme break is
/// permitted between them (as defined by the extended grapheme clusters in UAX#29).
pub fn graphemeBreakStateful(cp1: u21, cp2: u21, state: *i32) bool {
return c.utf8proc_grapheme_break_stateful(
@intCast(cp1),
@intCast(cp2),
state,
);
}
test {}