emacsPackages.ada-mode: build tools needed at runtime

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-*`.
This commit is contained in:
sternenseemann 2021-07-22 14:47:01 +02:00 committed by sterni
parent 9bc1e429d0
commit 66f8529d91
2 changed files with 33 additions and 2 deletions

View file

@ -21,7 +21,7 @@ formats commits for you.
*/
{ lib, stdenv, texinfo, writeText, gcc }:
{ lib, stdenv, texinfo, writeText, gcc, pkgs, buildPackages }:
self: let
@ -57,6 +57,37 @@ self: let
project = if lib.versionAtLeast self.emacs.version "28"
then null
else super.project;
# Compilation instructions for the Ada executables:
# https://www.nongnu.org/ada-mode/ada-mode.html#Ada-executables
ada-mode = super.ada-mode.overrideAttrs (old: {
# actually unpack source of ada-mode and wisi
# which are both needed to compile the tools
# we need at runtime
phases = "unpackPhase " + old.phases; # not a list, interestingly…
srcs = [
super.ada-mode.src
self.wisi.src
];
sourceRoot = "ada-mode-${self.ada-mode.version}";
nativeBuildInputs = [
buildPackages.gnat
buildPackages.gprbuild
];
buildInputs = [
pkgs.gnatcoll-xref
];
preInstall = ''
./build.sh
'';
postInstall = ''
./install.sh --prefix=$out
'';
});
};
elpaPackages = super // overrides;

View file

@ -26,7 +26,7 @@
let
mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-packages.nix {
inherit (pkgs) stdenv texinfo writeText gcc;
inherit (pkgs) stdenv texinfo writeText gcc pkgs buildPackages;
inherit lib;
};