Skip to content

Commit

Permalink
memo: 0.2 -> 0.4 (#40697)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrVanDalo authored and xeji committed May 25, 2018
1 parent 8b6ddc8 commit 6f193b4
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions pkgs/applications/misc/memo/default.nix
@@ -1,23 +1,34 @@
{ fetchFromGitHub, ag, tree, stdenv, ... }:
{ fetchFromGitHub, ag, tree, man, stdenv,
pandocSupport ? true, pandoc ? null
, ... }:

assert pandocSupport -> pandoc != null;

stdenv.mkDerivation rec {

name = "memo-${version}";

version = "0.2";
version = "0.4";

src = fetchFromGitHub {
owner = "mrVanDalo";
repo = "memo";
rev = "${version}";
sha256 = "0mww4w5m6jv4s0krm74cccrz0vlr8rrwiv122jk67l1v9r80pchs";
sha256 = "06999nps46dxrjakvpin1d2zvfpjil69hb3bxagq29icalag3y2z";
};

installPhase = ''
installPhase = let
pandocReplacement = if pandocSupport then
"pandoc_cmd=${pandoc}/bin/pandoc"
else
"#pandoc_cmd=pandoc";
in ''
mkdir -p $out/{bin,share/man/man1,share/bash-completion/completions}
substituteInPlace memo \
--replace "ack " "${ag}/bin/ag " \
--replace "tree " "${tree}/bin/tree "
--replace "ack_cmd=ack" "ack_cmd=${ag}/bin/ag" \
--replace "tree_cmd=tree" "tree_cmd=${tree}/bin/tree" \
--replace "man_cmd=man" "man_cmd=${man}/bin/man" \
--replace "pandoc_cmd=pandoc" "${pandocReplacement}"
mv memo $out/bin/
mv doc/memo.1 $out/share/man/man1/memo.1
mv completion/memo.bash $out/share/bash-completion/completions/memo.sh
Expand Down

0 comments on commit 6f193b4

Please sign in to comment.