about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/terminal-emulators/ctx/default.nix
blob: 47f0fd702fa356e5176419c0a6cc2f3aab234e66 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{ lib
, stdenv
, fetchgit
, pkg-config
, xxd
, SDL2
, alsa-lib
, babl
, bash
, cairo
, curl
, libdrm # Not documented
, enableFb ? false
, nixosTests
}:

stdenv.mkDerivation {
  pname = "ctx";
  version = "unstable-2023-06-05";

  src = fetchgit {
    name = "ctx-source"; # because of a dash starting the directory
    url = "https://ctx.graphics/.git/";
    rev = "2eb3886919d0a0b8c305e4f9e18428dad5e73ca0";
    sha256 = "sha256-PLUyGArxLU742IKIgpzxdBdc94mWWSkHNFoXGW8L/Zo=";
  };

  patches = [
    ./0001-Make-arch-detection-optional-and-fix-targets.patch
  ];

  postPatch = ''
    patchShebangs ./tools/gen_fs.sh
  '';

  strictDeps = true;

  env.ARCH = stdenv.hostPlatform.parsed.cpu.arch;

  nativeBuildInputs = [
    pkg-config
    xxd
  ];

  buildInputs = [
    SDL2
    alsa-lib
    babl
    bash # for ctx-audioplayer
    cairo
    curl
    libdrm
  ];

  configureScript = "./configure.sh";
  configureFlags = lib.optional enableFb "--enable-fb";
  configurePlatforms = [];
  dontAddPrefix = true;
  dontDisableStatic = true;

  installFlags = [
    "PREFIX=${placeholder "out"}"
  ];

  passthru.tests.test = nixosTests.terminal-emulators.ctx;

  meta = with lib; {
    homepage = "https://ctx.graphics/";
    description = "Vector graphics terminal";
    longDescription= ''
      ctx is an interactive 2D vector graphics, audio, text- canvas and
      terminal, with escape sequences that enable a 2D vector drawing API using
      a vector graphics protocol.
    '';
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ AndersonTorres];
    platforms = platforms.unix;
  };
}