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

Idea: declare pkg-config dependencies but only override Nixpkgs-style package names #15

Open
roberth opened this issue Jan 25, 2023 · 2 comments

Comments

@roberth
Copy link
Contributor

roberth commented Jan 25, 2023

Context

If we have a (json) mapping from pkg-config names to package attribute names, a module could easily add the appropriate deps, without sacrificing the consistency with Nixpkgs-style names when it comes to overriding.
Without a special integration for the mapping, it'd be hard to override things, because pkg-config names ("modules") don't map 1:1 to package attribute names; not even in quantity. For example, to override nix in a program that links it, you'd have to override all of nix-expr, nix-store, nix-main, and make sure not to miss a module if it grows a new one (it has). This is problem is hard to detect. hidapi has different pkg-config names depending on the platform.

@blaggacao
Copy link

blaggacao commented Feb 1, 2023

What's the potential relationship of the map? 1:n? n:1?!?

@roberth
Copy link
Contributor Author

roberth commented Feb 1, 2023

In reality, any number of package attributes can provide any number of pkg-config modules, but usually a default choice will suffice, which is why defaultPkgConfigPackages exists, and why the format only supports a single package attribute per pkg-config module for the initial edition of the json.
The json can be extended with more fields and more complete information, and probably should, but I suggest to take one step at a time. The new or extended schema could be designed bottom up (NixOS/nixpkgs#212290) but should take into account the package generation needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants