From 4c01c9d8a59e37140913dae78d6d49b8a85b21b7 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sat, 13 Jul 2024 12:00:00 +0000 Subject: [PATCH] sved: fix the wrapper to be a python script --- pkgs/applications/editors/vim/plugins/overrides.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 44c60783f1a8..948de487fb3f 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -87,6 +87,7 @@ glib , gobject-introspection , wrapGAppsHook3 +, writeText , # sniprun dependencies bashInteractive , coreutils @@ -1482,12 +1483,19 @@ install -Dt $out/bin ftplugin/evinceSync.py ''; }; + # the vim plugin expects evinceSync.py to be a python file, but it is a C wrapper + pythonWrapper = writeText "evinceSync-wrapper.py" /* python */ '' + #!${python3}/bin/python3 + import os + import sys + os.execv("${svedbackend}/bin/evinceSync.py", sys.argv) + ''; in super.sved.overrideAttrs { preferLocalBuild = true; postPatch = '' rm ftplugin/evinceSync.py - ln -s ${svedbackend}/bin/evinceSync.py ftplugin/evinceSync.py + install -m 544 ${pythonWrapper} ftplugin/evinceSync.py ''; meta = { description = "synctex support between vim/neovim and evince";