1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5}:
6
7stdenv.mkDerivation rec {
8 pname = "termcolor";
9 version = "2.1.0";
10
11 src = fetchFromGitHub {
12 owner = "ikalnytskyi";
13 repo = "termcolor";
14 rev = "v${version}";
15 sha256 = "sha256-2RXQ8sn2VNhQ2WZfwCCeQuM6x6C+sLA6ulAaFtaDMZw=";
16 };
17
18 nativeBuildInputs = [ cmake ];
19
20 cmakeFlags = [ "-DTERMCOLOR_TESTS=ON" ];
21 CXXFLAGS = [
22 # GCC 13: error: 'uint8_t' has not been declared
23 "-include cstdint"
24 ];
25
26 doCheck = true;
27
28 checkPhase = ''
29 runHook preCheck
30 ./test_termcolor
31 runHook postCheck
32 '';
33
34 meta = with lib; {
35 description = "Header-only C++ library for printing colored messages";
36 homepage = "https://github.com/ikalnytskyi/termcolor";
37 license = licenses.bsd3;
38 platforms = platforms.unix;
39 maintainers = with maintainers; [ prusnak ];
40 };
41}