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