vimPlugins.openscad-nvim: fix patch

This commit is contained in:
figsoda 2023-05-13 13:57:33 -04:00
parent c90b977cdf
commit 4b176f4ec4
2 changed files with 19 additions and 20 deletions

View File

@ -774,15 +774,14 @@ self: super: {
openscad-nvim = super.openscad-nvim.overrideAttrs (old: {
buildInputs = [ zathura htop openscad ];
patches = [ ./patches/openscad.nvim/program_paths.patch ];
postPatch = ''
substituteInPlace lua/openscad.lua --replace '@zathura-path@' ${zathura}/bin/zathura
substituteInPlace autoload/health/openscad_nvim.vim --replace '@zathura-path@' ${zathura}/bin/zathura
substituteInPlace lua/openscad/terminal.lua --replace '@htop-path@' ${htop}/bin/htop
substituteInPlace autoload/health/openscad_nvim.vim --replace '@htop-path@' ${htop}/bin/htop
substituteInPlace lua/openscad.lua --replace '@openscad-path@' ${openscad}/bin/openscad
'';
patches = [
(substituteAll {
src = ./patches/openscad.nvim/program_paths.patch;
htop = lib.getExe htop;
openscad = lib.getExe openscad;
zathura = lib.getExe zathura;
})
];
});
orgmode = super.orgmode.overrideAttrs (old: {

View File

@ -7,7 +7,7 @@ index 9022d55..30ef53f 100644
function! s:check_zathura_installed() abort
- if !executable('zathura')
+ if !executable('@zathura-path@')
+ if !executable('@zathura@')
call health#report_error('has(zathura)','install zathura')
else
call health#report_ok("zathura is installed")
@ -16,7 +16,7 @@ index 9022d55..30ef53f 100644
function! s:check_htop_installed() abort
- if !executable('htop')
+ if !executable('@htop-path@')
+ if !executable('@htop@')
call health#report_error('has(htop)','install htop')
else
call health#report_ok("htop is installed")
@ -29,16 +29,16 @@ index 7dff2fb..4382003 100644
function M.manual()
local path = U.openscad_nvim_root_dir .. U.path_sep .. "help_source" .. U.path_sep .. "openscad-manual.pdf"
- api.nvim_command('silent !zathura --fork ' .. path)
+ api.nvim_command('silent !@zathura-path@ --fork ' .. path)
+ api.nvim_command('silent !@zathura@ --fork ' .. path)
end
function M.help()
@@ -119,7 +119,7 @@ end
@@ -125,7 +125,7 @@ function M.exec_openscad()
jobCommand = '/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD ' .. vim.fn.expand('%:p')
else
-- TODO: What about Windows?
- jobCommand = 'openscad ' .. vim.fn.expand('%:p')
+ jobCommand = '@oepnscad@ ' .. vim.fn.expand('%:p')
end
function M.exec_openscad()
-- maybe just use api.jobstart .. instead
- api.nvim_command[[ call jobstart('openscad ' . shellescape(expand('%:p')), {'detach':1}) ]]
+ api.nvim_command[[ call jobstart('@openscad-path@ ' . shellescape(expand('%:p')), {'detach':1}) ]]
end
function M.default_mappings()
vim.fn.jobstart(jobCommand)