lol
1{ stdenv, fetchFromGitHub
2, pythonPackages
3, cmake
4, llvmPackages
5, withMan ? true
6}:
7stdenv.mkDerivation rec {
8
9 name = "${pname}-${version}";
10 pname = "CastXML";
11 version = "20180403";
12
13 src = fetchFromGitHub {
14 owner = "CastXML";
15 repo = "CastXML";
16 rev = "c2a44d06d9379718292b696f4e13a2725ff9d95e";
17 sha256 = "1hjh8ihjyp1m2jb5yypp5c45bpbz8k004f4p1cjw4gc7pxhjacdj";
18 };
19
20 buildInputs = [
21 cmake
22 llvmPackages.clang-unwrapped
23 llvmPackages.llvm
24 ] ++ stdenv.lib.optionals withMan [ pythonPackages.sphinx ];
25
26 propagatedbuildInputs = [ llvmPackages.libclang ];
27
28 preConfigure = ''
29 cmakeFlagsArray+=(
30 ${if withMan then "-DSPHINX_MAN=ON" else ""}
31 )'';
32
33 # 97% tests passed, 96 tests failed out of 2866
34 # mostly because it checks command line and nix append -isystem and all
35 doCheck=false;
36 checkPhase = ''
37 # -E exclude 4 tests based on names
38 # see https://github.com/CastXML/CastXML/issues/90
39 ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd'
40 '';
41
42 meta = with stdenv.lib; {
43 homepage = https://www.kitware.com;
44 license = licenses.asl20;
45 description = "Abstract syntax tree XML output tool";
46 platforms = platforms.unix;
47 };
48}