12 gprConfigKbSrc = fetchFromGitHub {
13 name = "gprconfig-kb-${version}-src";
15 repo = "gprconfig_kb";
17 sha256 = "1vnjv2q63l8nq2w4wya75m40isvs78j5ss9b5ga3zx3cpdx3xh09";
22 pname = "gprbuild-boot";
25 src = fetchFromGitHub {
26 name = "gprbuild-${version}";
30 sha256 = "096a43453z2xknn6x4hyk2ldp2wh0qhfdfmzsrks50zqcvmkq4v7";
39 # The Makefile uses gprbuild to build gprbuild which
40 # we can't do at this point, delete it to prevent the
41 # default phases from failing.
44 # make sure bootstrap script runs
45 patchShebangs --build bootstrap.sh
48 # This setupHook populates GPR_PROJECT_PATH which is used by
49 # gprbuild to find dependencies. It works quite similar to
50 # the pkg-config setupHook in the sense that it also splits
51 # dependencies into GPR_PROJECT_PATH and GPR_PROJECT_PATH_FOR_BUILD,
52 # but gprbuild itself doesn't support this, so we'll need to
53 # introducing a wrapper for it in the future remains TODO.
54 # For the moment this doesn't matter since we have no situation
55 # were gprbuild is used to build something used at build time.
57 ./gpr-project-path-hook.sh
58 ] ++ lib.optionals stdenv.targetPlatform.isDarwin [
59 # This setupHook replaces the paths of shared libraries starting
60 # with @rpath with the absolute paths on Darwin, so that the
61 # binaries can be run without additional setup.
62 ./gpr-project-darwin-rpath-hook.sh
69 --with-xmlada=${xmlada.src} \
70 --with-kb=${gprConfigKbSrc} \
73 # Install custom compiler description which can detect nixpkgs'
74 # GNAT wrapper as a proper Ada compiler. The default compiler
75 # description expects the runtime library to be installed in
76 # the same prefix which isn't the case for nixpkgs. As a
77 # result, it would detect the unwrapped GNAT as a proper
78 # compiler which is unable to produce working binaries.
80 # Our compiler description is very similar to the upstream
81 # GNAT description except that we use a symlink in $out/nix-support
82 # created by the cc-wrapper to find the associated runtime
83 # libraries and use gnatmake instead of gnatls to find GNAT's
85 install -m644 ${./nixpkgs-gnat.xml} $out/share/gprconfig/nixpkgs-gnat.xml
91 description = "Multi-language extensible build tool";
92 homepage = "https://github.com/AdaCore/gprbuild";
93 license = licenses.gpl3Plus;
94 maintainers = [ maintainers.sternenseemann ];
95 platforms = platforms.all;