From ea12b35335a00efc4bbd6dad001f8d58f3af0157 Mon Sep 17 00:00:00 2001 From: freref <35976402+freref@users.noreply.github.com> Date: Thu, 27 Feb 2025 00:30:24 +0100 Subject: [PATCH] feat: simpler build (#59) * improve: build * readme: remove prefix * fix: gh actions prefix --- .github/workflows/test.yml | 2 +- README.md | 6 +++--- build.zig | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0120f8..5e01653 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: with: version: 0.13.0 - - run: zig build -Dprefix=$HOME/.local + - run: zig build lint: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 821e867..362d70c 100644 --- a/README.md +++ b/README.md @@ -70,14 +70,14 @@ zig build --fetch 3. Build the project: ```sh -zig build -Dprefix=$HOME/.local --release=small +zig build --release=small ``` > [!NOTE] > There is a [known issue](https://github.com/freref/fancy-cat/issues/18) with some processors; if the build fails on step 7/10 with the error `LLVM ERROR: Do not know how to expand the result of this operator!` then try the command below instead: > > ```sh -> zig build -Dprefix=$HOME/.local -Dcpu="skylake" --release=small +> zig build -Dcpu="skylake" --release=small > ``` 4. Install: @@ -94,7 +94,7 @@ mv zig-out/bin/fancy-cat /usr/local/bin/ ### Run ```sh -zig build -Dprefix=$HOME/.local run -- +zig build run -- ``` ## Features diff --git a/build.zig b/build.zig index 9da068a..84d13a9 100755 --- a/build.zig +++ b/build.zig @@ -14,7 +14,8 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); - const prefix = b.option([]const u8, "prefix", "Installation prefix") orelse "./local"; + const prefix = "./local"; + const location = "./deps/mupdf/local"; var make_args = std.ArrayList([]const u8).init(b.allocator); defer make_args.deinit(); @@ -60,7 +61,7 @@ pub fn build(b: *std.Build) void { exe.step.dependOn(&mupdf_build_step.step); - addMupdfDeps(exe, b, prefix); + addMupdfDeps(exe, b, location); b.installArtifact(exe); b.getInstallStep().dependOn(&mupdf_build_step.step);