3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/castxml/default.nix

53 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub
, python3Packages
, cmake
, llvmPackages
, libffi, libxml2, zlib
, withMan ? true
}:
stdenv.mkDerivation rec {
pname = "CastXML";
2020-08-13 17:51:08 +01:00
version = "0.3.4";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
2020-08-13 17:51:08 +01:00
sha256 = "0ypj67xrgj228myp7l1gsjw1ja97q68nmj98dsd33srmiayqraj4";
};
nativeBuildInputs = [ cmake ] ++ lib.optionals withMan [ python3Packages.sphinx ];
clangVersion = lib.getVersion llvmPackages.clang;
2018-09-09 21:18:34 +01:00
cmakeFlags = [
"-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"}"
];
buildInputs = [
llvmPackages.clang-unwrapped
llvmPackages.llvm
libffi libxml2 zlib
];
propagatedBuildInputs = [ llvmPackages.libclang ];
# 97% tests passed, 97 tests failed out of 2881
# mostly because it checks command line and nix append -isystem and all
doCheck = false;
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 lib; {
homepage = "https://github.com/CastXML/CastXML";
license = licenses.asl20;
description = "Abstract syntax tree XML output tool";
platforms = platforms.unix;
};
}