Merge pull request #308348 from RyanGibb/notmuch-vim

notmuch: install the vim plugin

authored by Doron Behar and committed by GitHub 3f709516 3f855a3d

+28 -9
+28 -9
pkgs/applications/networking/mailreaders/notmuch/default.nix
··· 1 - { fetchurl, lib, stdenv, makeWrapper 2 , pkg-config, gnupg 3 , xapian, gmime3, sfsexp, talloc, zlib 4 , doxygen, perl, texinfo ··· 12 , withEmacs ? true 13 , withRuby ? true 14 , withSfsexp ? true # also installs notmuch-git, which requires sexp-support 15 }: 16 17 - stdenv.mkDerivation rec { 18 pname = "notmuch"; 19 version = "0.38.3"; 20 21 src = fetchurl { 22 - url = "https://notmuchmail.org/releases/notmuch-${version}.tar.xz"; 23 hash = "sha256-mvRsyA2li0MByiuu/MJaQNES0DFVB+YywPPw8IMo0FQ="; 24 }; 25 ··· 76 ''; 77 78 outputs = [ "out" "man" "info" "bindingconfig" ] 79 - ++ lib.optional withEmacs "emacs" 80 - ++ lib.optional withRuby "ruby"; 81 82 # if notmuch is built with s-expression support, the testsuite (T-850.sh) only 83 # passes if notmuch-git can be executed, so we need to patch its shebang. ··· 123 moveToOutput bin/notmuch-emacs-mua $emacs 124 '' + lib.optionalString withRuby '' 125 make -C bindings/ruby install \ 126 - vendordir=$ruby/lib/ruby \ 127 SHELL=$SHELL \ 128 $makeFlags "''${makeFlagsArray[@]}" \ 129 $installFlags "''${installFlagsArray[@]}" ··· 133 + lib.optionalString withSfsexp '' 134 cp notmuch-git $out/bin/notmuch-git 135 wrapProgram $out/bin/notmuch-git --prefix PATH : $out/bin:${lib.getBin git}/bin 136 ''; 137 138 passthru = { 139 - pythonSourceRoot = "notmuch-${version}/bindings/python"; 140 tests.version = testers.testVersion { package = notmuch; }; 141 - inherit version; 142 143 updateScript = gitUpdater { 144 url = "https://git.notmuchmail.org/git/notmuch"; ··· 155 platforms = platforms.unix; 156 mainProgram = "notmuch"; 157 }; 158 - }
··· 1 + { fetchurl, lib, stdenv, makeWrapper, buildEnv 2 , pkg-config, gnupg 3 , xapian, gmime3, sfsexp, talloc, zlib 4 , doxygen, perl, texinfo ··· 12 , withEmacs ? true 13 , withRuby ? true 14 , withSfsexp ? true # also installs notmuch-git, which requires sexp-support 15 + , withVim ? true 16 }: 17 18 + stdenv.mkDerivation (finalAttrs: { 19 pname = "notmuch"; 20 version = "0.38.3"; 21 22 src = fetchurl { 23 + url = "https://notmuchmail.org/releases/notmuch-${finalAttrs.version}.tar.xz"; 24 hash = "sha256-mvRsyA2li0MByiuu/MJaQNES0DFVB+YywPPw8IMo0FQ="; 25 }; 26 ··· 77 ''; 78 79 outputs = [ "out" "man" "info" "bindingconfig" ] 80 + ++ lib.optional withEmacs "emacs"; 81 82 # if notmuch is built with s-expression support, the testsuite (T-850.sh) only 83 # passes if notmuch-git can be executed, so we need to patch its shebang. ··· 123 moveToOutput bin/notmuch-emacs-mua $emacs 124 '' + lib.optionalString withRuby '' 125 make -C bindings/ruby install \ 126 + vendordir=$out/lib/ruby \ 127 SHELL=$SHELL \ 128 $makeFlags "''${makeFlagsArray[@]}" \ 129 $installFlags "''${installFlagsArray[@]}" ··· 133 + lib.optionalString withSfsexp '' 134 cp notmuch-git $out/bin/notmuch-git 135 wrapProgram $out/bin/notmuch-git --prefix PATH : $out/bin:${lib.getBin git}/bin 136 + '' + lib.optionalString withVim '' 137 + make -C vim DESTDIR="$out/share/vim-plugins/notmuch" prefix="" install 138 + mkdir -p $out/share/nvim 139 + ln -s $out/share/vim-plugins/notmuch $out/share/nvim/site 140 + '' + lib.optionalString (withVim && withRuby) '' 141 + PLUG=$out/share/vim-plugins/notmuch/plugin/notmuch.vim 142 + cat >> $PLUG << EOF 143 + let \$GEM_PATH=\$GEM_PATH . ":${finalAttrs.passthru.gemEnv}/${ruby.gemPath}" 144 + let \$RUBYLIB=\$RUBYLIB . ":$out/${ruby.libPath}/${ruby.system}" 145 + if has('nvim') 146 + EOF 147 + for gem in ${finalAttrs.passthru.gemEnv}/${ruby.gemPath}/gems/*/lib; do 148 + echo "ruby \$LOAD_PATH.unshift('$gem')" >> $PLUG 149 + done 150 + echo 'endif' >> $PLUG 151 ''; 152 153 passthru = { 154 + pythonSourceRoot = "notmuch-${finalAttrs.version}/bindings/python"; 155 + gemEnv = buildEnv { 156 + name = "notmuch-vim-gems"; 157 + paths = with ruby.gems; [ mail ]; 158 + pathsToLink = [ "/lib" "/nix-support" ]; 159 + }; 160 tests.version = testers.testVersion { package = notmuch; }; 161 162 updateScript = gitUpdater { 163 url = "https://git.notmuchmail.org/git/notmuch"; ··· 174 platforms = platforms.unix; 175 mainProgram = "notmuch"; 176 }; 177 + })