Skip to content

Commit

Permalink
cquery: init at 2018-03-25
Browse files Browse the repository at this point in the history
  • Loading branch information
tobim committed Mar 25, 2018
1 parent c948613 commit 4930caa
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Expand Up @@ -3581,6 +3581,11 @@
github = "tnias";
name = "Philipp Bartsch";
};
tobim = {
email = "nix@tobim.fastmail.fm";
github = "tobimpub";
name = "Tobias Mayer";
};
tohl = {
email = "tom@logand.com";
github = "tohl";
Expand Down
54 changes: 54 additions & 0 deletions pkgs/development/tools/misc/cquery/default.nix
@@ -0,0 +1,54 @@
{ stdenv, fetchFromGitHub, makeWrapper
, cmake, llvmPackages, ncurses }:

let
src = fetchFromGitHub {
owner = "cquery-project";
repo = "cquery";
rev = "e45a9ebbb6d8bfaf8bf1a3135b6faa910afea37e";
sha256 = "049gkqbamq4r2nz9yjcwq369zrmwrikzbhfza2x2vndqzaavq5yg";
fetchSubmodules = true;
};

stdenv = llvmPackages.stdenv;

in
stdenv.mkDerivation rec {
name = "cquery-${version}";
version = "2018-03-25";

inherit src;

nativeBuildInputs = [ cmake makeWrapper ];
buildInputs = with llvmPackages; [ clang clang-unwrapped llvm ncurses ];

cmakeFlags = [
"-DSYSTEM_CLANG=ON"
"-DCLANG_CXX=ON"
];

postFixup = ''
# We need to tell cquery where to find the standard library headers.
args="\"-isystem\", \"${if (stdenv.hostPlatform.libc == "glibc") then stdenv.cc.libc.dev else stdenv.cc.libc}/include\""
args+=", \"-isystem\", \"${llvmPackages.libcxx}/include/c++/v1\""
wrapProgram $out/bin/cquery \
--add-flags "'"'--init={"extraClangArguments": ['"''${args}"']}'"'"
'';

doInstallCheck = true;
installCheckPhase = ''
pushd ${src}
$out/bin/cquery --ci --clang-sanity-check && \
$out/bin/cquery --ci --test-unit
'';

meta = with stdenv.lib; {
description = "A c/c++ language server powered by libclang";
homepage = https://github.com/cquery-project/cquery;
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ maintainers.tobim ];
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -7655,6 +7655,10 @@ with pkgs;

cppcheck = callPackage ../development/tools/analysis/cppcheck { };

cquery = callPackage ../development/tools/misc/cquery {
llvmPackages = llvmPackages_6;
};

creduce = callPackage ../development/tools/misc/creduce {
inherit (perlPackages) perl
ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey;
Expand Down

0 comments on commit 4930caa

Please sign in to comment.