mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
pkg/libxml2: download using zig package manager
This commit is contained in:
@ -4,7 +4,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
const upstream_root = "../../vendor/libxml2";
|
const upstream = b.dependency("libxml2", .{});
|
||||||
|
|
||||||
const lib = b.addStaticLibrary(.{
|
const lib = b.addStaticLibrary(.{
|
||||||
.name = "xml2",
|
.name = "xml2",
|
||||||
@ -13,7 +13,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
lib.linkLibC();
|
lib.linkLibC();
|
||||||
|
|
||||||
lib.addIncludePath(.{ .path = upstream_root ++ "/include" });
|
lib.addIncludePath(upstream.path("include"));
|
||||||
lib.addIncludePath(.{ .path = "override/include" });
|
lib.addIncludePath(.{ .path = "override/include" });
|
||||||
if (target.isWindows()) {
|
if (target.isWindows()) {
|
||||||
lib.addIncludePath(.{ .path = "override/config/win32" });
|
lib.addIncludePath(.{ .path = "override/config/win32" });
|
||||||
@ -96,14 +96,14 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
inline for (srcs) |src| {
|
inline for (srcs) |src| {
|
||||||
lib.addCSourceFile(.{
|
lib.addCSourceFile(.{
|
||||||
.file = .{ .path = upstream_root ++ "/" ++ src },
|
.file = upstream.path(src),
|
||||||
.flags = flags.items,
|
.flags = flags.items,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
lib.installHeader("override/include/libxml/xmlversion.h", "libxml/xmlversion.h");
|
lib.installHeader("override/include/libxml/xmlversion.h", "libxml/xmlversion.h");
|
||||||
lib.installHeadersDirectoryOptions(.{
|
lib.installHeadersDirectoryOptions(.{
|
||||||
.source_dir = .{ .path = upstream_root ++ "/include" },
|
.source_dir = upstream.path("include"),
|
||||||
.install_dir = .header,
|
.install_dir = .header,
|
||||||
.install_subdir = "",
|
.install_subdir = "",
|
||||||
.include_extensions = &.{".h"},
|
.include_extensions = &.{".h"},
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
.{
|
.{
|
||||||
.name = "libxml2",
|
.name = "libxml2",
|
||||||
.version = "2.11.5",
|
.version = "2.11.5",
|
||||||
.dependencies = .{},
|
.dependencies = .{
|
||||||
|
.libxml2 = .{
|
||||||
|
.url = "https://github.com/GNOME/libxml2/archive/refs/tags/v2.11.5.tar.gz",
|
||||||
|
.hash = "122032442d95c3b428ae8e526017fad881e7dc78eab4d558e9a58a80bfbd65a64f7d",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user