2024-05-07 01:43:11 +00:00
|
|
|
{
|
2024-08-11 15:54:36 +00:00
|
|
|
lib,
|
2024-05-07 01:43:11 +00:00
|
|
|
cmake,
|
|
|
|
fetchFromGitHub,
|
|
|
|
libffi,
|
|
|
|
libxml2,
|
|
|
|
llvmPackages,
|
|
|
|
python3,
|
|
|
|
stdenv,
|
2024-06-08 01:25:29 +00:00
|
|
|
testers,
|
2024-05-07 01:43:11 +00:00
|
|
|
zlib,
|
|
|
|
# Boolean flags
|
|
|
|
withHTML ? true,
|
|
|
|
withManual ? true,
|
2017-10-19 05:47:41 +00:00
|
|
|
}:
|
|
|
|
|
2022-12-30 03:08:26 +00:00
|
|
|
let
|
|
|
|
inherit (llvmPackages) libclang llvm;
|
|
|
|
inherit (python3.pkgs) sphinx;
|
|
|
|
in
|
2022-11-12 23:03:10 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "castxml";
|
2024-11-28 02:15:23 +00:00
|
|
|
version = "0.6.10";
|
2017-10-19 05:47:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-11-12 23:03:10 +00:00
|
|
|
owner = "CastXML";
|
|
|
|
repo = "CastXML";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-11-28 02:15:23 +00:00
|
|
|
hash = "sha256-3TVJu63O1spleR9hNZKfSNoVa+q+oxtMWCOXetFNrgI=";
|
2017-10-19 05:47:41 +00:00
|
|
|
};
|
|
|
|
|
2024-08-11 15:54:36 +00:00
|
|
|
nativeBuildInputs = [ cmake ] ++ lib.optionals (withManual || withHTML) [ sphinx ];
|
2019-08-11 19:48:38 +00:00
|
|
|
|
2017-10-19 05:47:41 +00:00
|
|
|
buildInputs = [
|
2024-10-14 21:18:53 +00:00
|
|
|
libclang
|
2021-03-14 04:04:16 +00:00
|
|
|
libffi
|
|
|
|
libxml2
|
2024-06-08 00:38:45 +00:00
|
|
|
llvm
|
2021-03-14 04:04:16 +00:00
|
|
|
zlib
|
2024-10-14 21:18:53 +00:00
|
|
|
];
|
2017-10-19 05:47:41 +00:00
|
|
|
|
2024-10-14 21:31:51 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
(lib.cmakeOptionType "path" "CLANG_RESOURCE_DIR"
|
|
|
|
"${lib.getLib libclang}/lib/clang/${lib.versions.major libclang.version}"
|
|
|
|
)
|
2024-06-08 04:02:56 +00:00
|
|
|
|
2024-10-14 21:31:51 +00:00
|
|
|
(lib.cmakeBool "SPHINX_HTML" withHTML)
|
|
|
|
(lib.cmakeBool "SPHINX_MAN" withManual)
|
|
|
|
];
|
2022-01-03 20:16:28 +00:00
|
|
|
|
2024-06-08 04:02:56 +00:00
|
|
|
doCheck = true;
|
2024-05-07 01:43:11 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2024-10-24 05:25:10 +00:00
|
|
|
# darwin clang adds `-isysroot` when $SDKROOT is set. this confuses the
|
|
|
|
# regular expressions for the disabled tests below.
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
ctest -E 'cmd.cc-gnu-(src-cxx|c-src-c)-cmd' -j $NIX_BUILD_CORES
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2024-08-11 15:54:36 +00:00
|
|
|
passthru.tests = testers.testVersion { package = finalAttrs.finalPackage; };
|
2024-06-08 01:25:29 +00:00
|
|
|
|
2024-05-07 01:43:11 +00:00
|
|
|
meta = {
|
2019-05-22 21:43:18 +00:00
|
|
|
homepage = "https://github.com/CastXML/CastXML";
|
2021-03-14 04:04:16 +00:00
|
|
|
description = "C-family Abstract Syntax Tree XML Output";
|
2024-05-07 01:43:11 +00:00
|
|
|
license = lib.licenses.asl20;
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "castxml";
|
2024-08-11 15:55:08 +00:00
|
|
|
maintainers = [ ];
|
2024-05-07 01:43:11 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2017-10-19 05:47:41 +00:00
|
|
|
};
|
2022-11-12 23:03:10 +00:00
|
|
|
})
|