Skip to content

Commit

Permalink
feat: simpler build (#59)
Browse files Browse the repository at this point in the history
* improve: build

* readme: remove prefix

* fix: gh actions prefix
  • Loading branch information
freref authored Feb 26, 2025
1 parent e4cba52 commit ea12b35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -94,7 +94,7 @@ mv zig-out/bin/fancy-cat /usr/local/bin/
### Run

```sh
zig build -Dprefix=$HOME/.local run -- <path-to-pdf> <optional-page-number>
zig build run -- <path-to-pdf> <optional-page-number>
```

## Features
Expand Down
5 changes: 3 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ea12b35

Please sign in to comment.