tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
terminal-colors: init at 3.0.1
Dmitry Bogatov
4 years ago
3ef54d20
b6312861
+57
2 changed files
expand all
collapse all
unified
split
pkgs
applications
misc
terminal-colors
default.nix
top-level
all-packages.nix
+55
pkgs/applications/misc/terminal-colors/default.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ stdenv, lib, help2man, python3, fetchFromGitHub }:
2
+
3
+
stdenv.mkDerivation rec {
4
+
pname = "terminal-colors";
5
+
version = "3.0.1";
6
+
outputs = [ "out" "man" ];
7
+
8
+
src = fetchFromGitHub {
9
+
owner = "eikenb";
10
+
repo = pname;
11
+
rev = "v${version}";
12
+
hash = "sha256-hekt77/FhSTMEARVuck49/Q1dIuqkwbOYmgGD1IItyc=";
13
+
};
14
+
15
+
buildInputs = [ python3 ];
16
+
nativeBuildInputs = [ help2man ];
17
+
18
+
postPatch =
19
+
# This sed command modifies output of --version command in way that
20
+
# makes manpage generated by help2man(1) prettier.
21
+
''
22
+
sed -r -i "3s/([0-9.]+)/$pname - \1\\n/" ./$pname
23
+
''
24
+
# Upstream shebang of "terminal-colors" python script uses
25
+
# /usr/bin/env, which is not present in Nix sandbox, so we need to
26
+
# patch it before running help2man, otherwise it would fail with "no
27
+
# such file or directory".
28
+
+ ''
29
+
patchShebangs ./$pname
30
+
'';
31
+
32
+
buildPhase = ''
33
+
runHook preBuild
34
+
35
+
help2man -n 'display terminal colors' -N ./$pname > $pname.1
36
+
37
+
runHook postBuild
38
+
'';
39
+
40
+
installPhase = ''
41
+
runHook preInstall
42
+
43
+
install -D -m755 ./$pname -t $out/bin
44
+
install -D -m644 ./$pname.1 -t $man/share/man/man1
45
+
46
+
runHook postInstall
47
+
'';
48
+
49
+
meta = with lib; {
50
+
description = "Script displaying terminal colors in various formats";
51
+
homepage = "https://github.com/eikenb/terminal-colors";
52
+
license = licenses.gpl3Plus;
53
+
maintainers = with maintainers; [ kaction ];
54
+
};
55
+
}
+2
pkgs/top-level/all-packages.nix
···
1016
1017
terminator = callPackage ../applications/terminal-emulators/terminator { };
1018
0
0
1019
termite = callPackage ../applications/terminal-emulators/termite/wrapper.nix {
1020
termite = termite-unwrapped;
1021
};
···
1016
1017
terminator = callPackage ../applications/terminal-emulators/terminator { };
1018
1019
+
terminal-colors = callPackage ../applications/misc/terminal-colors { };
1020
+
1021
termite = callPackage ../applications/terminal-emulators/termite/wrapper.nix {
1022
termite = termite-unwrapped;
1023
};