2021-03-14 04:04:16 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, clang-unwrapped
|
2017-10-19 06:47:41 +01:00
|
|
|
, cmake
|
2021-03-14 04:04:16 +00:00
|
|
|
, libclang
|
|
|
|
, libffi
|
|
|
|
, libxml2
|
|
|
|
, llvm
|
|
|
|
, sphinx
|
|
|
|
, zlib
|
|
|
|
, withManual ? true
|
|
|
|
, withHTML ? true
|
2017-10-19 06:47:41 +01:00
|
|
|
}:
|
|
|
|
|
2021-03-14 04:04:16 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "CastXML";
|
|
|
|
version = "0.4.3";
|
2017-10-19 06:47:41 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-03-14 04:04:16 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-MschwCEkZrZmNgr8a1ocdukjXzHbXl2gmkPmygJaA6k=";
|
2017-10-19 06:47:41 +01:00
|
|
|
};
|
|
|
|
|
2021-03-14 04:04:16 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
llvm
|
|
|
|
] ++ lib.optionals (withManual || withHTML) [
|
|
|
|
sphinx
|
|
|
|
];
|
2019-08-11 20:48:38 +01:00
|
|
|
|
2018-09-09 21:18:34 +01:00
|
|
|
cmakeFlags = [
|
2021-03-14 04:04:16 +00:00
|
|
|
"-DCLANG_RESOURCE_DIR=${clang-unwrapped}/lib/clang/${lib.getVersion clang-unwrapped}/"
|
|
|
|
"-DSPHINX_HTML=${if withHTML then "ON" else "OFF"}"
|
|
|
|
"-DSPHINX_MAN=${if withManual then "ON" else "OFF"}"
|
2018-09-09 21:18:34 +01:00
|
|
|
];
|
|
|
|
|
2017-10-19 06:47:41 +01:00
|
|
|
buildInputs = [
|
2021-03-14 04:04:16 +00:00
|
|
|
clang-unwrapped
|
|
|
|
libffi
|
|
|
|
libxml2
|
|
|
|
zlib
|
2019-05-22 22:43:18 +01:00
|
|
|
];
|
2017-10-19 06:47:41 +01:00
|
|
|
|
2021-03-14 04:04:16 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
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;
|
2021-03-14 04:04:16 +00:00
|
|
|
# -E exclude 4 tests based on names
|
|
|
|
# see https://github.com/CastXML/CastXML/issues/90
|
2017-10-19 06:47:41 +01:00
|
|
|
checkPhase = ''
|
2021-03-14 04:04:16 +00:00
|
|
|
runHook preCheck
|
2017-10-19 06:47:41 +01:00
|
|
|
ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd'
|
2021-03-14 04:04:16 +00:00
|
|
|
runHook postCheck
|
2017-10-19 06:47:41 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2019-05-22 22:43:18 +01:00
|
|
|
homepage = "https://github.com/CastXML/CastXML";
|
2021-03-14 04:04:16 +00:00
|
|
|
description = "C-family Abstract Syntax Tree XML Output";
|
2017-10-19 06:47:41 +01:00
|
|
|
license = licenses.asl20;
|
2021-03-14 04:04:16 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2017-10-19 06:47:41 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|