about summary refs log tree commit diff
path: root/pkgs/by-name/ke/key-rack/package.nix
blob: dfe104303b2c84587e0f76159e91026fb0106cd4 (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
{
  lib,
  fetchFromGitLab,
  stdenv,
  rustPlatform,
  cargo,
  rustc,
  libadwaita,
  meson,
  ninja,
  nix-update-script,
  pkg-config,
  python3,
  wrapGAppsHook4,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "key-rack";
  version = "0.4.0";

  src = fetchFromGitLab {
    domain = "gitlab.gnome.org";
    owner = "sophie-h";
    repo = "key-rack";
    rev = finalAttrs.version;
    hash = "sha256-mthXtTlyrIChaKKwKosTsV1hK9OQ/zLScjrq6D3CRsg=";
  };

  patches = [ ./0001-fix-E0716.patch ];

  postPatch = ''
    patchShebangs --build build-aux/{checks.sh,read-manifest.py}
  '';

  cargoDeps = rustPlatform.fetchCargoTarball {
    inherit (finalAttrs) pname version src;
    hash = "sha256-wCJTm0W+g3+O1t1fR4maqJoxpPM0NeJG7d54MMAH33c=";
  };

  nativeBuildInputs = [
    cargo
    rustc
    meson
    ninja
    pkg-config
    python3
    rustPlatform.cargoSetupHook
    wrapGAppsHook4
  ];

  buildInputs = [ libadwaita ];

  # Workaround for the gettext-sys issue
  # https://github.com/Koka/gettext-rs/issues/114
  env.NIX_CFLAGS_COMPILE = lib.optionalString (
    stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "16"
  ) "-Wno-error=incompatible-function-pointer-types";

  passthru = {
    updateScript = nix-update-script { };
  };

  meta = {
    description = "View and edit your apps’ keys";
    homepage = "https://gitlab.gnome.org/sophie-h/key-rack";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ getchoo ];
    mainProgram = "key-rack";
    platforms = lib.platforms.linux;
  };
})