2019-08-11 19:48:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2017-10-19 05:47:41 +00:00
|
|
|
, pythonPackages
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
2019-05-22 21:43:18 +00:00
|
|
|
, libffi, libxml2, zlib
|
2017-10-19 05:47:41 +00:00
|
|
|
, withMan ? true
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "CastXML";
|
2019-05-22 21:43:18 +00:00
|
|
|
version = "0.2.0";
|
2017-10-19 05:47:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-05-22 21:43:18 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1qpgr5hyb692h7l5igmq53m6a6vi4d9qp8ks893cflfx9955h3ip";
|
2017-10-19 05:47:41 +00:00
|
|
|
};
|
|
|
|
|
2019-05-22 21:43:18 +00:00
|
|
|
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optionals withMan [ pythonPackages.sphinx ];
|
|
|
|
|
2019-08-11 19:48:38 +00:00
|
|
|
clangVersion = lib.getVersion llvmPackages.clang;
|
|
|
|
|
2018-09-09 20:18:34 +00:00
|
|
|
cmakeFlags = [
|
2019-08-11 19:48:38 +00:00
|
|
|
"-DCLANG_RESOURCE_DIR=${llvmPackages.clang-unwrapped}/lib/clang/${clangVersion}/"
|
2018-09-09 20:18:34 +00:00
|
|
|
"-DSPHINX_MAN=${if withMan then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
2017-10-19 05:47:41 +00:00
|
|
|
buildInputs = [
|
|
|
|
llvmPackages.clang-unwrapped
|
|
|
|
llvmPackages.llvm
|
2019-05-22 21:43:18 +00:00
|
|
|
libffi libxml2 zlib
|
|
|
|
];
|
2017-10-19 05:47:41 +00:00
|
|
|
|
2019-05-22 21:43:18 +00:00
|
|
|
propagatedBuildInputs = [ llvmPackages.libclang ];
|
2017-10-19 05:47:41 +00:00
|
|
|
|
2019-05-22 21:43:18 +00:00
|
|
|
# 97% tests passed, 97 tests failed out of 2881
|
2017-10-19 05:47:41 +00:00
|
|
|
# mostly because it checks command line and nix append -isystem and all
|
2019-05-22 21:43:18 +00:00
|
|
|
doCheck = false;
|
2017-10-19 05:47:41 +00: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 21:43:18 +00:00
|
|
|
homepage = "https://github.com/CastXML/CastXML";
|
2017-10-19 05:47:41 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
description = "Abstract syntax tree XML output tool";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|