tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
vimPlugins.openscad-nvim: fix patch
figsoda
2 years ago
4b176f4e
c90b977c
+19
-20
2 changed files
expand all
collapse all
unified
split
pkgs
applications
editors
vim
plugins
overrides.nix
patches
openscad.nvim
program_paths.patch
+8
-9
pkgs/applications/editors/vim/plugins/overrides.nix
···
774
774
openscad-nvim = super.openscad-nvim.overrideAttrs (old: {
775
775
buildInputs = [ zathura htop openscad ];
776
776
777
777
-
patches = [ ./patches/openscad.nvim/program_paths.patch ];
778
778
-
779
779
-
postPatch = ''
780
780
-
substituteInPlace lua/openscad.lua --replace '@zathura-path@' ${zathura}/bin/zathura
781
781
-
substituteInPlace autoload/health/openscad_nvim.vim --replace '@zathura-path@' ${zathura}/bin/zathura
782
782
-
substituteInPlace lua/openscad/terminal.lua --replace '@htop-path@' ${htop}/bin/htop
783
783
-
substituteInPlace autoload/health/openscad_nvim.vim --replace '@htop-path@' ${htop}/bin/htop
784
784
-
substituteInPlace lua/openscad.lua --replace '@openscad-path@' ${openscad}/bin/openscad
785
785
-
'';
777
777
+
patches = [
778
778
+
(substituteAll {
779
779
+
src = ./patches/openscad.nvim/program_paths.patch;
780
780
+
htop = lib.getExe htop;
781
781
+
openscad = lib.getExe openscad;
782
782
+
zathura = lib.getExe zathura;
783
783
+
})
784
784
+
];
786
785
});
787
786
788
787
orgmode = super.orgmode.overrideAttrs (old: {
+11
-11
pkgs/applications/editors/vim/plugins/patches/openscad.nvim/program_paths.patch
···
7
7
8
8
function! s:check_zathura_installed() abort
9
9
- if !executable('zathura')
10
10
-
+ if !executable('@zathura-path@')
10
10
+
+ if !executable('@zathura@')
11
11
call health#report_error('has(zathura)','install zathura')
12
12
else
13
13
call health#report_ok("zathura is installed")
···
16
16
17
17
function! s:check_htop_installed() abort
18
18
- if !executable('htop')
19
19
-
+ if !executable('@htop-path@')
19
19
+
+ if !executable('@htop@')
20
20
call health#report_error('has(htop)','install htop')
21
21
else
22
22
call health#report_ok("htop is installed")
···
29
29
function M.manual()
30
30
local path = U.openscad_nvim_root_dir .. U.path_sep .. "help_source" .. U.path_sep .. "openscad-manual.pdf"
31
31
- api.nvim_command('silent !zathura --fork ' .. path)
32
32
-
+ api.nvim_command('silent !@zathura-path@ --fork ' .. path)
32
32
+
+ api.nvim_command('silent !@zathura@ --fork ' .. path)
33
33
end
34
34
35
35
function M.help()
36
36
-
@@ -119,7 +119,7 @@ end
37
37
-
38
38
-
function M.exec_openscad()
39
39
-
-- maybe just use api.jobstart .. instead
40
40
-
- api.nvim_command[[ call jobstart('openscad ' . shellescape(expand('%:p')), {'detach':1}) ]]
41
41
-
+ api.nvim_command[[ call jobstart('@openscad-path@ ' . shellescape(expand('%:p')), {'detach':1}) ]]
42
42
-
end
36
36
+
@@ -125,7 +125,7 @@ function M.exec_openscad()
37
37
+
jobCommand = '/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD ' .. vim.fn.expand('%:p')
38
38
+
else
39
39
+
-- TODO: What about Windows?
40
40
+
- jobCommand = 'openscad ' .. vim.fn.expand('%:p')
41
41
+
+ jobCommand = '@oepnscad@ ' .. vim.fn.expand('%:p')
42
42
+
end
43
43
44
44
-
function M.default_mappings()
44
44
+
vim.fn.jobstart(jobCommand)