summary refs log tree commit diff
path: root/pkgs/tools/X11/xnee/default.nix
blob: ac232f917bd78df51a08b88b024042ad48392276 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{ lib
, stdenv
, fetchurl
, fetchpatch
, autoreconfHook
, pkg-config
, gtk2
, libX11
, libXext
, libXi
, libXtst
, texinfo
, xorgproto
}:

stdenv.mkDerivation (finalAttrs: {
  version = "3.19";
  pname = "xnee";

  src = fetchurl {
    url = "mirror://gnu/xnee/xnee-${finalAttrs.version}.tar.gz";
    hash = "sha256-UqQeXPYvgbej5bWBJOs1ZeHhICir2mP1R/u+DZiiwhI=";
  };

  patches = [
    # Pull fix pending upstream inclusion for -fno-common
    # toolchain support: https://savannah.gnu.org/bugs/?58810
    (fetchpatch {
      name = "fno-common.patch";
      url = "https://savannah.gnu.org/bugs/download.php?file_id=49534";
      hash = "sha256-Ar5SyVIEp8/knDHm+4f0KWAH+A5gGhXGezEqL7xkQhI=";
    })
  ];

  postPatch = ''
    for i in `find cnee/test -name \*.sh`; do
      sed -i "$i" -e's|/bin/bash|${stdenv.shell}|g ; s|/usr/bin/env bash|${stdenv.shell}|g'
    done
  ''
  # Fix for glibc-2.34. For some reason, `LIBSEMA="CCC"` is added
  # if `sem_init` is part of libc which causes errors like
  # `gcc: error: CCC: No such file or directory` during the build.
  + ''
    substituteInPlace configure* \
      --replace 'LIBSEMA="CCC"' 'LIBSEMA=""'
  '';

  strictDeps = true;

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ];

  buildInputs = [
    gtk2
    libX11
    libXext
    libXi
    libXtst
    texinfo
    xorgproto
  ];

  configureFlags = [
    "--disable-gnome-applet"
    # Do a static build because `libxnee' doesn't get installed anyway.
    "--enable-static"
  ];

  makeFlags = [
    # `cnee' is linked without `-lXi' and as a consequence has a RUNPATH that
    # lacks libXi.
    "LDFLAGS=-lXi"
  ];

  # XXX: Actually tests require an X server.
  doCheck = true;

  meta = {
    description = "X11 event recording and replay tool";
    longDescription = ''
      Xnee is a suite of programs that can record, replay and distribute
      user actions under the X11 environment.  Think of it as a robot that
      can imitate the job you just did.  Xnee can be used to automate
      tests, demonstrate programs, distribute actions, record & replay
      "macros", retype a file.
    '';
    homepage = "https://www.gnu.org/software/xnee/";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ wegank ];
    platforms = lib.platforms.unix;
  };
})