--- a/cvise.py
+++ b/cvise.py
@@ -15,7 +15,7 @@
 # add the known install location to the path
 destdir = os.getenv('DESTDIR', '')
 if importlib.util.find_spec('cvise') is None:
-    sys.path.append('@CMAKE_INSTALL_FULL_DATADIR@')
+    sys.path.append(os.path.join(sys.prefix, 'share'))
     sys.path.append(destdir + '@CMAKE_INSTALL_FULL_DATADIR@')
 
 import chardet  # noqa: E402
@@ -43,7 +43,7 @@
 def get_share_dir():
     # Test all known locations for the cvise directory
     share_dirs = [
-        os.path.join('@CMAKE_INSTALL_FULL_DATADIR@', '@cvise_PACKAGE@'),
+        os.path.join(os.path.join(sys.prefix, 'share'), '@cvise_PACKAGE@'),
         destdir + os.path.join('@CMAKE_INSTALL_FULL_DATADIR@', '@cvise_PACKAGE@'),
         os.path.join(script_path, 'cvise'),
     ]
--- cvise-2.12.0/cvise/utils/externalprograms.py.orig	2025-09-23 22:51:29.000000000 +0200
+++ cvise-2.12.0/cvise/utils/externalprograms.py	2025-11-23 14:48:15.469213300 +0100
@@ -29,7 +29,8 @@
             path = shutil.which(prog, path=local_folder)
 
             if not path:
-                search = os.path.join('@CMAKE_INSTALL_FULL_LIBEXECDIR@', '@cvise_PACKAGE@')
+                import sys
+                search = os.path.join(sys.prefix, 'lib', '@cvise_PACKAGE@')
                 path = shutil.which(prog, path=search)
             if not path:
                 search = DESTDIR + os.path.join('@CMAKE_INSTALL_FULL_LIBEXECDIR@', '@cvise_PACKAGE@')
@@ -42,6 +43,7 @@
             programs[prog] = path
 
     # Special case for clang-format
-    programs['clang-format'] = '@CLANG_FORMAT_PATH@'
+    import shutil
+    programs['clang-format'] = shutil.which(os.path.basename('@CLANG_FORMAT_PATH@'))
 
     return programs
