aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/pkg/android-ndk
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 21:51:57 +0300
committerGitHub <noreply@github.com>2026-09-10 21:51:57 +0300
commit425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch)
treee52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/pkg/android-ndk
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/pkg/android-ndk')
-rw-r--r--vendor/libghostty-vt/pkg/android-ndk/build.zig22
1 files changed, 10 insertions, 12 deletions
diff --git a/vendor/libghostty-vt/pkg/android-ndk/build.zig b/vendor/libghostty-vt/pkg/android-ndk/build.zig
index 5b005665..10501700 100644
--- a/vendor/libghostty-vt/pkg/android-ndk/build.zig
+++ b/vendor/libghostty-vt/pkg/android-ndk/build.zig
@@ -118,16 +118,16 @@ pub fn addPaths(b: *std.Build, step: *std.Build.Step.Compile) !void {
fn findNDKPath(b: *std.Build) ?[]const u8 {
// Check if user has set the environment variable for the NDK path.
- if (std.process.getEnvVarOwned(b.allocator, "ANDROID_NDK_HOME") catch null) |value| {
+ if (b.graph.environ_map.get("ANDROID_NDK_HOME")) |value| {
if (value.len == 0) return null;
- var dir = std.fs.openDirAbsolute(value, .{}) catch return null;
- defer dir.close();
+ var dir = std.Io.Dir.openDirAbsolute(b.graph.io, value, .{}) catch return null;
+ defer dir.close(b.graph.io);
return value;
}
// Check the common environment variables for the Android SDK path and look for the NDK inside it.
inline for (.{ "ANDROID_HOME", "ANDROID_SDK_ROOT" }) |env| {
- if (std.process.getEnvVarOwned(b.allocator, env) catch null) |sdk| {
+ if (b.graph.environ_map.get(env)) |sdk| {
if (sdk.len > 0) {
if (findLatestNDK(b, sdk)) |ndk| return ndk;
}
@@ -135,18 +135,16 @@ fn findNDKPath(b: *std.Build) ?[]const u8 {
}
// As a fallback, we assume the most common/default SDK path based on the OS.
- const home = std.process.getEnvVarOwned(
- b.allocator,
+ const home = b.graph.environ_map.get(
if (builtin.os.tag == .windows) "LOCALAPPDATA" else "HOME",
- ) catch return null;
+ ) orelse return null;
const default_sdk_path = b.pathJoin(
&.{
home,
switch (builtin.os.tag) {
- .linux => "Android/sdk",
+ .linux, .windows => "Android/Sdk",
.macos => "Library/Android/Sdk",
- .windows => "Android/Sdk",
else => return null,
},
},
@@ -157,8 +155,8 @@ fn findNDKPath(b: *std.Build) ?[]const u8 {
fn findLatestNDK(b: *std.Build, sdk_path: []const u8) ?[]const u8 {
const ndk_dir = b.pathJoin(&.{ sdk_path, "ndk" });
- var dir = std.fs.openDirAbsolute(ndk_dir, .{ .iterate = true }) catch return null;
- defer dir.close();
+ var dir = std.Io.Dir.openDirAbsolute(b.graph.io, ndk_dir, .{ .iterate = true }) catch return null;
+ defer dir.close(b.graph.io);
var latest_: ?struct {
name: []const u8,
@@ -166,7 +164,7 @@ fn findLatestNDK(b: *std.Build, sdk_path: []const u8) ?[]const u8 {
} = null;
var iterator = dir.iterate();
- while (iterator.next() catch null) |file| {
+ while (iterator.next(b.graph.io) catch null) |file| {
if (file.kind != .directory) continue;
const version = std.SemanticVersion.parse(file.name) catch continue;
if (latest_) |latest| {