Compare commits
No commits in common. "43dad638f20280184dd14eb6b968a0177f0a6b27" and "6b2ce7e4250719ac4b15158ec289bd3fcf645fb5" have entirely different histories.
43dad638f2
...
6b2ce7e425
3 changed files with 14 additions and 18 deletions
|
@ -12,8 +12,8 @@ fn setupLinks(step: *builds.LibExeObjStep) void {
|
|||
step.linkSystemLibrary("GraphicsMagickWand");
|
||||
step.linkSystemLibrary("GraphicsMagick");
|
||||
|
||||
step.addIncludePath("/usr/include/GraphicsMagick");
|
||||
step.addIncludePath("/usr/include");
|
||||
step.addIncludeDir("/usr/include/GraphicsMagick");
|
||||
step.addIncludeDir("/usr/include");
|
||||
|
||||
const possible_lilv_include_dirs = [_][]const u8{
|
||||
"/usr/include/lilv-0/lilv",
|
||||
|
@ -24,7 +24,7 @@ fn setupLinks(step: *builds.LibExeObjStep) void {
|
|||
|
||||
for (possible_lilv_include_dirs) |possible_lilv_dir| {
|
||||
var possible_dir = std.fs.cwd().openDir(possible_lilv_dir, .{}) catch |err| {
|
||||
std.debug.print("possible lilv {s} fail: {s}\n", .{ possible_lilv_dir, @errorName(err) });
|
||||
std.debug.print("possible lilv {s} fail: {s}\n", .{ possible_lilv_dir, err });
|
||||
continue;
|
||||
};
|
||||
|
||||
|
@ -32,7 +32,7 @@ fn setupLinks(step: *builds.LibExeObjStep) void {
|
|||
found_any_lilv = true;
|
||||
|
||||
std.debug.print("found lilv at '{s}'\n", .{possible_lilv_dir});
|
||||
step.addIncludePath(possible_lilv_dir);
|
||||
step.addIncludeDir(possible_lilv_dir);
|
||||
}
|
||||
|
||||
if (!found_any_lilv) {
|
||||
|
@ -45,7 +45,6 @@ pub fn build(b: *Builder) void {
|
|||
const mode = b.standardReleaseOptions();
|
||||
const exe = b.addExecutable("scritcher", "src/main.zig");
|
||||
exe.setBuildMode(mode);
|
||||
exe.use_stage1 = true;
|
||||
exe.install();
|
||||
|
||||
setupLinks(exe);
|
||||
|
|
12
src/lang.zig
12
src/lang.zig
|
@ -94,7 +94,7 @@ pub const Command = struct {
|
|||
rotate,
|
||||
};
|
||||
|
||||
pub fn tagToType(comptime tag: Tag) type {
|
||||
pub fn tagToType(tag: Tag) type {
|
||||
return switch (tag) {
|
||||
.noop => Noop,
|
||||
.load => Load,
|
||||
|
@ -147,7 +147,7 @@ pub const Command = struct {
|
|||
}
|
||||
|
||||
pub fn print(base: *const @This()) void {
|
||||
log.debug("tag: {}\n", .{base.tag});
|
||||
log.debug("tag: {s}\n", .{base.tag});
|
||||
}
|
||||
|
||||
pub const Noop = struct {
|
||||
|
@ -529,9 +529,9 @@ pub const Lang = struct {
|
|||
}
|
||||
|
||||
fn doError(self: *Lang, comptime fmt: []const u8, args: anytype) void {
|
||||
log.warn("ERROR! at line {}: ", .{self.line});
|
||||
log.warn(fmt, args);
|
||||
log.warn("\n", .{});
|
||||
log.err("ERROR! at line {}: ", .{self.line});
|
||||
log.err(fmt, args);
|
||||
log.err("\n", .{});
|
||||
self.has_error = true;
|
||||
}
|
||||
|
||||
|
@ -622,7 +622,7 @@ pub const Lang = struct {
|
|||
|
||||
cmd.base.tag = command_struct.base_tag;
|
||||
const command = cmd.base.cast(command_struct).?;
|
||||
log.debug("cmd: {}\n", .{command});
|
||||
log.debug("cmd: {s}\n", .{command});
|
||||
}
|
||||
|
||||
pub fn parse(self: *Lang, data: []const u8) !CommandList {
|
||||
|
|
|
@ -57,7 +57,6 @@ pub const Runner = struct {
|
|||
}
|
||||
|
||||
fn resolveArg(self: *Runner, load_path: []const u8) ![]const u8 {
|
||||
std.debug.assert(load_path.len > 0);
|
||||
if (load_path[0] == ':') {
|
||||
// parse the index from 1 to end
|
||||
var index = try std.fmt.parseInt(usize, load_path[1..], 10);
|
||||
|
@ -132,7 +131,7 @@ pub const Runner = struct {
|
|||
const basename = std.fs.path.basename(image.path);
|
||||
const dirname = std.fs.path.dirname(image.path).?;
|
||||
|
||||
var dir = try std.fs.cwd().openIterableDir(dirname, .{});
|
||||
var dir = try std.fs.cwd().openDir(dirname, .{ .iterate = true });
|
||||
defer dir.close();
|
||||
|
||||
const period_idx = std.mem.lastIndexOf(u8, basename, ".").?;
|
||||
|
@ -200,11 +199,11 @@ pub const Runner = struct {
|
|||
defer self.allocator.free(out_path);
|
||||
try image.saveTo(out_path);
|
||||
|
||||
var proc = std.ChildProcess.init(
|
||||
var proc = try std.ChildProcess.init(
|
||||
&[_][]const u8{ runqs.program, out_path },
|
||||
self.allocator,
|
||||
);
|
||||
//defer proc.deinit();
|
||||
defer proc.deinit();
|
||||
|
||||
log.debug("running '{s} {s}'\n", .{ runqs.program, out_path });
|
||||
_ = try proc.spawnAndWait();
|
||||
|
@ -332,9 +331,7 @@ test "running noop" {
|
|||
defer cmds.deinit();
|
||||
|
||||
var command = lang.Command{ .tag = .noop };
|
||||
|
||||
var noop = try allocator.create(lang.Command.Noop);
|
||||
noop.* = lang.Command.Noop{ .base = command };
|
||||
var noop = lang.Command.Noop{ .base = command };
|
||||
try cmds.append(&noop.base);
|
||||
|
||||
var runner = Runner.init(allocator, false);
|
||||
|
|
Loading…
Reference in a new issue