nixpkgs/pkgs/development/tools/castxml/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.5 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, cmake
, libffi
, libxml2
, zlib
, withManual ? true
, withHTML ? true
, llvmPackages
, python3
}:
let
inherit (llvmPackages) libclang llvm;
inherit (python3.pkgs) sphinx;
in
2022-11-12 23:03:10 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "castxml";
2023-09-22 12:19:32 +00:00
version = "0.6.2";
src = fetchFromGitHub {
2022-11-12 23:03:10 +00:00
owner = "CastXML";
repo = "CastXML";
rev = "v${finalAttrs.version}";
2023-09-22 12:19:32 +00:00
hash = "sha256-x27koa0q+rDqPmfHMf7v7KTx3bfDgqS/FkPAX5auqaw=";
};
nativeBuildInputs = [
cmake
2021-05-07 22:09:34 +00:00
llvm.dev
] ++ lib.optionals (withManual || withHTML) [
sphinx
];
buildInputs = [
2022-01-03 20:16:28 +00:00
libclang
libffi
libxml2
zlib
];
propagatedBuildInputs = [
libclang
];
2022-01-03 20:16:28 +00:00
cmakeFlags = [
"-DCLANG_RESOURCE_DIR=${libclang.dev}/"
"-DSPHINX_HTML=${if withHTML then "ON" else "OFF"}"
"-DSPHINX_MAN=${if withManual then "ON" else "OFF"}"
];
# 97% tests passed, 97 tests failed out of 2881
# mostly because it checks command line and nix append -isystem and all
doCheck = false;
# -E exclude 4 tests based on names
# see https://github.com/CastXML/CastXML/issues/90
checkPhase = ''
runHook preCheck
ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd'
runHook postCheck
'';
meta = with lib; {
homepage = "https://github.com/CastXML/CastXML";
description = "C-family Abstract Syntax Tree XML Output";
license = licenses.asl20;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};
2022-11-12 23:03:10 +00:00
})