summary refs log tree commit diff
path: root/pkgs/applications/editors/neovim/qt.nix
blob: 10522f449ae56918eeb017741634426700027cce (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
{ stdenv, fetchFromGitHub, cmake, qt5, pythonPackages, libmsgpack
, makeWrapper, neovim
}:

let # not very usable ATM
  version = "0.2.1";
in
stdenv.mkDerivation {
  name = "neovim-qt-${version}";

  src = fetchFromGitHub {
    owner = "equalsraf";
    repo = "neovim-qt";
    rev = "v${version}";
    sha256 = "0mqs2f7l05q2ayj77czr5fnpr7fa00qrmjdjxglbwxdxswcsz88n";
  };

  # It tries to download libmsgpack; let's use ours.
  postPatch = let use-msgpack = ''
    cmake_minimum_required(VERSION 2.8.11)
    project(neovim-qt-deps)

    # Similar enough to FindMsgpack
    set(MSGPACK_INCLUDE_DIRS ${libmsgpack}/include PARENT_SCOPE)
    set(MSGPACK_LIBRARIES msgpackc PARENT_SCOPE)
  '';
    in "echo '${use-msgpack}' > third-party/CMakeLists.txt";

  buildInputs = with pythonPackages; [
    cmake qt5.qtbase
    python msgpack jinja2 libmsgpack
    makeWrapper
  ];

  enableParallelBuilding = true;

  postInstall = ''
    wrapProgram "$out/bin/nvim-qt" --prefix PATH : "${neovim}/bin"
  '';

  meta = with stdenv.lib; {
    description = "A prototype Qt5 GUI for neovim";
    license = licenses.isc;
    inherit (neovim.meta) platforms;
  };
}