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

haskellPackages.mkDerivation: fix pkg-config cross #166781

Merged
merged 1 commit into from
Apr 1, 2022

Conversation

rnhmjoj
Copy link
Contributor

@rnhmjoj rnhmjoj commented Apr 1, 2022

Description of changes

When cross compiling the pkg-config binary is prefixed and cabal
needs to be made aware of this.

Note: the --with-pkg-config flag can't be added unconditionally
because if the package doesn't need pkg-config (thus pkg-config
is not in the PATH) cabal consider this a hard failure.

Things done
  • Tested compilation of some libraries using libraryPkgconfigDepends:
    • pkgsStatic.haskellPackages.alsa-core
    • pkgsStatic.haskellPackages.libffi
    • pkgsStatic.haskellPackages.Xauth
  • Fits CONTRIBUTING.md.

When cross compiling the pkg-config binary is prefixed and cabal
needs to be made aware of this.

Note: the `--with-pkg-config` flag can't be added unconditionally
because if the package doesn't need pkg-config (thus pkg-config
is not in the PATH) cabal consider this a hard failure.
@rnhmjoj rnhmjoj added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Apr 1, 2022
@cdepillabout
Copy link
Member

Will ofborg build anything of these for us?

@ofborg build pkgsStatic.haskellPackages.alsa-core pkgsStatic.haskellPackages.libffi pkgsStatic.haskellPackages.Xauth

@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Apr 1, 2022

@cdepillabout Looks like it did, at least for x86_64-linux.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/statically-linking-haskell-fails-to-link-libffi/18317/7

@rnhmjoj rnhmjoj merged commit 035401f into NixOS:haskell-updates Apr 1, 2022
@rnhmjoj rnhmjoj deleted the haskell-updates branch July 10, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 6.topic: haskell 10.rebuild-darwin: 0 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants