summaryrefslogtreecommitdiff
path: root/build/core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build/core.zig')
-rw-r--r--build/core.zig40
1 files changed, 20 insertions, 20 deletions
diff --git a/build/core.zig b/build/core.zig
index 26de1669..974d5c7e 100644
--- a/build/core.zig
+++ b/build/core.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const Platform = @import("../build.zig").Platform;
const TreeSitterGrammars = @import("../build.zig").TreeSitterGrammars;
-const grammar_manifest = @import("../src/grammar_manifest.zig");
+const grammar_manifest = @import("../core/grammar_manifest.zig");
const addons = @import("addons.zig");
const patches = @import("patches.zig");
/// The package manifest, imported UNTYPED on purpose — see the `version`
@@ -16,7 +16,7 @@ else
/// Every dependency the manifest pins, by its content hash: a grammar,
/// ghostty or the Unicode tables steps a core differently, so they are part
-/// of a replica's semantics hash (src/wire.zig `semantics`).
+/// of a replica's semantics hash (abi/wire.zig `semantics`).
const deps_text = blk: {
var text: []const u8 = "";
for (@typeInfo(@TypeOf(zon.dependencies)).@"struct".field_names) |name| {
@@ -71,8 +71,8 @@ pub const ShellConfig = struct {
/// `Build` word's, stamped with the commit (see `stamp_commit`).
change: ?[]const u8 = null,
built: ?[]const u8 = null,
- /// The library's editor (src/lib_editor.zig): a text with no pane, so
- /// the core is not compiled (src/Editor.zig).
+ /// The library's editor (core/lib_editor.zig): a text with no pane, so
+ /// the core is not compiled (core/Editor.zig).
lib: bool = false,
};
@@ -189,7 +189,7 @@ pub fn treeSitter(b: *std.Build, io: std.Io, target: std.Build.ResolvedTarget, c
// Every allocation a grammar's external scanner makes goes to the
// runtime's allocator, which syntax.zig points at a Zig one:
// TREE_SITTER_REUSE_ALLOCATOR for the scanners that use
- // ts_malloc, and src/tree_sitter_heap.h for the ones that call
+ // ts_malloc, and core/tree_sitter_heap.h for the ones that call
// malloc themselves.
const ts_cflags = [_][]const u8{
"-fno-sanitize=function",
@@ -197,7 +197,7 @@ pub fn treeSitter(b: *std.Build, io: std.Io, target: std.Build.ResolvedTarget, c
// From the compiler's working directory, the root
// package's: pardes's own, or the one that depends on it.
"-include",
- b.root.joinString(b.allocator, "src/tree_sitter_heap.h") catch @panic("OOM"),
+ b.root.joinString(b.allocator, "core/tree_sitter_heap.h") catch @panic("OOM"),
};
lib.root_module.addCSourceFile(.{ .file = dep.path(g.src ++ "/parser.c"), .flags = &ts_cflags });
if (g.scanner) lib.root_module.addCSourceFile(.{ .file = dep.path(g.src ++ "/scanner.c"), .flags = &ts_cflags });
@@ -227,7 +227,7 @@ pub fn uucodeModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: s
}) catch return null).module("uucode");
}
-/// The editor as a library (src/lib_editor.zig, docs/next-editor.md): the
+/// The editor as a library (core/lib_editor.zig, docs/next-editor.md): the
/// text pane's own code built with `lib`, so no pane and no core, over
/// tree-sitter, uucode and mvzr, with pardes-syntax in it as `.syntax`.
/// `library` exports it to a package that asks; hxdiff runs its cases on it.
@@ -243,7 +243,7 @@ pub fn editorModule(b: *std.Build, name: ?[]const u8, target: std.Build.Resolved
const options: std.Build.Module.CreateOptions = .{
.target = target,
.optimize = optimize,
- .root_source_file = b.path("src/lib_editor.zig"),
+ .root_source_file = b.path("core/lib_editor.zig"),
.link_libc = true,
};
const m = if (name) |n| b.addModule(n, options) else b.createModule(options);
@@ -254,7 +254,7 @@ pub fn editorModule(b: *std.Build, name: ?[]const u8, target: std.Build.Resolved
m.addImport("generated_themes", d.themes);
d.ts.wire(m);
m.addImport("mvzr", d.mvzr);
- m.addImport("c_heap", b.createModule(.{ .target = target, .optimize = optimize, .root_source_file = b.path("src/c_heap.zig") }));
+ m.addImport("c_heap", b.createModule(.{ .target = target, .optimize = optimize, .root_source_file = b.path("core/c_heap.zig") }));
m.addImport("vaxis", d.vaxis);
m.addImport("uucode", d.uucode);
return m;
@@ -299,7 +299,7 @@ pub const Parts = struct {
/// Which core: its root and the few ways the products differ.
pub const Core = struct {
/// runtime/main.zig for a shell (runtime/macos.zig for the macOS
- /// library), src/pardes.zig for the core, runtime/root.zig for the
+ /// library), core/root.zig for the core, runtime/root.zig for the
/// runtime, or a core file whose tests run on the core's imports.
root: []const u8,
/// The shell's options (`pardes_config`): this build's, or the window's
@@ -335,7 +335,7 @@ pub const Modules = struct {
/// and link named here and nowhere else.
pub fn module(b: *std.Build, p: Parts, c: Core) Modules {
const in_runtime = std.mem.startsWith(u8, c.root, "runtime/");
- const m = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path(if (in_runtime) "src/pardes.zig" else c.root), .link_libc = true });
+ const m = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path(if (in_runtime) "core/root.zig" else c.root), .link_libc = true });
// forkpty: in libc proper on glibc>=2.34 and darwin; the BSDs keep it in libutil
if (c.util and (p.target.result.os.tag == .freebsd or p.target.result.os.tag == .netbsd or p.target.result.os.tag == .openbsd))
m.linkSystemLibrary("util", .{});
@@ -409,7 +409,7 @@ pub const Assembly = struct {
/// The shell's options (`pardes_config`), and the window's in the bare build.
opts: *std.Build.Step.Options,
gui_opts: ?*std.Build.Step.Options,
- /// What an addon in Zig imports (src/kinds/addon.zig).
+ /// What an addon in Zig imports (abi/addon.zig).
addon_mod: *std.Build.Module,
pdf: addons.Pdf,
image_addon: *std.Build.Step.Compile,
@@ -484,7 +484,7 @@ pub fn assemble(b: *std.Build, c: struct {
const c_heap_mod = b.createModule(.{
.target = target,
.optimize = optimize,
- .root_source_file = b.path("src/c_heap.zig"),
+ .root_source_file = b.path("core/c_heap.zig"),
});
// MuPDF and FreeType, lazy (build.zig's `pdf` option has why).
@@ -499,10 +499,10 @@ pub fn assemble(b: *std.Build, c: struct {
}) catch null else null;
const freetype = if (freetype_dep) |d| d.artifact("freetype") else null;
- // The kinds' C ABI (src/kinds/pardes_addon.h), translated once: the core's
+ // The kinds' C ABI (abi/pardes_addon.h), translated once: the core's
// records are the header's, never a mirror of it.
const kind_mod = b.addTranslateC(.{ .root_source_file = b.path("abi/pardes_addon.h"), .target = target, .optimize = optimize }).createModule();
- // ...and what an addon in Zig imports over it (src/kinds/addon.zig).
+ // ...and what an addon in Zig imports over it (abi/addon.zig).
const addon_mod = b.createModule(.{ .root_source_file = b.path("abi/addon.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "pardes_addon", .module = kind_mod }} });
const pdf_built = addons.pdf(b, .{
.addon_mod = addon_mod,
@@ -551,7 +551,7 @@ pub fn assemble(b: *std.Build, c: struct {
patches.zstbi(b, patch, zstbi_dep, zstbi_mod);
// One zstd (docs/shared-libs.md): a far replica's stream, compressed by
- // its session and read by its client (src/replica.zig). The library's
+ // its session and read by its client (core/replica.zig). The library's
// compressor and decompressor alone, single-threaded and without its
// x86 assembly, each context made with ZSTD_customMem over c_heap; of
// its block compressors only those of levels 3 (dfast) and 6 (lazy),
@@ -588,16 +588,16 @@ pub fn assemble(b: *std.Build, c: struct {
break :zstd lib;
};
- // xitdb keeps what pardes writes to disk (src/Db.zig): pure Zig, no C
+ // xitdb keeps what pardes writes to disk (core/Db.zig): pure Zig, no C
// library and no allocator hook of its own (it takes Zig allocators).
const xitdb_mod = b.dependency("xitdb", .{ .target = target, .optimize = optimize }).module("xitdb");
const image_addon = addons.image(b, target, c_optimize, addon_mod, zstbi_dep);
- // The records the core and the terminal both name (src/plain/plain.zig).
+ // The records the core and the terminal both name (abi/plain.zig).
const plain_mod = b.createModule(.{ .root_source_file = b.path("abi/plain.zig"), .target = target, .optimize = optimize });
- // The terminal, a module of its own (src/term/term.zig): the emulator and
+ // The terminal, a module of its own (core/term/term.zig): the emulator and
// what it brings are its, and every core but core-test's is given it.
- const term_mod = b.createModule(.{ .root_source_file = b.path("src/term/term.zig"), .target = target, .optimize = optimize, .link_libc = true });
+ const term_mod = b.createModule(.{ .root_source_file = b.path("core/term/term.zig"), .target = target, .optimize = optimize, .link_libc = true });
term_mod.addImport("plain", plain_mod);
if (ghostty_vt_for_tests) |x| term_mod.addImport("ghostty-vt", x);
if (wuffs_mod) |x| term_mod.addImport("wuffs", x);