2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
cmake,
|
|
|
|
fetchFromGitHub,
|
|
|
|
lib,
|
|
|
|
libffi,
|
|
|
|
libxml2,
|
|
|
|
llvmPackages,
|
|
|
|
python3,
|
|
|
|
stdenv,
|
2024-06-20 14:57:18 +00:00
|
|
|
testers,
|
2024-05-15 15:35:15 +00:00
|
|
|
zlib,
|
|
|
|
# Boolean flags
|
|
|
|
withHTML ? true,
|
|
|
|
withManual ? true,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
let
|
|
|
|
inherit (llvmPackages) libclang llvm;
|
|
|
|
inherit (python3.pkgs) sphinx;
|
|
|
|
in
|
2022-11-21 17:40:18 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "castxml";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.6.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-11-21 17:40:18 +00:00
|
|
|
owner = "CastXML";
|
|
|
|
repo = "CastXML";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-icTos9HboZXvojQPX+pRkpBYiZ5SXSMb9XtvRnXNHuo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2024-05-15 15:35:15 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (withManual || withHTML) [
|
2021-03-19 17:17:44 +00:00
|
|
|
sphinx
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-03-19 17:17:44 +00:00
|
|
|
libffi
|
|
|
|
libxml2
|
2024-06-20 14:57:18 +00:00
|
|
|
llvm
|
2021-03-19 17:17:44 +00:00
|
|
|
zlib
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2021-03-19 17:17:44 +00:00
|
|
|
libclang
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
cmakeFlags = [
|
2024-06-20 14:57:18 +00:00
|
|
|
(lib.cmakeOptionType "path" "CLANG_RESOURCE_DIR"
|
|
|
|
"${lib.getLib libclang}/lib/clang/${lib.versions.major libclang.version}")
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
(lib.cmakeBool "SPHINX_HTML" withHTML)
|
|
|
|
(lib.cmakeBool "SPHINX_MAN" withManual)
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
(lib.cmakeOptionType "path" "Clang_DIR" "${lib.getDev libclang}/lib/cmake/clang")
|
2022-01-07 04:07:37 +00:00
|
|
|
];
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
doCheck = true;
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
passthru.tests = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/CastXML/CastXML";
|
2021-03-19 17:17:44 +00:00
|
|
|
description = "C-family Abstract Syntax Tree XML Output";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = lib.licenses.asl20;
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "castxml";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-11-21 17:40:18 +00:00
|
|
|
})
|