diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-10-18 16:46:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-18 16:46:24 +0200 |
commit | affffd11e56bbf8a2fabb5d3120fc39c092f9abd (patch) | |
tree | 2d2674cd6a162df12dca4a77a9642dcb7ecea89c /pkgs/tools/X11 | |
parent | d0cf2c67a17cf2c420add4b62351807466177ec4 (diff) | |
parent | 4ed8ca8f57d0dc3014d50058c38a37d8360ac213 (diff) |
Merge pull request #261489 from wegank/xnee-refactor
xnee: refactor
Diffstat (limited to 'pkgs/tools/X11')
-rw-r--r-- | pkgs/tools/X11/xnee/default.nix | 108 |
1 files changed, 65 insertions, 43 deletions
diff --git a/pkgs/tools/X11/xnee/default.nix b/pkgs/tools/X11/xnee/default.nix index c16da204f2f4f..ac232f917bd78 100644 --- a/pkgs/tools/X11/xnee/default.nix +++ b/pkgs/tools/X11/xnee/default.nix @@ -1,13 +1,25 @@ -{ fetchurl, fetchpatch, lib, stdenv, libX11, xorgproto, libXext, libXtst -, gtk2, libXi, pkg-config, texinfo }: +{ lib +, stdenv +, fetchurl +, fetchpatch +, autoreconfHook +, pkg-config +, gtk2 +, libX11 +, libXext +, libXi +, libXtst +, texinfo +, xorgproto +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { version = "3.19"; pname = "xnee"; src = fetchurl { - url = "mirror://gnu/xnee/${pname}-${version}.tar.gz"; - sha256 = "04n2lac0vgpv8zsn7nmb50hf3qb56pmj90dmwnivg09gyrf1x92j"; + url = "mirror://gnu/xnee/xnee-${finalAttrs.version}.tar.gz"; + hash = "sha256-UqQeXPYvgbej5bWBJOs1ZeHhICir2mP1R/u+DZiiwhI="; }; patches = [ @@ -16,57 +28,67 @@ stdenv.mkDerivation rec { (fetchpatch { name = "fno-common.patch"; url = "https://savannah.gnu.org/bugs/download.php?file_id=49534"; - sha256 = "04j2cjy2yaiigg31a6k01vw0fq19yj3zpriikkjcz9q4ab4m5gh2"; + 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 + 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=""' + ''; - # 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 + ]; - nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ libX11 xorgproto libXext libXtst gtk2 - libXi - texinfo - ]; + buildInputs = [ + gtk2 + libX11 + libXext + libXi + libXtst + texinfo + xorgproto + ]; - configureFlags = + configureFlags = [ + "--disable-gnome-applet" # Do a static build because `libxnee' doesn't get installed anyway. - [ "--disable-gnome-applet" "--enable-static" ]; + "--enable-static" + ]; - # `cnee' is linked without `-lXi' and as a consequence has a RUNPATH that - # lacks libXi. - makeFlags = [ "LDFLAGS=-lXi" ]; + 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. - ''; - - license = lib.licenses.gpl3Plus; - + 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/"; - - maintainers = with lib.maintainers; [ ]; - platforms = lib.platforms.gnu ++ lib.platforms.linux; # arbitrary choice + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ wegank ]; + platforms = lib.platforms.unix; }; -} +}) |