about summary refs log tree commit diff
path: root/pkgs/by-name/zu/zutty/package.nix
blob: 4a931a1c4eb02dd48713a11e9775a590d8e3559f (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
{
  lib,
  stdenv,
  fetchgit,
  pkg-config,
  freetype,
  wafHook,
  python3,
  libXmu,
  glew,
  ucs-fonts,
  nixosTests,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "zutty";
  version = "0.16-unstable-2024-08-18";

  src = fetchgit {
    url = "https://git.hq.sig7.se/zutty.git";
    rev = "04b2ca3b3aaa070c41583247f8112c31b6003886"; # 20240818
    hash = "sha256-izUbn2B3RqIIOW9tuL7DFLqJdektCftxnpQssJMYxC8=";
  };

  postPatch =
    let
      fontpaths = [
        "/run/current-system/sw/share/X11/fonts" # available if fonts.fontDir.enable = true
        "${ucs-fonts}/share/fonts"
      ];
    in
    ''
      substituteInPlace src/options.h \
        --replace-fail /usr/share/fonts ${builtins.concatStringsSep ":" fontpaths}
    '';

  nativeBuildInputs = [
    pkg-config
    wafHook
    python3
  ];

  buildInputs = [
    freetype
    libXmu
    glew
  ];

  passthru = {
    tests = lib.optionalAttrs stdenv.isLinux { default = nixosTests.terminal-emulators.zutty; };
  };

  meta = {
    homepage = "https://tomscii.sig7.se/zutty/";
    description = "X terminal emulator rendering through OpenGL ES Compute Shaders";
    license = lib.licenses.gpl3Plus;
    maintainers = [ lib.maintainers.rolfschr ];
    platforms = lib.platforms.linux;
  };
})