1{
2 fetchFromGitHub,
3 lib,
4 stdenv,
5 makeWrapper,
6 xorg,
7 ncurses,
8 coreutils,
9 bashInteractive,
10 gnused,
11 gnugrep,
12 glibc,
13 xterm,
14 util-linux,
15}:
16
17stdenv.mkDerivation rec {
18 pname = "bashrun2";
19 version = "0.2.6";
20
21 src = fetchFromGitHub {
22 owner = "hbekel";
23 repo = "bashrun2";
24 tag = "v${version}";
25 hash = "sha256-U2ntplhyv8KAkaMd2D6wRsUIYkhJzxdgHo2xsbNRfqM=";
26 };
27
28 nativeBuildInputs = [
29 makeWrapper
30 ];
31
32 buildInputs = [
33 xorg.libX11
34 ];
35
36 patches = [
37 ./remote-permissions.patch
38 ];
39
40 postPatch = ''
41 substituteInPlace \
42 man/bashrun2.1 \
43 --replace-fail '/usr/bin/brwctl' "$out/bin/brwctl"
44
45 substituteInPlace \
46 src/bindings \
47 src/registry \
48 src/utils \
49 src/bashrun2 \
50 src/frontend \
51 src/remote \
52 src/plugin \
53 src/engine \
54 src/bookmarks \
55 --replace-fail '/bin/rm' '${coreutils}/bin/rm'
56
57 substituteInPlace \
58 src/bashrun2 \
59 --replace-fail '#!/usr/bin/env bash' '#!${lib.getExe bashInteractive}'
60
61 substituteInPlace \
62 src/remote \
63 --replace-fail '/bin/cp' '${coreutils}/bin/cp'
64 '';
65
66 postFixup = ''
67 wrapProgram $out/bin/bashrun2 \
68 --prefix PATH : "$out/bin:${
69 lib.makeBinPath [
70 ncurses
71 coreutils
72 gnused
73 gnugrep
74 glibc
75 bashInteractive
76 xterm
77 util-linux
78 ]
79 }" \
80 --prefix XDG_CONFIG_DIRS : "$out/etc/xdg"
81 '';
82
83 meta = {
84 maintainers = with lib.maintainers; [ dopplerian ];
85 mainProgram = "bashrun2";
86 homepage = "http://henning-liebenau.de/bashrun2/";
87 license = lib.licenses.gpl2Plus;
88 description = "Application launcher based on a modified bash session in a small terminal window";
89 };
90}