2021-03-19 17:17:44 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake
|
2021-03-19 17:17:44 +00:00
|
|
|
, libclang
|
|
|
|
, libffi
|
|
|
|
, libxml2
|
|
|
|
, llvm
|
|
|
|
, sphinx
|
|
|
|
, zlib
|
|
|
|
, withManual ? true
|
|
|
|
, withHTML ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "CastXML";
|
2022-01-07 04:07:37 +00:00
|
|
|
version = "0.4.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-03-19 17:17:44 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-07 04:07:37 +00:00
|
|
|
hash = "sha256-VtkMjZOcF5OAHkezlupXOpNwqUD1oKHdRbtG2FZBRL4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-05-20 23:08:51 +00:00
|
|
|
llvm.dev
|
2021-03-19 17:17:44 +00:00
|
|
|
] ++ lib.optionals (withManual || withHTML) [
|
|
|
|
sphinx
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2022-01-07 04:07:37 +00:00
|
|
|
libclang
|
2021-03-19 17:17:44 +00:00
|
|
|
libffi
|
|
|
|
libxml2
|
|
|
|
zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
libclang
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCLANG_RESOURCE_DIR=${libclang.dev}/"
|
|
|
|
"-DSPHINX_HTML=${if withHTML then "ON" else "OFF"}"
|
|
|
|
"-DSPHINX_MAN=${if withManual then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# 97% tests passed, 97 tests failed out of 2881
|
|
|
|
# mostly because it checks command line and nix append -isystem and all
|
|
|
|
doCheck = false;
|
2021-03-19 17:17:44 +00:00
|
|
|
# -E exclude 4 tests based on names
|
|
|
|
# see https://github.com/CastXML/CastXML/issues/90
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
2021-03-19 17:17:44 +00:00
|
|
|
runHook preCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd'
|
2021-03-19 17:17:44 +00:00
|
|
|
runHook postCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/CastXML/CastXML";
|
2021-03-19 17:17:44 +00:00
|
|
|
description = "C-family Abstract Syntax Tree XML Output";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2021-03-19 17:17:44 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|