about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/gnome/apps/polari/default.nix
blob: 31ad6c94a6a9b19e6f249d70be848a4c9fe32427 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{ stdenv
, lib
, itstool
, fetchurl
, gdk-pixbuf
, telepathy-glib
, gjs
, meson
, ninja
, gettext
, telepathy-idle
, libxml2
, desktop-file-utils
, pkg-config
, gtk4
, libadwaita
, gtk3
, glib
, libsecret
, libsoup_3
, webkitgtk_4_1
, gobject-introspection
, appstream-glib
, gnome
, wrapGAppsHook4
, telepathy-logger
, gspell
, gsettings-desktop-schemas
}:

stdenv.mkDerivation rec {
  pname = "polari";
  version = "45.0";

  src = fetchurl {
    url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz";
    sha256 = "nbfdwJSqhVfxkXfhZMQti+Fn9UckuScTC3YhyCnB1KE=";
  };

  patches = [
    # Upstream runs the thumbnailer by passing it to gjs.
    # If we wrap it in a shell script, gjs can no longer run it.
    # Let’s change the code to run the script directly by making it executable and having gjs in shebang.
    ./make-thumbnailer-wrappable.patch
  ];

  propagatedUserEnvPkgs = [
    telepathy-idle
    telepathy-logger
  ];

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    itstool
    gettext
    wrapGAppsHook4
    libxml2
    desktop-file-utils
    gobject-introspection
    appstream-glib
  ];

  buildInputs = [
    gtk4
    libadwaita
    gtk3 # for thumbnailer
    glib
    gsettings-desktop-schemas
    telepathy-glib
    telepathy-logger
    gjs
    gspell
    gdk-pixbuf
    libsecret
    libsoup_3
    webkitgtk_4_1 # for thumbnailer
  ];

  postFixup = ''
    wrapGApp "$out/share/polari/thumbnailer.js"
  '';

  passthru = {
    updateScript = gnome.updateScript {
      packageName = pname;
      attrPath = "gnome.${pname}";
    };
  };

  meta = with lib; {
    homepage = "https://wiki.gnome.org/Apps/Polari";
    description = "IRC chat client designed to integrate with the GNOME desktop";
    mainProgram = "polari";
    maintainers = teams.gnome.members;
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}