Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add instructions to extend the pkg-config search path to the "Embedding the Nix Evaluator" c api example #10629

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/external-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ $ ./main
Nix version: 2.17
```

You might need to add the directory containing `nix-expr-c.pc` to the
`PKG_CONFIG_PATH` environment variable. For example after [building
Nix](https://github.com/NixOS/nix/blob/master/doc/manual/src/contributing/hacking.md#building-nix-with-flakes)
by executing the following.

```ShellSession
$ export PKG_CONFIG_PATH=$(realpath outputs/out/lib/pkgconfig):$PKG_CONFIG_PATH
```

Comment on lines +85 to +93
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ideally we'd use nix develop --redirect to hook into the things Nixpkgs setup.sh does, but to be fair, so far I've preferred the robustness of just doing a full build on a fast machine.

Copy link
Contributor Author

@prednaz prednaz May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, thanks for the review! but this looks tricky and i do not think i can do this at the moment. so i will split this pull request so the other parts, #10723 and #10725, can already be merged.

# Writing a Nix language plug-in

In this example we add a custom primitive operation (_primop_) to `builtins`. It
Expand Down