lol

Merge pull request #37890 from tobimpub/cquery

cquery: init at 2018-03-25

authored by

Jörg Thalheim and committed by
GitHub
683a73f0 8dd73d8b

+82
+5
maintainers/maintainer-list.nix
··· 3586 3586 github = "tnias"; 3587 3587 name = "Philipp Bartsch"; 3588 3588 }; 3589 + tobim = { 3590 + email = "nix@tobim.fastmail.fm"; 3591 + github = "tobimpub"; 3592 + name = "Tobias Mayer"; 3593 + }; 3589 3594 tohl = { 3590 3595 email = "tom@logand.com"; 3591 3596 github = "tohl";
+61
pkgs/development/tools/misc/cquery/default.nix
··· 1 + { stdenv, fetchFromGitHub, makeWrapper 2 + , cmake, llvmPackages, ncurses }: 3 + 4 + let 5 + src = fetchFromGitHub { 6 + owner = "cquery-project"; 7 + repo = "cquery"; 8 + rev = "e45a9ebbb6d8bfaf8bf1a3135b6faa910afea37e"; 9 + sha256 = "049gkqbamq4r2nz9yjcwq369zrmwrikzbhfza2x2vndqzaavq5yg"; 10 + fetchSubmodules = true; 11 + }; 12 + 13 + stdenv = llvmPackages.stdenv; 14 + 15 + in 16 + stdenv.mkDerivation rec { 17 + name = "cquery-${version}"; 18 + version = "2018-03-25"; 19 + 20 + inherit src; 21 + 22 + nativeBuildInputs = [ cmake makeWrapper ]; 23 + buildInputs = with llvmPackages; [ clang clang-unwrapped llvm ncurses ]; 24 + 25 + cmakeFlags = [ 26 + "-DSYSTEM_CLANG=ON" 27 + "-DCLANG_CXX=ON" 28 + ]; 29 + 30 + shell = stdenv.shell; 31 + postFixup = '' 32 + # We need to tell cquery where to find the standard library headers. 33 + 34 + standard_library_includes="\\\"-isystem\\\", \\\"${if (stdenv.hostPlatform.libc == "glibc") then stdenv.cc.libc.dev else stdenv.cc.libc}/include\\\"" 35 + standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\"" 36 + export standard_library_includes 37 + 38 + wrapped=".cquery-wrapped" 39 + export wrapped 40 + 41 + mv $out/bin/cquery $out/bin/$wrapped 42 + substituteAll ${./wrapper} $out/bin/cquery 43 + chmod --reference=$out/bin/$wrapped $out/bin/cquery 44 + ''; 45 + 46 + doInstallCheck = true; 47 + installCheckPhase = '' 48 + pushd ${src} 49 + $out/bin/cquery --ci --clang-sanity-check && \ 50 + $out/bin/cquery --ci --test-unit 51 + ''; 52 + 53 + meta = with stdenv.lib; { 54 + description = "A c/c++ language server powered by libclang"; 55 + homepage = https://github.com/cquery-project/cquery; 56 + license = licenses.mit; 57 + platforms = platforms.linux ++ platforms.darwin; 58 + maintainers = [ maintainers.tobim ]; 59 + priority = 3; 60 + }; 61 + }
+12
pkgs/development/tools/misc/cquery/wrapper
··· 1 + #! @shell@ -e 2 + 3 + initString="--init={\"extraClangArguments\": [@standard_library_includes@" 4 + 5 + if [ "${NIX_CFLAGS_COMPILE}" != "" ]; then 6 + read -a cflags_array <<< ${NIX_CFLAGS_COMPILE} 7 + initString+=$(printf ', \"%s\"' "${cflags_array[@]}") 8 + fi 9 + 10 + initString+="]}" 11 + 12 + exec -a "$0" "@out@/bin/@wrapped@" "${initString}" "${extraFlagsArray[@]}" "$@"
+4
pkgs/top-level/all-packages.nix
··· 7676 7676 7677 7677 cppcheck = callPackage ../development/tools/analysis/cppcheck { }; 7678 7678 7679 + cquery = callPackage ../development/tools/misc/cquery { 7680 + llvmPackages = llvmPackages_6; 7681 + }; 7682 + 7679 7683 creduce = callPackage ../development/tools/misc/creduce { 7680 7684 inherit (perlPackages) perl 7681 7685 ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey;