about summary refs log tree commit diff
path: root/pkgs/applications/editors/neovim/qt.nix
blob: 57f52f0e5fcf3dd25184ec1afe14eca793827342 (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
{ stdenv, fetchFromGitHub, cmake, doxygen
, libmsgpack, makeQtWrapper, neovim, pythonPackages, qtbase }:

stdenv.mkDerivation rec {
  name = "neovim-qt-${version}";
  version = "0.2.7";

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

  cmakeFlags = [
    "-DMSGPACK_INCLUDE_DIRS=${libmsgpack}/include"
    "-DMSGPACK_LIBRARIES=${libmsgpack}/lib/libmsgpackc.so"
  ];

  # The following tests FAILED:
  #       2 - tst_neovimconnector (Failed)
  #       3 - tst_callallmethods (Failed)
  #       4 - tst_encoding (Failed)
  #
  # Tests failed when upgraded to neovim 0.2.0
  doCheck = false;

  buildInputs = with pythonPackages; [
    neovim qtbase libmsgpack
  ] ++ (with pythonPackages; [
    jinja2 msgpack python
  ]);

  nativeBuildInputs = [ cmake doxygen makeQtWrapper ];

  enableParallelBuilding = true;

  preConfigure = ''
    # avoid cmake trying to download libmsgpack
    echo "" > third-party/CMakeLists.txt
    # we rip out the gui test as spawning a GUI fails in our build environment
    sed -i '/^add_xtest_gui/d' test/CMakeLists.txt
  '';

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

  meta = with stdenv.lib; {
    description = "Neovim client library and GUI, in Qt5";
    license = licenses.isc;
    maintainers = with maintainers; [ peterhoeg ];
    inherit (neovim.meta) platforms;
    inherit version;
  };
}