about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix')
-rw-r--r--nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix48
1 files changed, 46 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix b/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix
index 69db13fec19e..495a3cbfd0f5 100644
--- a/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix
+++ b/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix
@@ -21,7 +21,7 @@ formats commits for you.
 
 */
 
-{ lib, stdenv, texinfo, writeText, gcc }:
+{ lib, stdenv, texinfo, writeText, gcc, pkgs, buildPackages }:
 
 self: let
 
@@ -41,7 +41,10 @@ self: let
   }: let
 
     imported = import generated {
-      inherit (self) callPackage;
+      callPackage = pkgs: args: self.callPackage pkgs (args // {
+        # Use custom elpa url fetcher with fallback/uncompress
+        fetchurl = buildPackages.callPackage ./fetchelpa.nix { };
+      });
     };
 
     super = removeAttrs imported [ "dash" ];
@@ -57,6 +60,47 @@ 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
+        dontUnpack = false;
+        srcs = [
+          super.ada-mode.src
+          # ada-mode needs a specific version of wisi, check NEWS or ada-mode's
+          # package-requires to find the version to use.
+          (pkgs.fetchurl {
+            url = "https://elpa.gnu.org/packages/wisi-3.1.3.tar.lz";
+            sha256 = "18dwcc0crds7aw466vslqicidlzamf8avn59gqi2g7y2x9k5q0as";
+          })
+        ];
+
+        sourceRoot = "ada-mode-${self.ada-mode.version}";
+
+        nativeBuildInputs = [
+          buildPackages.gnat
+          buildPackages.gprbuild
+          buildPackages.lzip
+        ];
+
+        buildInputs = [
+          pkgs.gnatcoll-xref
+        ];
+
+        preInstall = ''
+          ./build.sh -j$NIX_BUILD_CORES
+        '';
+
+        postInstall = ''
+          ./install.sh --prefix=$out
+        '';
+
+        meta = old.meta // {
+          maintainers = [ lib.maintainers.sternenseemann ];
+        };
+      });
     };
 
     elpaPackages = super // overrides;