summary refs log tree commit diff
path: root/pkgs/tools/X11/xbindkeys-config/default.nix
blob: bb83effe6011626c792fe5b33f7b40005a884136 (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
{ stdenv, fetchurl, gtk, pkgconfig, procps, makeWrapper, ... }:

stdenv.mkDerivation rec {
  pname = "xbindkeys-config";
  version = "0.1.3";

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ gtk makeWrapper ];

  src = fetchurl {
    url = "mirror://debian/pool/main/x/xbindkeys-config/xbindkeys-config_${version}.orig.tar.gz";
    sha256 = "1rs3li2hyig6cdzvgqlbz0vw6x7rmgr59qd6m0cvrai8xhqqykda";
  };

  hardeningDisable = [ "format" ];

  meta = {
    homepage = https://packages.debian.org/source/xbindkeys-config;
    description = "Graphical interface for configuring xbindkeys";
    license = stdenv.lib.licenses.gpl2Plus;
    maintainers = with stdenv.lib.maintainers; [benley];
    platforms = with stdenv.lib.platforms; linux;
  };

  patches = [ ./xbindkeys-config-patch1.patch ];

  # killall is dangerous on non-gnu platforms. Use pkill instead.
  postPatch = ''
    substituteInPlace middle.c --replace "killall" "pkill -x"
  '';

  installPhase = ''
    mkdir -p $out/bin $out/share/man/man1
    gzip -c ${./xbindkeys-config.1} > $out/share/man/man1/xbindkeys-config.1.gz
    cp xbindkeys_config $out/bin/xbindkeys-config
    wrapProgram $out/bin/xbindkeys-config --prefix PATH ":" "${procps}/bin"
  '';
}