Commit 4b176f4e authored by figsoda's avatar figsoda
Browse files

vimPlugins.openscad-nvim: fix patch

parent c90b977c
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -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: {
+11 −11
Original line number Diff line number Diff line
@@ -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
 
 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}) ]]
@@ -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.default_mappings()
 	vim.fn.jobstart(jobCommand)