kdePackages.khelpcenter: fix manpage search

Previously the shebang in khc_mansearch.py pointed to /bin/env and caused it to fail; add python3 to the extraBuildInputs to that it gets converted to a nix path.
Also get the man-db binaries by their nix path rather than hoping that they're in the runtime PATH.

+32
+9
pkgs/kde/gear/khelpcenter/default.nix
··· 1 1 { 2 2 mkKdeDerivation, 3 + replaceVars, 3 4 qtwebengine, 4 5 xapian, 6 + man-db, 7 + python3, 5 8 }: 6 9 mkKdeDerivation { 7 10 pname = "khelpcenter"; ··· 9 12 extraBuildInputs = [ 10 13 qtwebengine 11 14 xapian 15 + python3 16 + ]; 17 + patches = [ 18 + (replaceVars ./use_nix_paths_for_mansearch_utilities.patch { 19 + inherit man-db; 20 + }) 12 21 ]; 13 22 meta.mainProgram = "khelpcenter"; 14 23 }
+23
pkgs/kde/gear/khelpcenter/use_nix_paths_for_mansearch_utilities.patch
··· 1 + diff --git a/searchhandlers/khc_mansearch.py b/searchhandlers/khc_mansearch.py 2 + index ce61ed9c..a8c4c653 100755 3 + --- a/searchhandlers/khc_mansearch.py 4 + +++ b/searchhandlers/khc_mansearch.py 5 + @@ -32,15 +32,15 @@ def main(): 6 + # If the query is a single word, perhaps it is the literal name of the 7 + # command, or a prefix, or a substring 8 + if not ' ' in words: 9 + - results_prefix = subprocess.run(['whatis', '-w', words + '*'], capture_output=True, text=True) 10 + + results_prefix = subprocess.run(['@man-db@/bin/whatis', '-w', words + '*'], capture_output=True, text=True) 11 + if results_prefix.returncode == 0: 12 + command_results += results_prefix.stdout 13 + - results_substring = subprocess.run(['whatis', '-w', '*' + words + '*'], capture_output=True, text=True) 14 + + results_substring = subprocess.run(['@man-db@/bin/whatis', '-w', '*' + words + '*'], capture_output=True, text=True) 15 + if results_substring.returncode == 0: 16 + command_results += results_substring.stdout 17 + 18 + # Build the apropos command line 19 + - apropos = ['apropos', '-L', args.lang] 20 + + apropos = ['@man-db@/bin/apropos', '-L', args.lang] 21 + if args.method == 'and': 22 + apropos.append('--and') 23 + apropos.extend(words.split(' '))