Merge pull request #70903 from minijackson/fix-alot-completion

alot: fix hardcoded Python in Zsh completion
This commit is contained in:
Matthew Bauer 2019-11-07 17:05:10 -05:00 committed by GitHub
commit 561edb92e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ stdenv, lib, buildPythonPackage, fetchFromGitHub, isPy3k { stdenv, lib, buildPythonPackage, python, fetchFromGitHub, isPy3k
, notmuch, urwid, urwidtrees, twisted, python_magic, configobj, mock, file, gpgme , notmuch, urwid, urwidtrees, twisted, python_magic, configobj, mock, file, gpgme
, service-identity , service-identity
, gnupg ? null, sphinx, awk ? null, procps ? null, future ? null , gnupg ? null, sphinx, awk ? null, procps ? null, future ? null
@ -39,7 +39,9 @@ buildPythonPackage rec {
checkInputs = [ awk future mock gnupg procps ]; checkInputs = [ awk future mock gnupg procps ];
postInstall = lib.optionalString withManpage '' postInstall = let
completionPython = python.withPackages (ps: [ ps.configobj ]);
in lib.optionalString withManpage ''
mkdir -p $out/man mkdir -p $out/man
cp -r docs/build/man $out/man cp -r docs/build/man $out/man
'' ''
@ -47,6 +49,8 @@ buildPythonPackage rec {
mkdir -p $out/share/{applications,alot} mkdir -p $out/share/{applications,alot}
cp -r extra/themes $out/share/alot cp -r extra/themes $out/share/alot
substituteInPlace extra/completion/alot-completion.zsh \
--replace "python3" "${completionPython.interpreter}"
install -D extra/completion/alot-completion.zsh $out/share/zsh/site-functions/_alot install -D extra/completion/alot-completion.zsh $out/share/zsh/site-functions/_alot
sed "s,/usr/bin,$out/bin,g" extra/alot.desktop > $out/share/applications/alot.desktop sed "s,/usr/bin,$out/bin,g" extra/alot.desktop > $out/share/applications/alot.desktop