Merge pull request #113762 from lourkeur/fix_110407

spacevim: fix #110407
This commit is contained in:
Anderson Torres 2021-02-20 17:38:52 -03:00 committed by GitHub
commit 85e08ba0f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
{ ripgrep, git, fzf, makeWrapper, vim_configurable, vimPlugins, fetchFromGitHub { ripgrep, git, fzf, makeWrapper, vim_configurable, vimPlugins, fetchFromGitHub
, lib, stdenv, formats, spacevim_config ? import ./init.nix }: , lib, stdenv, formats, runCommand, spacevim_config ? import ./init.nix }:
let let
format = formats.toml {}; format = formats.toml {};
@ -10,7 +10,10 @@ let
# ~/.cache/vimfiles/repos # ~/.cache/vimfiles/repos
vimrcConfig.packages.myVimPackage = with vimPlugins; { start = [ ]; }; vimrcConfig.packages.myVimPackage = with vimPlugins; { start = [ ]; };
}; };
spacevimdir = format.generate "init.toml" spacevim_config; spacevimdir = runCommand "SpaceVim.d" { } ''
mkdir -p $out
cp ${format.generate "init.toml" spacevim_config} $out/init.toml
'';
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "spacevim"; pname = "spacevim";
version = "1.5.0"; version = "1.5.0";
@ -25,13 +28,19 @@ in stdenv.mkDerivation rec {
buildInputs = [ vim-customized ]; buildInputs = [ vim-customized ];
buildPhase = '' buildPhase = ''
runHook preBuild
# generate the helptags # generate the helptags
vim -u NONE -c "helptags $(pwd)/doc" -c q vim -u NONE -c "helptags $(pwd)/doc" -c q
runHook postBuild
''; '';
patches = [ ./helptags.patch ]; patches = [
# Don't generate helptags at runtime into read-only $SPACEVIMDIR
./helptags.patch
];
installPhase = '' installPhase = ''
runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
cp -r $(pwd) $out/SpaceVim cp -r $(pwd) $out/SpaceVim
@ -40,6 +49,7 @@ in stdenv.mkDerivation rec {
makeWrapper "${vim-customized}/bin/vim" "$out/bin/spacevim" \ makeWrapper "${vim-customized}/bin/vim" "$out/bin/spacevim" \
--add-flags "-u $out/SpaceVim/vimrc" --set SPACEVIMDIR "${spacevimdir}/" \ --add-flags "-u $out/SpaceVim/vimrc" --set SPACEVIMDIR "${spacevimdir}/" \
--prefix PATH : ${lib.makeBinPath [ fzf git ripgrep]} --prefix PATH : ${lib.makeBinPath [ fzf git ripgrep]}
runHook postInstall
''; '';
meta = with lib; { meta = with lib; {