mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 07:05:13 +00:00
dae55bc2bd
According to the issue linked at the end, filling arguments for `callPackage` in all-packages.nix breaks splicing and makes the expressions incompatible with cross-compilation. This issue is more pronounced in the many `inherit (darwin)` calls. However, it is present in similar contexts too. The idea here is not the smartest: it just hides those inheritances from `all-packages.nix` and sends them to the `default.nix` expressions. Issue: https://github.com/NixOS/nixpkgs/issues/204303
72 lines
1.5 KiB
Nix
72 lines
1.5 KiB
Nix
{ lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
cmake,
|
|
libffi,
|
|
libxml2,
|
|
zlib,
|
|
withManual ? true,
|
|
withHTML ? true,
|
|
llvmPackages,
|
|
python3,
|
|
}:
|
|
|
|
let
|
|
inherit (llvmPackages) libclang llvm;
|
|
inherit (python3.pkgs) sphinx;
|
|
in
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "castxml";
|
|
version = "0.5.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "CastXML";
|
|
repo = "CastXML";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-XZIVOrTY6Ib5Cu1WtTJm5Bqoas1NbNWbvJPWkpFqH2c=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
llvm.dev
|
|
] ++ lib.optionals (withManual || withHTML) [
|
|
sphinx
|
|
];
|
|
|
|
buildInputs = [
|
|
libclang
|
|
libffi
|
|
libxml2
|
|
zlib
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
libclang
|
|
];
|
|
|
|
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;
|
|
};
|
|
})
|