summary refs log tree commit diff
path: root/pkgs/applications/networking/mailreaders/astroid/default.nix
blob: 4401a0a7df80fd6a0d8aad3cdeb807794afa621c (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
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, gnome, gmime3, webkitgtk, ronn
, libsass, notmuch, boost, wrapGAppsHook, glib-networking, protobuf, vim_configurable
, gtkmm3, libpeas, gsettings-desktop-schemas, gobject-introspection, python3

# vim to be used, should support the GUI mode.
, vim ? vim_configurable.override { features = "normal"; gui = "auto"; }

# additional python3 packages to be available within plugins
, extraPythonPackages ? []
}:

stdenv.mkDerivation rec {
  pname = "astroid";
  version = "0.15";

  src = fetchFromGitHub {
    owner = "astroidmail";
    repo = "astroid";
    rev = "v${version}";
    sha256 = "11cxbva9ni98gii59xmbxh4c6idcg3mg0pgdsp1c3j0yg7ix0lj3";
  };

  nativeBuildInputs = [
    cmake ronn pkg-config wrapGAppsHook gobject-introspection
    python3 python3.pkgs.wrapPython
  ];

  buildInputs = [
    gtkmm3 gmime3 webkitgtk libsass libpeas
    python3
    notmuch boost gsettings-desktop-schemas gnome.adwaita-icon-theme
    glib-networking protobuf
    vim
  ];

  postPatch = ''
    sed -i "s~gvim ~${vim}/bin/vim -g ~g" src/config.cc
    sed -i "s~ -geom 10x10~~g" src/config.cc
  '';

  pythonPath = with python3.pkgs; requiredPythonModules [ pygobject3 ] ++ extraPythonPackages;
  preFixup = ''
    buildPythonPath "$out $pythonPath"
    gappsWrapperArgs+=(
      --prefix PYTHONPATH : "$program_PYTHONPATH"
    )
  '';

  meta = with lib; {
    homepage = "https://astroidmail.github.io/";
    description = "GTK frontend to the notmuch mail system";
    maintainers = with maintainers; [ bdimcheff SuprDewd ];
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
  };
}