just setting up the environment

This commit is contained in:
vfs committed 2026-02-01 23:06:37 +01:00
1 parent 6d69fa8898
commit 49ce31ee2e
56 files changed
+1243 -12005

No files matched your search

+145
View File
@@ -0,0 +1,145 @@
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// const use_system_zlib = b.option(bool, "use_system_zlib", "Use system zlib") orelse false;
// const enable_brotli = b.option(bool, "enable_brotli", "Build Brotli") orelse true;
const freetype_src = b.dependency("freetype_src", .{ .target = target, .optimize = optimize });
const lib = b.addLibrary(.{
.name = "freetype",
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
lib.root_module.link_libc = true;
lib.addIncludePath(b.path("include"));
lib.root_module.addCMacro("FT2_BUILD_LIBRARY", "1");
// if (use_system_zlib) {
// lib.root_module.addCMacro("FT_CONFIG_OPTION_SYSTEM_ZLIB", "1");
// }
// if (enable_brotli) {
// lib.root_module.addCMacro("FT_CONFIG_OPTION_USE_BROTLI", "1");
// if (b.lazyDependency("brotli", .{
// .target = target,
// .optimize = optimize,
// })) |dep| lib.linkLibrary(dep.artifact("brotli"));
// }
lib.root_module.addCMacro("HAVE_UNISTD_H", "1");
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/autofit/autofit.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftbase.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftsystem.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftdebug.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftbbox.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftbdf.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftbitmap.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftcid.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftfstype.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftgasp.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftglyph.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftgxval.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftinit.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftmm.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftotval.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftpatent.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftpfr.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftstroke.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftsynth.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/fttype1.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/base/ftwinfnt.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/bdf/bdf.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/bzip2/ftbzip2.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/cache/ftcache.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/cff/cff.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/cid/type1cid.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/gzip/ftgzip.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/lzw/ftlzw.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/pcf/pcf.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/pfr/pfr.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/psaux/psaux.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/pshinter/pshinter.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/psnames/psnames.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/raster/raster.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/sdf/sdf.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/sfnt/sfnt.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/smooth/smooth.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/svg/svg.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/truetype/truetype.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/type1/type1.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/type42/type42.c") });
lib.root_module.addCSourceFile(.{ .file = freetype_src.path("src/winfonts/winfnt.c") });
lib.root_module.addIncludePath(freetype_src.path("include"));
// lib.addCSourceFiles(.{ .files = &sources, .flags = &.{} });
if (target.result.os.tag == .macos)
lib.addCSourceFile(.{
.file = freetype_src.path("src/base/ftmac.c"),
.flags = &.{},
});
lib.installHeadersDirectory(freetype_src.path("include/freetype"), "freetype", .{});
lib.installHeader(freetype_src.path("include/ft2build.h"), "ft2build.h");
b.installArtifact(lib);
const freetype = b.addModule("freetype", .{
.root_source_file = b.path("src/freetype.zig"),
.imports = &.{
},
});
freetype.linkLibrary(lib);
}
// const sources = [_][]const u8{
// "src/autofit/autofit.c",
// "src/base/ftbase.c",
// "src/base/ftsystem.c",
// "src/base/ftdebug.c",
// "src/base/ftbbox.c",
// "src/base/ftbdf.c",
// "src/base/ftbitmap.c",
// "src/base/ftcid.c",
// "src/base/ftfstype.c",
// "src/base/ftgasp.c",
// "src/base/ftglyph.c",
// "src/base/ftgxval.c",
// "src/base/ftinit.c",
// "src/base/ftmm.c",
// "src/base/ftotval.c",
// "src/base/ftpatent.c",
// "src/base/ftpfr.c",
// "src/base/ftstroke.c",
// "src/base/ftsynth.c",
// "src/base/fttype1.c",
// "src/base/ftwinfnt.c",
// "src/bdf/bdf.c",
// "src/bzip2/ftbzip2.c",
// "src/cache/ftcache.c",
// "src/cff/cff.c",
// "src/cid/type1cid.c",
// "src/gzip/ftgzip.c",
// "src/lzw/ftlzw.c",
// "src/pcf/pcf.c",
// "src/pfr/pfr.c",
// "src/psaux/psaux.c",
// "src/pshinter/pshinter.c",
// "src/psnames/psnames.c",
// "src/raster/raster.c",
// "src/sdf/sdf.c",
// "src/sfnt/sfnt.c",
// "src/smooth/smooth.c",
// "src/svg/svg.c",
// "src/truetype/truetype.c",
// "src/type1/type1.c",
// "src/type42/type42.c",
// "src/winfonts/winfnt.c",
// };
+18
View File
@@ -0,0 +1,18 @@
.{
.name = .freetype,
.version = "0.1.0",
.minimum_zig_version = "0.15.2",
.paths = .{
"build.zig",
"build.zig.zon",
"libs",
"src",
"README.md",
},
.dependencies = .{
.freetype_src = .{
.url = "https://github.com/freetype/freetype/archive/refs/heads/master.tar.gz",
.hash = "N-V-__8AAGJyqgCBGp-ibrZFNycPitwyNbU5U83UzSNGyJnT",
},
},
}
+1908
View File
File diff suppressed because it is too large. Load diff