summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/xm/xmodmap/package.nix
blob: 9ecb77001d99e808da0f7d53edce55a3bb9218b1 (plain)
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
{
  lib,
  stdenv,
  fetchurl,
  pkg-config,
  libx11,
  xorgproto,
  writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "xmodmap";
  version = "1.0.12";

  src = fetchurl {
    url = "mirror://xorg/individual/app/xmodmap-${finalAttrs.version}.tar.xz";
    hash = "sha256-/FS5tbvyrli6j51CvQUcQcdDg3dADELBfXSW0Z4bs84=";
  };

  strictDeps = true;

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [
    libx11
    xorgproto
  ];

  passthru = {
    updateScript = writeScript "update-${finalAttrs.pname}" ''
      #!/usr/bin/env nix-shell
      #!nix-shell -i bash -p common-updater-scripts
      version="$(list-directory-versions --pname ${finalAttrs.pname} \
        --url https://xorg.freedesktop.org/releases/individual/app/ \
        | sort -V | tail -n1)"
      update-source-version ${finalAttrs.pname} "$version"
    '';
  };

  meta = {
    description = "Utility for modifying keymaps and pointer button mappings in X";
    longDescription = ''
      The xmodmap program is used to edit and display the keyboard modifier map and keymap table
      that are used by client applications to convert event keycodes into keysyms. It is usually run
      from the user's session startup script to configure the keyboard according to personal tastes.
    '';
    homepage = "https://gitlab.freedesktop.org/xorg/app/xmodmap";
    license = with lib.licenses; [
      mit
      mitOpenGroup
    ];
    mainProgram = "xmodmap";
    maintainers = [ ];
    platforms = lib.platforms.unix;
  };
})