nixpkgs/pkgs/by-name/ca/castxml/package.nix

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

74 lines
1.5 KiB
Nix
Raw Normal View History

{
2024-08-11 15:54:36 +00:00
lib,
cmake,
fetchFromGitHub,
libffi,
libxml2,
llvmPackages,
python3,
stdenv,
testers,
zlib,
# Boolean flags
withHTML ? true,
withManual ? true,
}:
let
inherit (llvmPackages) libclang llvm;
inherit (python3.pkgs) sphinx;
in
2022-11-12 23:03:10 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "castxml";
2024-07-03 03:26:25 +00:00
version = "0.6.8";
src = fetchFromGitHub {
2022-11-12 23:03:10 +00:00
owner = "CastXML";
repo = "CastXML";
rev = "v${finalAttrs.version}";
2024-07-03 03:26:25 +00:00
hash = "sha256-J4Z/NjCVOq4QS7ncCi87P5YPgqRwFyDAc14uS5T7s6M=";
};
2024-08-11 15:54:36 +00:00
nativeBuildInputs = [ cmake ] ++ lib.optionals (withManual || withHTML) [ sphinx ];
buildInputs = [
libclang
libffi
libxml2
llvm
zlib
];
cmakeFlags = [
(lib.cmakeOptionType "path" "CLANG_RESOURCE_DIR"
"${lib.getLib libclang}/lib/clang/${lib.versions.major libclang.version}"
)
(lib.cmakeBool "SPHINX_HTML" withHTML)
(lib.cmakeBool "SPHINX_MAN" withManual)
];
2022-01-03 20:16:28 +00:00
doCheck = true;
strictDeps = true;
# 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; };
meta = {
homepage = "https://github.com/CastXML/CastXML";
description = "C-family Abstract Syntax Tree XML Output";
license = lib.licenses.asl20;
mainProgram = "castxml";
maintainers = [ ];
platforms = lib.platforms.unix;
};
2022-11-12 23:03:10 +00:00
})