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
writeC: fix finding of libraries #56203
Conversation
Shouldn't these use stdenv? Not everything uses pkg-config and that's why we have an elaborate system of setup-hooks to handle these. I am still a little skeptical that these belong in all-packages.nix. They aren't packages and they also aren't used by any other packages in all-packages.nix. That's not to say that they aren't useful, just out of scope for Nixpkgs. Can't they go in a separate repo? |
I don't really know how to use stdenv in this case, would be very happy for an example. apart from that, I'm not obliged to let these stay inside of nixpkgs, but the nix lib functions and nixos are also part of the nixpkgs repository. I'm not really sure where the differentiation of "part of nixpkgs" should be made. For now, I want people to use it inside a |
cc @lheckemann |
We expose everything from |
"$(pkgs.pkgconfig}/bin/pkg-config --cflags --libs ${ | ||
concatMapStringsSep " " (lib: escapeShellArg (builtins.parseDrvName lib.name).name) (libraries) | ||
"$(pkg-config --cflags --libs ${ | ||
concatMapStringsSep " " (pkg: "$(find ${escapeShellArg pkg}/lib/pkgsconfig -name \*.pc -exec basename {} \;)") libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be pkgconfig
instead of pkgsconfig
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh, @Lassulus, did you even test it? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I did, but seems I made some mistake :/
Nevertheless, it would be very cool, if we had automated tests for writeC with libraries. Since I'm a C noob, I couldn't come up with a trivial example for a C program with a library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use this one for testing: https://wiki.archlinux.org/index.php/Desktop_notifications#C
Only needs glib
in buildInputs.
Motivation for this change
fix external libraries support in writers.writeC.
Sadly the tests are missing, since I don't know how to write a c program with an external library. help would be very appreciated.