about summary refs log tree commit diff stats
path: root/pkgs/by-name/ct/ctpv/package.nix
blob: 905366bf573ae65688ddd5e3c4b17ba81c0a9111 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  lib,
  stdenv,
  fetchFromGitHub,
  makeWrapper,
  file,
  openssl,
}:
stdenv.mkDerivation rec {
  pname = "ctpv";
  version = "1.1-unstable-2024-11-24";

  src = fetchFromGitHub {
    owner = "NikitaIvanovV";
    repo = pname;
    rev = "4efa0f976eaf8cb814e0aba4f4f1a1d12ee9262e";
    hash = "sha256-tFBXCUey1lsNAg1mB0iQjDoH70qL8aytE6h9rhHlBe4=";
  };

  nativeBuildInputs = [makeWrapper];

  buildInputs = [
    file # libmagic
    openssl
  ];

  patches = [
    ./allow-up-to-64-types.patch
  ];

  makeFlags = ["PREFIX=$(out)"];

  preFixup = ''
    wrapProgram $out/bin/ctpv \
      --set PATH "${lib.makeBinPath []}";
  '';

  meta = with lib; {
    description = "File previewer for a terminal";
    homepage = "https://github.com/NikitaIvanovV/ctpv";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = [maintainers.wesleyjrz];
  };
}