Merge branch 'main' into jacob/uucode

This commit is contained in:
Mitchell Hashimoto
2025-09-30 06:52:07 -07:00
committed by GitHub
55 changed files with 2365 additions and 1182 deletions

View File

@@ -498,6 +498,7 @@ pub fn terminalOptions(self: *const Config) TerminalBuildOptions {
.artifact = .ghostty,
.simd = self.simd,
.oniguruma = true,
.c_abi = false,
.slow_runtime_safety = switch (self.optimize) {
.Debug => true,
.ReleaseSafe,

View File

@@ -26,7 +26,7 @@ pub fn initShared(
const target = zig.vt.resolved_target.?;
const lib = b.addSharedLibrary(.{
.name = "ghostty-vt",
.root_module = zig.vt,
.root_module = zig.vt_c,
});
lib.installHeader(
b.path("include/ghostty/vt.h"),

View File

@@ -5,18 +5,17 @@ const GhosttyZig = @This();
const std = @import("std");
const Config = @import("Config.zig");
const SharedDeps = @import("SharedDeps.zig");
const TerminalBuildOptions = @import("../terminal/build_options.zig").Options;
/// The `_c`-suffixed modules are built with the C ABI enabled.
vt: *std.Build.Module,
vt_c: *std.Build.Module,
pub fn init(
b: *std.Build,
cfg: *const Config,
deps: *const SharedDeps,
) !GhosttyZig {
// General build options
const general_options = b.addOptions();
try cfg.addOptions(general_options);
// Terminal module build options
var vt_options = cfg.terminalOptions();
vt_options.artifact = .lib;
@@ -25,7 +24,41 @@ pub fn init(
// conditionally do this.
vt_options.oniguruma = false;
const vt = b.addModule("ghostty-vt", .{
return .{
.vt = try initVt(
"ghostty-vt",
b,
cfg,
deps,
vt_options,
),
.vt_c = try initVt(
"ghostty-vt-c",
b,
cfg,
deps,
options: {
var dup = vt_options;
dup.c_abi = true;
break :options dup;
},
),
};
}
fn initVt(
name: []const u8,
b: *std.Build,
cfg: *const Config,
deps: *const SharedDeps,
vt_options: TerminalBuildOptions,
) !*std.Build.Module {
// General build options
const general_options = b.addOptions();
try cfg.addOptions(general_options);
const vt = b.addModule(name, .{
.root_source_file = b.path("src/lib_vt.zig"),
.target = cfg.target,
.optimize = cfg.optimize,
@@ -45,5 +78,5 @@ pub fn init(
try SharedDeps.addSimd(b, vt, null);
}
return .{ .vt = vt };
return vt;
}

View File

@@ -0,0 +1,33 @@
#--------------------------------------------------------------------
# Generate documentation with Doxygen
#--------------------------------------------------------------------
FROM ubuntu:24.04 AS builder
# Build argument for noindex header
ARG ADD_NOINDEX_HEADER=false
RUN apt-get update && apt-get install -y \
doxygen \
graphviz \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /ghostty
COPY include/ ./include/
COPY Doxyfile ./
RUN mkdir -p zig-out/share/ghostty/doc/libghostty
RUN doxygen
#--------------------------------------------------------------------
# Host the static HTML
#--------------------------------------------------------------------
FROM nginx:alpine AS runtime
# Pass build arg to runtime stage
ARG ADD_NOINDEX_HEADER=false
ENV ADD_NOINDEX_HEADER=$ADD_NOINDEX_HEADER
# Copy documentation and entrypoint script
COPY --from=builder /ghostty/zig-out/share/ghostty/doc/libghostty /usr/share/nginx/html
COPY src/build/docker/lib-c-docs/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 80
CMD ["/entrypoint.sh"]

View File

@@ -0,0 +1,16 @@
#!/bin/sh
if [ "$ADD_NOINDEX_HEADER" = "true" ]; then
cat > /etc/nginx/conf.d/noindex.conf << 'EOF'
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html;
add_header X-Robots-Tag "noindex, nofollow" always;
}
}
EOF
# Remove default server config
rm -f /etc/nginx/conf.d/default.conf
fi
exec nginx -g "daemon off;"