ada-mode includes extra binaries which are used by it at runtime. They
require gnat, gprbuild, gnatcoll-core and wisi's source checked out in
`../wisi-*`.
gnatcoll-sql: init at 21.0.0
gnatcoll-sqlite: init at 21.0.0
gnatcoll-xref: init at 21.0.0
gnatcoll-postgres: init at 21.0.0
gnatcoll-db2ada: init at 21.0.0
gnatinspect: init at 21.0.0
Ada database interaction libraries and related tools which are managed
in the gnatcoll-db repository. The attribute and derivation names
don't include "db" since the GPR project files upstream also don't:
They are named `gnatcoll_${component}.gpr` usually, except for the
executables.
gnatcoll-gmp: init at 21.0.0
gnatcoll-iconv: init at 21.0.0
gnatcoll-lzma: init at 21.0.0
gnatcoll-omp: init at 21.0.0
gnatcoll-python3: init at 21.0.0
gnatcoll-readline: init at 21.0.0
gnatcoll-syslog: init at 21.0.0
gnatcoll-zlib: init at 21.0.0
This inits a bunch of gnatcoll-* packages which are managed in the
gnatcoll-bindings repository. I have chosen not to include "bindings"
in their derivation or attribute names, since the GPR project
definitions themselves all don't contain that as well, instead they
are name `gnatcoll_${component}.gpr`.
GPRbuild is a multi language build system developed by AdaCore which
is mostly used for build Ada-related projects using GNAT.
Since GPRbuild is used to build itself and its dependency library
XML/Ada we first build a bootstrap version of it using the provided
bash build script bootstrap.sh as the gprbuild-boot derivation.
gprbuild-boot is then used to build xmlada and the proper gprbuild
derivation.
GPRbuild has its own search path mechanism via GPR_PROJECT_PATH which
we address via a setupHook. It currently works quite similar to the
pkg-config one: It accumulates all inputs into GPR_PROJECT_PATH,
GPR_PROJECT_PATH_FOR_BUILD etc. However this is quite limited at the
moment as we don't have a gprbuild wrapper yet which understands the
_FOR_BUILD suffix. However, we'll need to address this in the future
as it is currently basically impossible to test since the distinction
only affects cross-compilation, but it is not possible to build a GNAT
cross-compiler in nixpkgs at the moment (I'm working on changing that,
however).
Another issue we had to solve was GPRbuild not finding the right GNAT
via its gprconfig tool: GPRbuild has a knowledge base with compiler
definitions which run some checks and collect info about binaries
which are in PATH. In the end the first compiler in PATH that supports
the desired language is selected.
We want GPRbuild to discover our wrapped GNAT since the unwrapped one
is incapable of producing working binaries since it won't find the
crt*.o objects distributed with libc. GPRbuild however needs to find
the Ada runtime distributed with GNAT which is not part of the wrapper
derivation, so it will skip the wrapper and select the unwrapped GNAT.
Symlinking the unwrapped's lib directory into the wrapper fixes this
problem, but breaks linking in some cases (e. g. when linking against
OMP from gcc, the runtime variant will shadow the problem dynamic lib
from buildInputs). Additionally it uses gnatls as an indicator it has
found GNAT which is not part of the wrapper.
The solution we opted to adopt here is to install a custom compiler
description into gprbuild's knowledge base which properly detects the
nixpkgs GNAT wrapper: It uses gnatmake to detect GNAT instead of
gnatls and discovers the runtime via a symlink we add to
`$out/nix-support`. This additional definition is enough to properly
detect GNAT, since the plain wrapped gcc detection works out of the
box. It may, however, be necessary to add special definitions for
other languages in the future where gprbuild also needs to discover
the runtime.
One future improvement would be to install libgpr into a separate
output or split it into a separate derivation (which would require to
link gprbuild statically always since otherwise we end up with a
cyclical dependency).
Having pkgsLLVM.stdenv built with nixpkgs:trunk will make building
anything in pkgsLLVM decidedly less painful since it will eliminate
the need to build LLVM and clang locally, which shouldn't be as bad
on hydra.
Darwin is disabled for now since it doesn't evaluate correctly there
(infinite recursion problem with the SDK).
All libcanberra/libcanberra-gtk2/libcanberra-gtk3 packages were marked
as broken on commit 806d814516 (libcanberra: mark broken on darwin,
2021-02-11), but only libcanberra-gtk3 is broken due to the missing
header.
This commit refactors how to enable GTK support, to mark just
libcanberra-gtk3 as broken and allow building libcanberra and
libcanberra-gtk2.
libcanberra builds but the linker fails with:
ld: file not found: /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon for architecture x86_64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
Adding Carbon to the inputs solves the problem.
libcanberra-gtk2 builds and the linker finishes without the above error,
most likely because it depends on gtk2 and gtk2 depends on Cocoa.
Also fix some issues with the derivation:
- Use pname/version instead of name.
- Use lib.optionalString to set postPatch.
- Only set passthru if building with GTK support, and ensure that the
proper directory is passed for each GTK version.
Additional changes:
1. Qt is now needed for both the cli and gui variants.
2. Run the test suite
3. Drop a number of dependencies that are no longer needed
4. We have nlohmann_json and pugixml, so use those instead of the
vendored versions
5. Add support for reading chapters from DVDs
6. Build with rake as recommended by upstream