nixpkgs/pkgs/applications/editors/kakoune/default.nix
2021-08-29 22:36:44 +02:00

52 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, asciidoc, docbook_xsl, libxslt, pkg-config }:
with lib;
stdenv.mkDerivation rec {
pname = "kakoune-unwrapped";
version = "2021.08.28";
src = fetchFromGitHub {
repo = "kakoune";
owner = "mawww";
rev = "v${version}";
sha256 = "13kc68vkrzg89khir6ayyxgbnmz16dhippcnw09hhzxivf5ayzpy";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ asciidoc docbook_xsl libxslt ];
makeFlags = [ "debug=no" ];
postPatch = ''
export PREFIX=$out
cd src
sed -ie 's#--no-xmllint#--no-xmllint --xsltproc-opts="--nonet"#g' Makefile
'';
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, so we can use symlinkJoin with plugins
cd "$out/share/kak"
autoload_target=$(readlink autoload)
rm autoload
mkdir autoload
ln -s --relative "$autoload_target" autoload
'';
meta = {
homepage = "http://kakoune.org/";
description = "A vim inspired text editor";
license = licenses.publicDomain;
maintainers = with maintainers; [ vrthra ];
platforms = platforms.unix;
};
}