Fix kakoune failing to compile

... and move its definition into overlay
This commit is contained in:
Natsu Kagami 2024-03-01 11:31:23 +01:00
parent 20c30726bb
commit 16f735f25b
Signed by: nki
GPG key ID: 55A032EB38B49ADB
2 changed files with 16 additions and 31 deletions

View file

@ -1,36 +1,6 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
kakounePkg =
pkgs.kakoune.override {
kakoune = with lib; pkgs.stdenv.mkDerivation rec {
pname = "kakoune-unwrapped";
version = "r${builtins.substring 0 6 pkgs.sources.kakoune.rev}";
src = pkgs.sources.kakoune;
makeFlags = [ "debug=no" "PREFIX=${placeholder "out"}" ];
preConfigure = ''
export version="v${version}";
'';
enableParallelBuilding = true;
doInstallCheck = true;
installCheckPhase = ''
$out/bin/kak -ui json -e "kill 0"
'';
postInstall = ''
# make share/kak/autoload a directory
cd "$out/share/kak"
autoload_target=$(readlink autoload)
rm autoload
mkdir autoload
ln -s --relative "$autoload_target" autoload
'';
};
};
kak-lsp = pkgs.libs.crane.buildPackage { kak-lsp = pkgs.libs.crane.buildPackage {
src = pkgs.sources.kak-lsp; src = pkgs.sources.kak-lsp;
buildInputs = (with pkgs; buildInputs = (with pkgs;
@ -201,7 +171,7 @@ in
}; };
}; };
programs.my-kakoune.package = kakounePkg; programs.my-kakoune.package = pkgs.kakoune;
programs.my-kakoune.rc = programs.my-kakoune.rc =
builtins.readFile ./kakrc + '' builtins.readFile ./kakrc + ''

View file

@ -54,6 +54,21 @@ let
}); });
input-remapper = final.unstable.input-remapper; input-remapper = final.unstable.input-remapper;
kakoune-unwrapped =
prev.kakoune-unwrapped.overrideAttrs (attrs: {
version = "r${builtins.substring 0 6 inputs.kakoune.rev}";
src = inputs.kakoune;
patches = [
# patches in the original package was already applied
# https://github.com/mawww/kakoune/pull/5108
(final.fetchpatch {
url = "https://github.com/mawww/kakoune/commit/64b3433905eeb33653ed617d61906ba68c686916.patch";
hash = "sha256-XYA4GcOEuWHsnDhMI0nXbg9Myv2o1UZ8qvzavIXbkJo=";
})
];
});
}; };
overlay-libs = final: prev: { overlay-libs = final: prev: {