From 598ae49a4bb4f41d0031ab0c1df392259c5834ec Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Sun, 1 Sep 2024 23:41:24 +1000 Subject: [PATCH] Explicitly create autoloads file for trivialBuild nixpkgs noticed the autoloads file they were writing is not normally loaded (see commit 84c2e0096d0c365e3f2a81ad8533c5b8910e7a73 there). We load (include in our Doom profile) these explicitly (see commit fa6fe4cf937e25dfcf1a44bd4d69ecbca280a85f). So reinstate autoload generation. On older nixpkgs, this generates autoloads twice, which should not be an issue (for the 4 trivialBuild packages we have). --- elisp-packages.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/elisp-packages.nix b/elisp-packages.nix index 2eaa346..24c3804 100644 --- a/elisp-packages.nix +++ b/elisp-packages.nix @@ -95,6 +95,11 @@ }; packageRequires = [ eself.org ]; sourceRoot = "source/lisp"; + # Generate an autoload file picked up by generate-nix-autoloads in build-profile. + # nixpkgs used to do this for us, but stopped because it wasn't loading that file... + postInstall = '' + emacs --batch -l package --eval "(package-generate-autoloads \"org-contrib\" \"$LISPDIR\")" + ''; }; sln-mode = esuper.trivialBuild { pname = "sln-mode"; @@ -105,6 +110,10 @@ # Straight uses a recipe from el-get that specifiecs the font-lock-ext # dependency. buildInputs = [ eself.font-lock-ext ]; + # Generate autoloads (see org-contrib for details) + postInstall = '' + emacs --batch -l package --eval "(package-generate-autoloads \"sln-mode\" \"$LISPDIR\")" + ''; }; # Straight checks for git's presence at import time. # We could probably get by with feeding it /bin/true or similar, @@ -124,6 +133,10 @@ sourceRoot=$filteredSrc ''; nativeBuildInputs = [ git ]; + # Generate autoloads (see org-contrib for details) + postInstall = '' + emacs --batch -l package --eval "(package-generate-autoloads \"straight\" \"$LISPDIR\")" + ''; }; # Nix uses a Melpa recipe that assumes the upstream CMake repo layout. # Doom uses emacsmirror and sets :files (:defaults "*"). @@ -133,6 +146,10 @@ meta = { description = "build cmake-mode from emacsmirror for Doom"; }; + # Generate autoloads (see org-contrib for details) + postInstall = '' + emacs --batch -l package --eval "(package-generate-autoloads \"cmake-mode\" \"$LISPDIR\")" + ''; }; # Doom uses a recipe with :files (:defaults "*"), which MELPA's package-build # rejects because it includes dotfiles