2019-08-11 20:48:38 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-10-29 09:01:18 +00:00
|
|
|
, python3Packages
|
2017-10-19 06:47:41 +01:00
|
|
|
, 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";
|
2020-08-13 17:51:08 +01:00
|
|
|
version = "0.3.4";
|
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}";
|
2020-08-13 17:51:08 +01:00
|
|
|
sha256 = "0ypj67xrgj228myp7l1gsjw1ja97q68nmj98dsd33srmiayqraj4";
|
2017-10-19 06:47:41 +01:00
|
|
|
};
|
|
|
|
|
2020-10-29 09:01:18 +00:00
|
|
|
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optionals withMan [ python3Packages.sphinx ];
|
2019-05-22 22:43:18 +01:00
|
|
|
|
2019-08-11 20:48:38 +01:00
|
|
|
clangVersion = lib.getVersion llvmPackages.clang;
|
|
|
|
|
2018-09-09 21:18:34 +01:00
|
|
|
cmakeFlags = [
|
2019-08-11 20:48:38 +01:00
|
|
|
"-DCLANG_RESOURCE_DIR=${llvmPackages.clang-unwrapped}/lib/clang/${clangVersion}/"
|
2018-09-09 21:18:34 +01:00
|
|
|
"-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;
|
|
|
|
};
|
|
|
|
}
|