attempt to install dev-scheme/racket-5.2.1 with USE="threads -X -backtrace -cairo -doc -futures -jit -places -plot" fails with "raco setup: error: during making for drracket raco setup: ffi-lib: couldn't open "libcairo.so.2" (libcairo.so.2: cannot open shared object file: No such file or directory)" Reproducible: Always Steps to Reproduce: 1. emerge =dev-scheme/racket-5.2.1 Actual Results: see above Expected Results: installed racket
Created attachment 317994 [details] build log
the problem occurs if no cairo installed
Hi, I've not been brave enough to uninstall cairo, but I've reported your issue upstream.
Quick answer from upstream: Libraries like `racket/draw` and `slideshow/pict` don't need X -- they can produce PDFs or PNGs or other formats, but they do rely on cairo. So maybe my assumptions in the deps have been wrong.
More complete answer from upstream (Matthew Flatt): Cairo is a real dependency for building the Racket documentation as well as for certain libraries. A non-X variant of Cairo works fine for both of those case, naturally. Our "-textual" distribution doesn't need Cairo because the distribution omits both the documentation and various libraries that use Cairo at compile time. There's currently no configuration option for Racket that will build only the non-GUI and/or non-drawing parts. At the same time, building Racket doesn't require that X or Gtk is installed; it's only when you run a program that uses `racket/gui/base' that Racket even looks for GUI libraries. We refrain from using `racket/gui/base' at compile time (i.e., in macros) or to render documentation. Similarly, Cairo isn't needed until you actually run a program that uses `racket/draw'. Unlike `racket/gui/base', though, we sometimes use `racket/draw' in compile-time code or when rendering documentation.
So from that I conclude that it should indeed be possible to build without cairo if X, doc and possibly other use flags are disabled. Unfortunately that is in contradiction with Permjacov's reported behavior in Comment 1, where only the threads use flag is on, but somehow drracket is getting built.
> Hi, I've not been brave enough to uninstall cairo, but I've reported your > issue upstream. Hi. Everything requiring testing installation works perfectly in chrooted environment, and it is surprisingly easy to setups lxc/virtualbox in gentoo. So, I cannot see problem here. I currently dropped my installation of gentoo for some reasons, So I cannot return to this bug for a while, but I'm still interested in its solution, as when I'll install gentoo for my dev/learn needs it will be headless install anyway.
Okay, I'm here again and ready to test your solution.
After reviewing the response from upstream again I think I must conclude that upstream feels free to rely on racket/draw when building (definitely for documentation rendering, but evidently also for some unknown other things). Thus the only way to remove the build failure for now is to unconditionally require cairo as a build-time dep. If this is unacceptable to you then you could try to work out another solution with upstream or separately package their textual distribution and see if that works. I think I have previously been told though that disabling X when building would result in the same thing as using the textual distribution upstream provides. That may or may not be true, intentionally or not.
I've committed thse new deps in racket-5.3.4: RDEPEND="dev-db/sqlite:3 x11-libs/cairo[X?] virtual/libffi" DEPEND="${RDEPEND} x11-libs/cairo !dev-tex/slatex"