2017-10-19 06:47:41 +01:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, pythonPackages
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
2019-05-22 22:43:18 +01:00
|
|
|
, libffi, libxml2, zlib
|
2017-10-19 06:47:41 +01:00
|
|
|
, withMan ? true
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "CastXML";
|
2019-05-22 22:43:18 +01:00
|
|
|
version = "0.2.0";
|
2017-10-19 06:47:41 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-05-22 22:43:18 +01:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1qpgr5hyb692h7l5igmq53m6a6vi4d9qp8ks893cflfx9955h3ip";
|
2017-10-19 06:47:41 +01:00
|
|
|
};
|
|
|
|
|
2019-05-22 22:43:18 +01:00
|
|
|
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optionals withMan [ pythonPackages.sphinx ];
|
|
|
|
|
2018-09-09 21:18:34 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCLANG_RESOURCE_DIR=${llvmPackages.clang-unwrapped}"
|
|
|
|
"-DSPHINX_MAN=${if withMan then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
2017-10-19 06:47:41 +01:00
|
|
|
buildInputs = [
|
|
|
|
llvmPackages.clang-unwrapped
|
|
|
|
llvmPackages.llvm
|
2019-05-22 22:43:18 +01:00
|
|
|
libffi libxml2 zlib
|
|
|
|
];
|
2017-10-19 06:47:41 +01:00
|
|
|
|
2019-05-22 22:43:18 +01:00
|
|
|
propagatedBuildInputs = [ llvmPackages.libclang ];
|
2017-10-19 06:47:41 +01:00
|
|
|
|
2019-05-22 22:43:18 +01:00
|
|
|
# 97% tests passed, 97 tests failed out of 2881
|
2017-10-19 06:47:41 +01:00
|
|
|
# mostly because it checks command line and nix append -isystem and all
|
2019-05-22 22:43:18 +01:00
|
|
|
doCheck = false;
|
2017-10-19 06:47:41 +01:00
|
|
|
checkPhase = ''
|
|
|
|
# -E exclude 4 tests based on names
|
|
|
|
# see https://github.com/CastXML/CastXML/issues/90
|
|
|
|
ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2019-05-22 22:43:18 +01:00
|
|
|
homepage = "https://github.com/CastXML/CastXML";
|
2017-10-19 06:47:41 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
description = "Abstract syntax tree XML output tool";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|