Skip to content

haskellPackages.mkDerivation: fix pkg-config cross#166781

Merged
rnhmjoj merged 1 commit intoNixOS:haskell-updatesfrom
rnhmjoj:haskell-updates
Apr 1, 2022
Merged

haskellPackages.mkDerivation: fix pkg-config cross#166781
rnhmjoj merged 1 commit intoNixOS:haskell-updatesfrom
rnhmjoj:haskell-updates

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.
@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Apr 1, 2022
@rnhmjoj rnhmjoj added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Apr 1, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels 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 platform than they will be used on 6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants