ks: add completions for bash and zsh (#364049)
[NixPkgs.git] / pkgs / by-name / oi / oil-buku / package.nix
blob58ad6883843afbd9e64a30e5e6442d21c58c9eda
2   stdenvNoCC,
3   lib,
4   fetchFromGitHub,
5   jq,
6   gawk,
7   peco,
8   makeWrapper,
9 }:
11 stdenvNoCC.mkDerivation rec {
12   pname = "oil-buku";
13   version = "0.3.2";
15   src = fetchFromGitHub {
16     owner = "AndreiUlmeyda";
17     repo = "oil";
18     rev = version;
19     sha256 = "12g0fd7h11hh94b2pyg3pqwbf8bc7gcnrnm1qqbf18s6z02b6ixr";
20   };
22   postPatch = ''
23     substituteInPlace src/oil --replace \
24       "LIBDIR=/usr/local/lib/oil" "LIBDIR=${placeholder "out"}/lib"
26     substituteInPlace src/json-to-line.jq --replace \
27       "/usr/bin/env -S jq" "${jq}/bin/jq"
29     substituteInPlace src/format-columns.awk --replace \
30       "/usr/bin/env -S awk" "${gawk}/bin/awk"
31   '';
33   makeFlags = [
34     "BINDIR=${placeholder "out"}/bin"
35     "LIBDIR=${placeholder "out"}/lib"
36   ];
38   nativeBuildInputs = [ makeWrapper ];
40   postFixup = ''
41     wrapProgram $out/bin/oil \
42         --prefix PATH : ${lib.makeBinPath [ peco ]}
43   '';
45   meta = with lib; {
46     description = "Search-as-you-type cli frontend for the buku bookmarks manager using peco";
47     homepage = "https://github.com/AndreiUlmeyda/oil";
48     license = licenses.gpl3Only;
49     maintainers = with maintainers; [ atila ];
50     mainProgram = "oil";
51     platforms = platforms.unix;
52   };