analyze-build, intercept-build, scan-build: init at 19.1.7 (#425936)

This commit is contained in:
Sandro
2025-08-12 15:05:55 +02:00
committed by GitHub
6 changed files with 213 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
{
lib,
llvmPackages,
python3,
}:
let
inherit (llvmPackages) clang-unwrapped;
in
python3.pkgs.buildPythonApplication rec {
pname = "analyze-build";
inherit (clang-unwrapped) version;
format = "other";
src = clang-unwrapped + "/bin";
dontUnpack = true;
dependencies = with python3.pkgs; [
libscanbuild
];
installPhase = ''
mkdir -p "$out/bin"
install "$src/analyze-build" "$out/bin/"
'';
makeWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ clang-unwrapped ])
];
meta = {
description = "run Clang static analyzer against a project with compilation database";
homepage = "https://github.com/llvm/llvm-project/tree/llvmorg-${version}/clang/tools/scan-build-py/";
mainProgram = "scan-build";
license = with lib.licenses; [
asl20
llvm-exception
];
maintainers = with lib.maintainers; [ RossSmyth ];
platforms = lib.intersectLists python3.meta.platforms clang-unwrapped.meta.platforms;
};
}
@@ -0,0 +1,38 @@
{
lib,
llvmPackages,
python3,
}:
let
inherit (llvmPackages) clang-unwrapped;
in
python3.pkgs.buildPythonApplication rec {
pname = "intercept-build";
inherit (clang-unwrapped) version;
format = "other";
src = clang-unwrapped + "/bin";
dontUnpack = true;
dependencies = with python3.pkgs; [
libscanbuild
];
installPhase = ''
mkdir -p "$out/bin"
install "$src/intercept-build" "$out/bin"
'';
meta = {
description = "intercepts the build process to generate a compilation database";
homepage = "https://github.com/llvm/llvm-project/tree/llvmorg-${version}/clang/tools/scan-build-py/";
mainProgram = "intercept-build";
license = with lib.licenses; [
asl20
llvm-exception
];
maintainers = with lib.maintainers; [ RossSmyth ];
};
}
+46
View File
@@ -0,0 +1,46 @@
{
lib,
llvmPackages,
python3,
}:
let
inherit (llvmPackages) clang-unwrapped;
in
python3.pkgs.buildPythonApplication rec {
pname = "scan-build-py";
inherit (clang-unwrapped) version;
format = "other";
src = clang-unwrapped + "/bin";
dontUnpack = true;
dependencies = with python3.pkgs; [
libscanbuild
];
installPhase = ''
mkdir -p "$out/bin"
install "$src/scan-build-py" "$out/bin/scan-build-py"
'';
makeWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ clang-unwrapped ])
];
meta = {
description = "intercepts the build process to generate a compilation database";
homepage = "https://github.com/llvm/llvm-project/tree/llvmorg-${version}/clang/tools/scan-build-py/";
mainProgram = "scan-build-py";
license = with lib.licenses; [
asl20
llvm-exception
];
maintainers = with lib.maintainers; [ RossSmyth ];
platforms = lib.intersectLists python3.meta.platforms clang-unwrapped.meta.platforms;
};
}
@@ -0,0 +1,37 @@
{
lib,
llvmPackages,
buildPythonPackage,
}:
let
inherit (llvmPackages) clang-unwrapped;
in
buildPythonPackage rec {
pname = "libear";
inherit (clang-unwrapped) version;
format = "other";
src = clang-unwrapped.lib + "/lib/libear";
dontUnpack = true;
installPhase = ''
LIBPATH="$(toPythonPath "$out")/libear"
mkdir -p "$LIBPATH"
install -t "$LIBPATH" $src/*
'';
pythonImportsCheck = [ "libear" ];
meta = {
description = "Hooks into build systems to listen to which files are opened";
homepage = "https://github.com/llvm/llvm-project/tree/llvmorg-${version}/clang/tools/scan-build-py/lib/libear";
license = with lib.licenses; [
asl20
llvm-exception
];
maintainers = with lib.maintainers; [ RossSmyth ];
};
}
@@ -0,0 +1,42 @@
{
lib,
llvmPackages,
buildPythonPackage,
libear,
}:
let
inherit (llvmPackages) clang-unwrapped;
in
buildPythonPackage rec {
pname = "libscanbuild";
inherit (clang-unwrapped) version;
format = "other";
src = clang-unwrapped.lib + "/lib/libscanbuild";
dontUnpack = true;
dependencies = [
libear
];
installPhase = ''
LIBPATH="$(toPythonPath "$out")/libscanbuild"
mkdir -p "$LIBPATH"
cp -r "$src/"* "$LIBPATH"
'';
pythonImportsCheck = [ "libscanbuild" ];
meta = {
description = "Captures all child process creation and log information about it";
homepage = "https://github.com/llvm/llvm-project/tree/llvmorg-${version}/clang/tools/scan-build-py/lib/libscanbuild";
license = with lib.licenses; [
asl20
llvm-exception
];
maintainers = with lib.maintainers; [ RossSmyth ];
};
}
+4
View File
@@ -8099,6 +8099,8 @@ self: super: with self; {
(p: p.py)
];
libear = callPackage ../development/python-modules/libear { };
libevdev = callPackage ../development/python-modules/libevdev { };
libfdt = toPythonModule (
@@ -8234,6 +8236,8 @@ self: super: with self; {
}
);
libscanbuild = callPackage ../development/python-modules/libscanbuild { };
libselinux = lib.pipe pkgs.libselinux [
toPythonModule
(