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

capstone: fix pkgconfig file generation #21897

Merged
merged 2 commits into from Jan 14, 2017
Merged

Conversation

joepie91
Copy link
Contributor

Motivation for this change

The generation of pkgconfig .pc files is currently broken, because pkgconfig isn't being passed to the expression as a dependency. This leads to failures when attempting to build other software that relies on capstone through pkgconfig (eg. edb).

This PR fixes that by adding pkgconfig as a dependency. The buildscript picks it up automatically and correctly generates a .pc file (which is correctly picked up by other expressions).

Note that while I've tested this patch locally, I've tested it differently (namely, by copying the expression to a custom repository and modifying it). I see no reason why it wouldn't work as submitted in this PR, but figured I'd make note of this anyway.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@joepie91, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bennofs, @thoughtpolice and @lethalman to be potential reviewers.

@@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
configurePhase = '' patchShebangs make.sh '';
buildPhase = '' ./make.sh '';
installPhase = '' env PREFIX=$out ./make.sh install '';

buildInputs = [
pkgconfig
Copy link
Member

Choose a reason for hiding this comment

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

This should be in nativeBuildInputs:

nativeBuildInputs = [ pkgconfig ];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't say I really fully understand the difference between buildInputs and nativeBuildInputs. Could you elaborate?

Copy link
Member

@Mic92 Mic92 Jan 14, 2017

Choose a reason for hiding this comment

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

This is important for cross-compilation. All build-time dependencies should be specified in nativeBuildInputs.
For example host compiler would be in nativeBuildInputs, while a library linked against the program would be in buildInputs. Pkg-config needs to be run on host, which build the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I see. Thanks for the explanation :)

@zimbatm zimbatm merged commit eedd562 into NixOS:master Jan 14, 2017
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

Successfully merging this pull request may close these issues.

None yet

4 participants