Open hannesweisbach opened 4 years ago
My question now is, how do I fix or work around this? IIRC, nix uses an RPATH to CoreFoundation to be able to switch between pure and impure versions without recompilation? Correct me, if I'm wrong.
Never heard of this. Also, changing RPATH is often done via recompilation anyway. I think, changing fontconfig
to refer to CoreFoundation by an absolute path would be fine thing to do.
I assume I fix this by putting CoreFoundation
as in buildInputs
, right?
Easy enough for fontconfig
, but what about gettext
and curl
? Those are the offending libs I see right now.
Sorry, wrong button 🤦🏼♂️
@hannesweisbach
It might be easier to just not require bundle to be standalone. Reading the cmake documentation [1], it seems like all you would need to do for this is to somehow disable calls to fixup_bundle()
in kicad
. In principle, you should be able to build standalone bundle, but that might require some extra tuning to make it work.
[1] https://cmake.org/cmake/help/latest/module/BundleUtilities.html
Never heard of this. Also, changing RPATH is often done via recompilation anyway.
I read it on some thread on the NixOS discourse.
I think, changing
fontconfig
to refer to CoreFoundation by an absolute path would be fine thing to do.
I fixed fontconfig by adding CoreFoundation to buildInputs in #98379
It might be easier to just not require bundle to be standalone.
I've created (what do you call them? "pure"?) version of gettext & curl without RPATH references to use for me locally.
I'll work on patching out the calls to fixup_bundle
and see of the resulting package contains working executables.
While doing this I looked for libraries in my /nix/store with non-absolute RPATH references to CoreFoundation. Should I be fixing those (assuming they are not bootstrap-packages, like curl
and gettext
)?
I marked this as stale due to inactivity. → More info
I marked this as stale due to inactivity. → More info
Describe the bug
I am trying to make KiCad build under macOS + nix. My last hurdle is that the CMake scripts of KiCad want to create an app bundle during the install phase. This currently fails, because during verification of the created app bundle CMake encounters the non-absolute RPATH to CoreFoundation
@rpath/CoreFoundation.framework/Versions/A/CoreFoundation
in the dependencies of the executables in the app bundle. Because an app bundle is supposed to be self-contained and CMake does not recognize the reference as one to a system library, verification of the bundle, and hence the install step, fails.For example,
eeschema
depends oncairo
, which in turn depends onfontconfig
:libfontconfig in turn has an RPATH set:
libcontconfig gets copied into app bundle as dependency. CMake notices this:
warning: unexpected reference to '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation'
And finally, the verification step of the Bundle creation fails:
My question now is, how do I fix or work around this? IIRC, nix uses an RPATH to CoreFoundation to be able to switch between pure and impure versions without recompilation? Correct me, if I'm wrong.
If I hack around this, i.e. make CMake think RPATHs are system libraries and don't need to be copied, the resulting app bundle works for me. So this is basically the last step to have KiCad build on Darwin. Maybe someone can give me hint.
I tried to search for how to build app bundle via CMake under Nix, but Github only let's me search open issues. Whenever I search for closed issues I get the Github unicorn and it tells me generation of the page has timed out :(
To Reproduce Steps to reproduce the behavior:
nix-shell --pure
Expected behavior
Create a working app bundle.
Screenshots
Full install log (CMake verbose enabled) https://gist.github.com/hannesweisbach/f9c81f08e298f99bb6e55f76d7f40897
Notify maintainers
@evils @Kiwi @berce
Metadata
Maintainer information: