2018-08-01 10:42:09 +02:00
|
|
|
{ fetchFromGitHub, silver-searcher, tree, man, stdenv,
|
2018-05-25 14:22:23 +02:00
|
|
|
pandocSupport ? true, pandoc ? null
|
|
|
|
, ... }:
|
|
|
|
|
|
|
|
assert pandocSupport -> pandoc != null;
|
2017-11-29 21:39:52 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "memo-${version}";
|
|
|
|
|
2018-07-31 23:20:42 +02:00
|
|
|
version = "0.5";
|
2017-11-29 21:39:52 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mrVanDalo";
|
|
|
|
repo = "memo";
|
|
|
|
rev = "${version}";
|
2018-07-31 23:20:42 +02:00
|
|
|
sha256 = "1kq8hmq4lgvkk717nhmdryr90g61xm0jm7y8dzya8jsxsn531gm8";
|
2017-11-29 21:39:52 +01:00
|
|
|
};
|
|
|
|
|
2018-05-25 14:22:23 +02:00
|
|
|
installPhase = let
|
|
|
|
pandocReplacement = if pandocSupport then
|
|
|
|
"pandoc_cmd=${pandoc}/bin/pandoc"
|
|
|
|
else
|
|
|
|
"#pandoc_cmd=pandoc";
|
|
|
|
in ''
|
2018-07-31 23:20:42 +02:00
|
|
|
mkdir -p $out/{bin,share/man/man1,share/bash-completion/completions,share/zsh/site-functions}
|
2018-02-12 04:05:09 +01:00
|
|
|
substituteInPlace memo \
|
2018-08-01 10:42:09 +02:00
|
|
|
--replace "ack_cmd=ack" "ack_cmd=${silver-searcher}/bin/ag" \
|
2018-05-25 14:22:23 +02:00
|
|
|
--replace "tree_cmd=tree" "tree_cmd=${tree}/bin/tree" \
|
|
|
|
--replace "man_cmd=man" "man_cmd=${man}/bin/man" \
|
|
|
|
--replace "pandoc_cmd=pandoc" "${pandocReplacement}"
|
2017-11-29 21:39:52 +01:00
|
|
|
mv memo $out/bin/
|
|
|
|
mv doc/memo.1 $out/share/man/man1/memo.1
|
2018-07-31 23:20:42 +02:00
|
|
|
mv completion/bash/memo.sh $out/share/bash-completion/completions/memo.sh
|
|
|
|
mv completion/zsh/_memo $out/share/zsh/site-functions/_memo
|
2017-11-29 21:39:52 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A simple tool written in bash to memorize stuff";
|
|
|
|
longDescription = ''
|
|
|
|
A simple tool written in bash to memorize stuff.
|
|
|
|
Memo organizes is structured through topics which are folders in ~/memo.
|
|
|
|
'';
|
|
|
|
homepage = http://palovandalo.com/memo/;
|
|
|
|
downloadPage = https://github.com/mrVanDalo/memo/releases;
|
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2017-11-29 22:26:51 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.mrVanDalo ];
|
2017-11-29 21:39:52 +01:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
};
|
2018-02-12 04:05:09 +01:00
|
|
|
}
|