btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / xn / xnee / package.nix
blobb6fe79c7b9cf998425f9fea8a19c3905d639980f
1 { lib
2 , stdenv
3 , fetchurl
4 , fetchpatch
5 , autoreconfHook
6 , pkg-config
7 , gtk2
8 , libX11
9 , libXext
10 , libXi
11 , libXtst
12 , texinfo
13 , xorgproto
16 stdenv.mkDerivation (finalAttrs: {
17   version = "3.19";
18   pname = "xnee";
20   src = fetchurl {
21     url = "mirror://gnu/xnee/xnee-${finalAttrs.version}.tar.gz";
22     hash = "sha256-UqQeXPYvgbej5bWBJOs1ZeHhICir2mP1R/u+DZiiwhI=";
23   };
25   patches = [
26     # Pull fix pending upstream inclusion for -fno-common
27     # toolchain support: https://savannah.gnu.org/bugs/?58810
28     (fetchpatch {
29       name = "fno-common.patch";
30       url = "https://savannah.gnu.org/bugs/download.php?file_id=49534";
31       hash = "sha256-Ar5SyVIEp8/knDHm+4f0KWAH+A5gGhXGezEqL7xkQhI=";
32     })
33   ];
35   postPatch = ''
36     for i in `find cnee/test -name \*.sh`; do
37       sed -i "$i" -e's|/bin/bash|${stdenv.shell}|g ; s|/usr/bin/env bash|${stdenv.shell}|g'
38     done
39   ''
40   # Fix for glibc-2.34. For some reason, `LIBSEMA="CCC"` is added
41   # if `sem_init` is part of libc which causes errors like
42   # `gcc: error: CCC: No such file or directory` during the build.
43   + ''
44     substituteInPlace configure* \
45       --replace 'LIBSEMA="CCC"' 'LIBSEMA=""'
46   '';
48   strictDeps = true;
50   nativeBuildInputs = [
51     autoreconfHook
52     pkg-config
53   ];
55   buildInputs = [
56     gtk2
57     libX11
58     libXext
59     libXi
60     libXtst
61     texinfo
62     xorgproto
63   ];
65   configureFlags = [
66     "--disable-gnome-applet"
67     # Do a static build because `libxnee' doesn't get installed anyway.
68     "--enable-static"
69   ];
71   makeFlags = [
72     # `cnee' is linked without `-lXi' and as a consequence has a RUNPATH that
73     # lacks libXi.
74     "LDFLAGS=-lXi"
75   ];
77   # error: call to undeclared function 'xnee_check_key';
78   # ISO C99 and later do not support implicit function declarations
79   env = lib.optionalAttrs stdenv.cc.isClang {
80     NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
81   };
83   # XXX: Actually tests require an X server.
84   doCheck = true;
86   meta = {
87     description = "X11 event recording and replay tool";
88     longDescription = ''
89       Xnee is a suite of programs that can record, replay and distribute
90       user actions under the X11 environment.  Think of it as a robot that
91       can imitate the job you just did.  Xnee can be used to automate
92       tests, demonstrate programs, distribute actions, record & replay
93       "macros", retype a file.
94     '';
95     homepage = "https://www.gnu.org/software/xnee/";
96     license = lib.licenses.gpl3Plus;
97     maintainers = with lib.maintainers; [ wegank ];
98     platforms = lib.platforms.unix;
99   };