summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ca/catfish/package.nix
blob: 9a499fe47c3e9c3e50bc0c89c8ca2ae60e22828c (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
  stdenv,
  lib,
  fetchFromGitLab,
  gobject-introspection,
  meson,
  ninja,
  pkg-config,
  wrapGAppsHook3,
  glib,
  gtk3,
  python3,
  xfconf,
  shared-mime-info,
  xdg-utils,
  gitUpdater,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "catfish";
  version = "4.20.1";

  src = fetchFromGitLab {
    domain = "gitlab.xfce.org";
    owner = "apps";
    repo = "catfish";
    rev = "catfish-${finalAttrs.version}";
    hash = "sha256-mTAunc1GJLkSu+3oWD5+2sCQemWdVsUURlP09UkbVyw=";
  };

  nativeBuildInputs = [
    gobject-introspection
    meson
    ninja
    pkg-config
    wrapGAppsHook3
  ];

  buildInputs = [
    glib
    gtk3
    (python3.withPackages (p: [
      p.dbus-python
      p.pygobject3
      p.pexpect
    ]))
    xfconf
  ];

  postPatch = ''
    substituteInPlace catfish/CatfishWindow.py \
      --replace-fail "/usr/share/mime" "${shared-mime-info}/share/mime"
  '';

  preFixup = ''
    # For xdg-mime and xdg-open.
    gappsWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ xdg-utils ]}")
  '';

  passthru.updateScript = gitUpdater { rev-prefix = "catfish-"; };

  meta = {
    homepage = "https://docs.xfce.org/apps/catfish/start";
    description = "Handy file search tool";
    mainProgram = "catfish";
    longDescription = ''
      Catfish is a handy file searching tool. The interface is
      intentionally lightweight and simple, using only GTK 3.
      You can configure it to your needs by using several command line
      options.
    '';
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.linux;
    teams = [ lib.teams.xfce ];
  };
})